Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

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.
Hello,
You could use the following request to generate your new Droplet:
curl -X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer $TOKEN' -d \
'{"name":"example.com","region":"nyc3","size":"512mb","image": 12345}' \
"https://api.digitalocean.com/v2/droplets"
You need to change the details so that they match your requirements, and also you need to change the image ID with your snapshot ID as well.
In case that you need to get your image ID, you can do it with this request:
- curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" "https://api.digitalocean.com/v2/images?page=1&per_page=1&private=true"
For more information, you can take a look at the official documentation here:
In case that you wanted to run some specific commands, you could also pass user data to your API request like this:
curl -X POST "https://api.digitalocean.com/v2/droplets" \
-d'{"name":"metadata.example.com","region":"nyc3","size":"s-1vcpu-1gb","vpc_uuid":"c33931f2-a26a-4e61-b85c-4e95a2ec431b","image":"ubuntu-20-04-x64","user_data":
"#!/bin/bash
apt-get -y update
apt-get -y install nginx
export HOSTNAME=$(curl -s http://169.254.169.254/metadata/v1/hostname)
export PUBLIC_IPV4=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address)
echo Droplet: $HOSTNAME, IP Address: $PUBLIC_IPV4 > /usr/share/nginx/html/index.html",
"ssh_keys":[ < SSH KEY IDs > ]}' \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
For more information on user data you can take a look at the following documentation:
https://www.digitalocean.com/docs/droplets/how-to/provide-user-data/
Hope that this helps! Regards, Bobby