Linux command
doctl-compute-droplet 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
List all droplets
doctl compute droplet list
Create a droplet
doctl compute droplet create [name] --size [s-1vcpu-1gb] --image [ubuntu-22-04-x64] --region [nyc1]
Get droplet details
doctl compute droplet get [droplet_id]
Delete a droplet
doctl compute droplet delete [droplet_id]
SSH into droplet
doctl compute ssh [droplet_name]
List snapshots
doctl compute droplet snapshots [droplet_id]
Create a droplet with tags
doctl compute droplet create [name] --size [s-1vcpu-1gb] --image [ubuntu-22-04-x64] --region [nyc1] --tag-name [web] --enable-monitoring
说明
doctl compute droplet manages DigitalOcean Droplets (virtual machines). It provides full lifecycle control including creation, configuration, monitoring, and deletion of cloud servers. Droplets can be created with various configurations specifying size, region, image, and networking options. The command supports actions like reboot, power cycle, resize, and snapshot creation. Integration with SSH keys enables secure access, and the ssh subcommand provides convenient direct connection to droplets by name.
参数
- list
- List all droplets.
- create _NAME_
- Create new droplet.
- --size _SLUG_
- Droplet size slug.
- --image _IMAGE_
- OS image slug or ID.
- --region _REGION_
- Data center region.
- --ssh-keys _IDS_
- SSH key IDs or fingerprints.
- --vpc-uuid _UUID_
- UUID of a non-default VPC to create the Droplet in.
- --enable-backups
- Enable automatic daily backups.
- --enable-monitoring
- Install the DigitalOcean monitoring agent.
- --tag-name _TAG_
- Apply a tag to the Droplet.
- --user-data _DATA_
- Shell script or cloud-init data to run on first boot.
- --wait
- Wait for Droplet creation to complete before returning.
- delete _ID_
- Delete droplet.
- ssh _NAME_
- SSH into droplet.
- --help
- Display help information.
FAQ
What is the doctl-compute-droplet command used for?
doctl compute droplet manages DigitalOcean Droplets (virtual machines). It provides full lifecycle control including creation, configuration, monitoring, and deletion of cloud servers. Droplets can be created with various configurations specifying size, region, image, and networking options. The command supports actions like reboot, power cycle, resize, and snapshot creation. Integration with SSH keys enables secure access, and the ssh subcommand provides convenient direct connection to droplets by name.
How do I run a basic doctl-compute-droplet example?
Run `doctl compute droplet list` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does list do in doctl-compute-droplet?
List all droplets.