Question

What is Enable User Data?

  • Posted on October 29, 2014
  • danielmdAsked by danielmd

What does the Enable User Data option provide? I don’t understand the meaning.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

The Enable User Data setting allows you to pass arbitrary data into the user-data key of the DigitalOcean Metadata service. You can then retrieve that data on your droplet by running:

curl -w "\n" http://169.254.169.254/metadata/v1/user-data

On it’s own, that’s not very exciting but it allows for some interesting things when you combine it with a program called CloudInit that is installed by default on Ubuntu 14.04 and up as well as CentOS 7. It processes the user data and runs it on the droplet. For instance, you could put a bash script in there and it will be run on first boot. People use this to do a lot of initial set up on their droplets like installing packages. For more info, see this tutorial: