Hey, is there a way I can run a shell script I created on my droplet through the API?
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!
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.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Hi there,
You can run a shell script during the Droplet creation process using the user-data option described here:
Once the Droplet is created, the DigitalOcean API would not have access to run any commands on the Droplet itself, as the Droplets are unmanaged meaning that only you would have root access to them.
You could run your shell scripts in a variety of different ways:
There are other wise of doing this as well, feel free to share more information about your use case and I will be happy to make more suggestions!
Best,
Bobby