Cloud-init is an open-source project compatible with most Linux distributions. Cloud-init is designed to handle early initialization of a cloud instance and uses userdata to describe the cloud instance's configuration settings. When Cloud-init detects userdata, it applies the settings to the cloud instance.
Cloud-init is third-party software and is not supported by Vultr. See this article for more information about cloud-init issues. Vultr instances created before 2017 had this software installed by default. New deployments of our standard OS images do not include cloud-init. If you decide to install Cloud-init on your instance, please see the official cloud-init documentation.
We recommend using Vultr startup scripts instead of cloud-init. You can add startup scripts to an instance in the Vultr Control panel or with the Vultr API. Read more about startup scripts in our quickstart guide.
$ curl https://api.vultr.com/v1/server/set_user_data \ -H 'API-Key: YOUR_API_KEY' \ --data 'SUBID=YOUR_SUB_ID' \ --data 'userdata=QmUgU3VyZSBUbyBEcmluayBZb3VyIE92YWx0aW5lLgo='
To retrieve the user data, use the
/latest/user-data endpoint. The Base64 encoded value is decoded and returned as text.
# curl http://169.254.169.254/latest/user-data Be Sure To Drink Your Ovaltine.
If you update a running instance,
/latest/user-data will return old values until the instance is rebooted or reinstalled.