The “doctl compute droplet” command is a functionality provided by the DigitalOcean command-line interface (CLI) tool. This command allows you to perform various operations related to virtual machines, which DigitalOcean refers to as “droplets.”
When you execute the “doctl compute droplet” command, you have several options available to interact with droplets:
- List droplets: You can use the “doctl compute droplet list” command to retrieve a list of all the droplets present in your DigitalOcean account. The output typically includes details such as the droplet’s name, unique identifier, size (CPU, RAM, and storage), region, IP addresses, and status.
- Create droplets: With the “doctl compute droplet create” command, you can initiate the creation of a new droplet. You will need to specify various parameters during the creation process, such as the droplet’s name, size, region, operating system image, SSH keys for authentication, and other configuration options. Once the command is executed, DigitalOcean provisions a new droplet based on your specifications.
- Delete droplets: The “doctl compute droplet delete” command allows you to remove a droplet from your DigitalOcean account. You need to provide the droplet’s unique identifier or its name as an argument to the command. Upon execution, DigitalOcean permanently deletes the specified droplet and any associated data. Be cautious when using this command, as it cannot be undone.
By utilizing these commands, you can effectively manage your virtual machines (droplets) within your DigitalOcean account. This includes listing all droplets to get an overview of your infrastructure, creating new droplets to scale your resources, and deleting droplets that are no longer needed.
It’s important to note that the DigitalOcean CLI tool is subject to updates and improvements over time. Therefore, it’s advisable to consult the official documentation or use the “–help” flag alongside the specific command to access the most up-to-date information and understand the available options for managing droplets using “doctl compute droplet.”
doctl compute droplet Command Examples
1. Create a droplet:
# doctl compute droplet create --region region --image os_image --size vps_type droplet_name
2. Delete a droplet:
# doctl compute droplet delete droplet_id|droplet_name
3. List droplets:
# doctl compute droplet list