How to Completely Disable ‘Cloud-Init’ (Cloud Instance Provisioning) in Ubuntu Server

When you install modern versions of Ubuntu Server, the operating system includes a powerful configuration package called cloud-init. This software was originally designed for massive cloud providers (like AWS or DigitalOcean). When a new virtual machine boots for the first time, cloud-init reaches out to the hypervisor’s metadata server, downloads the user’s SSH keys, configures the network interfaces, and provisions the hostname automatically.

While this is essential for automated cloud deployments, it is completely unnecessary—and often actively detrimental—when you are installing Ubuntu Server on bare-metal hardware or setting up a simple home lab via a local ISO image. On a local server, cloud-init will spend minutes during every boot sequence fruitlessly searching for a cloud metadata server that doesn’t exist, significantly delaying your startup time. Furthermore, it aggressively intercepts and overwrites your manual Netplan configurations. If you are building a bare-metal server and want absolute, manual control over your networking and host configurations without interference, you must completely disable cloud-init.

Disabling Cloud-Init via Configuration File

You can instruct the cloud-init daemon to permanently disable itself by creating an overriding configuration file.

  1. Open a Terminal session (or connect to your server via SSH).
  2. You must create a specific override file in the cloud-init directory. Run the following command with root privileges:
    sudo touch /etc/cloud/cloud-init.disabled
  3. (Note: Creating this empty file acts as a kill switch. The daemon checks for the existence of this file during early boot; if it finds it, it immediately terminates itself).

Uninstalling Cloud-Init Completely

For maximum system sterility, you should not only disable the daemon but completely purge the package and all its dependencies from your server, reclaiming disk space and ensuring it can never accidentally reactivate.

  1. Purge the software package using the APT package manager:
    sudo apt-get purge cloud-init -y
  2. Remove any remaining configuration directories that were left behind:
    sudo rm -rf /etc/cloud/ && sudo rm -rf /var/lib/cloud/
  3. Reboot your server immediately to test the new configuration:
    sudo reboot

Upon reboot, you will notice that the boot sequence is significantly faster, as the system no longer pauses to search for cloud metadata servers. More importantly, any manual changes you make to your /etc/netplan/*.yaml or /etc/hostname files will now be strictly respected and will never be mysteriously overwritten during a reboot.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.