I’d like to automatically run these steps when a new droplet is created:
Is this possible and how would i be able to accomplish this, say, with your api?
I would also need to work with serverpilots api as well correct?
Perhaps use the two together to create a dashboard of some sorts?
Thanks ahead of time!
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!
We just released a new feature that sounds like it might help with this use case. Our metadata service allows you to provide “user-data” when you create a new droplet. This data can then be used to allow you to configure the server on first boot. It will run bash scripts or cloud-config files.
Using a cloud-config file, you could run the ServerPilot script automatically on first boot and set a root password. It would look something like:
#cloud-config
runcmd:
- echo "You can run arbitrary commands"
chpasswd:
list: |
root:foobarbaz
expire: True
This would set a root password that had to be changed on first login.
Of course there is a lot more you can do with this, create new users, add ssh keys, etc… For more information, check out these tutorials:
Hello guys, I have been trying to achieve this in PHP but failed so far :( any help would be welcome, I need to connect my droplet when I create it with DO API … Thanks in advance for taking the time to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.