I'm using Ubuntu 14.04 image as my base box for vagrant. Unfortunately this base box contains cloud-init which causes many problems during starting-up the machine: https://github.com/mitchellh/vagrant/issues/3860

I'm not using my machine in the cloud so I don't really need this. I though typing:

sudo apt-get remove cloud-init

will solve my problems but the machine still spend about 3 minutes on startup trying to configure something I don't need.

I can see there a a number of cloud-init related files in /etc/init (for example cloud-init.conf, cloud-final.conf, cloud-config.conf etc). I could delete them but I'm not sure if this is safe.

I've also installed rcconf to check all starup scripts but I can't find anything related to cloud-init there. Any ideas?

4 Answers 4


According to the cloud-init docs the way to disable it is:

sudo touch /etc/cloud/cloud-init.disabled

And/or set cloud-init=disabled on the kernel command line if it's enabled that way.

  • 2
    Note that it does not remove it. It is still there but it will stop trying to configure stuff at a very early stage. See cloudinit.readthedocs.io/en/latest/topics/boot.html Mar 13, 2019 at 7:41
  • Sure that's why I said it would disable it.
    – Pierz
    Mar 13, 2019 at 21:33
  • 3
    Yes you are right. My comment is useless. Mar 14, 2019 at 5:30
  • the "cloud-init=disabled" doesn't work as of may 2020.
    – HelpNeeder
    May 13, 2020 at 2:15
  • @Pierz Are you willing to reword you response so that it answers the question as asked? Perhaps lead with the answer of how to remove, then follow with a work-around of disable ?
    – null
    Mar 15, 2021 at 12:56

This worked for me in Ubuntu Server 18.04.1 LST

  1. $ echo 'datasource_list: [ None ]' | sudo -s tee /etc/cloud/cloud.cfg.d/90_dpkg.cfg

  2. $ sudo apt-get purge cloud-init

  3. $ sudo rm -rf /etc/cloud/; sudo rm -rf /var/lib/cloud/

  4. $ reboot

Good Luck.

  • 6
    Really? Changig a file you delete two steps later? Seems like you can skip the first step. Feb 20, 2019 at 13:19
  • 2
    Seems like a mix is the key: touch /etc/cloud/cloud-init.disabled then reboot to stop it. Then step 2-3 from Lion's answer above gets rid of it forever.
    – Tim
    Feb 24, 2020 at 17:06
  • 1
    It has worked on Ubuntu Server 20.04.2 too... Thanks
    – Andras
    Feb 10, 2021 at 20:56

On 14.04 you can use dpkg-reconfigure to disable cloud-init in the following way:

echo 'datasource_list: [ None ]' | sudo -s tee /etc/cloud/cloud.cfg.d/90_dpkg.cfg
sudo dpkg-reconfigure -f noninteractive cloud-init

or just use sudo dpkg-reconfigure cloud-init to do it interactively.

  • Are you willing to reword you response so that it answers the question as asked? Perhaps lead with the answer of how to remove, then follow with a work-around of disable ?
    – null
    Mar 15, 2021 at 12:57

Cloud Init is there to configure networking and it can be stopped at different stages. In recent versions, you can disable Cloud Init at the first stage by making sure the following file exists:


or at a later stage by making sure the file /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg exists with the following content:

network: {config: disabled}

You can use this command for it:

$ sudo echo "network: {config: disabled}" > /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg

This information can be found in the header comments of /etc/netplan/50-cloud-init.yaml, which in part read as follows:

# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}

This is from the file in Ubuntu 18.04 LTS and likely to also be valid for later releases.

  • IMHO, it only disables its network configuration part. Thus it is not enough. Mar 13, 2019 at 7:39
  • @LudovicKuty Which is precisely what cloud-init is there to do: configure things. Thus, if you get it to stop trying to configure things, you have accomplished your goal and it is enough to make it stay out of your way. If you insist it isn't, then please explain what "enough" would be, exactly.
    – code_dredd
    Mar 13, 2019 at 8:55
  • It might still tries to configure other stuff than networking. IMHO the OP wanted to disable it completely. Note that this granularity might be interesting in other cases. Mar 13, 2019 at 9:02
  • @LudovicKuty Your comments are coming across as speculative ("IMHO", "it might ...", etc). Unless you can show that the documentation is wrong and that it does continue to try things after being told not to, I don't think there's much more to this, and in that case, you'd be better off reporting a bug to them. This has been enough every time I've done it in my servers.
    – code_dredd
    Mar 13, 2019 at 9:11
  • Go check cloudinit.readthedocs.io/en/latest/topics/boot.html vs cloudinit.readthedocs.io/en/latest/topics/network-config.html. You're criticizing my "IMHO" and "might" and you're writing "the correct way to disable Cloud Init is with this command" but you should have added "IMHO" since it is not the correct way to do it. Mar 13, 2019 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.