Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk5 min

How to Manage DigitalOcean Droplets From the Command Line

A practical doctl walkthrough for authenticating, choosing current Droplet options, creating and resizing servers, and managing Cloud Firewalls safely.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use DigitalOcean’s official doctl command-line interface to authenticate to your account, discover current Droplet options, and create or manage Droplets through the DigitalOcean API. Start by installing and authenticating doctl, then query current regions, sizes, and images before you provision anything; these options can change over time.

What doctl does—and what you need first

DigitalOcean describes doctl as its official command-line interface. It communicates with the DigitalOcean API and supports most Control Panel functionality. DigitalOcean provides installations for Windows, macOS, and Linux. The current installation and configuration instructions are in the doctl CLI documentation.

As an Amazon Associate I earn from qualifying purchases.

Before using it, you need a DigitalOcean account and a personal access token. Treat that token like a password: do not put a real token in a tutorial, shell command you plan to share, source repository, or screenshot. The authentication and creation workflow is covered in DigitalOcean’s Droplet creation guide.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install and authenticate doctl

  1. Install doctl for your operating system by following DigitalOcean’s current installation instructions. Use the official documentation for the appropriate package or installation method.

  2. Create a personal access token in your DigitalOcean account. Grant only the access needed for the operations you intend to perform, and store the token securely.

  3. In a terminal, run doctl auth init and follow the prompt to authenticate with the token. Do not paste the token into a public command example or save it in a script that others can access.

  4. Check available command groups and options with doctl compute --help or the help for a specific command. CLI syntax and resource options can change; consult the current doctl command reference when an option is unclear.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Find valid regions, sizes, and images

Do not rely on an old copied size or image slug. Before creating a Droplet, query the values currently available to your account:

  • doctl compute region list lists regions.
  • doctl compute size list lists Droplet sizes.
  • doctl compute image list-distribution lists distribution images.

Choose an image that fits the operating system or software workload, a size with suitable capacity, and a region appropriate for your deployment. Availability and slugs may vary, so use the results from your own account rather than treating an example as evergreen.

Create a Droplet

The basic command form documented by DigitalOcean is:

doctl compute droplet create <droplet-name> --size <size-slug> --image <image-slug> --region <region-slug>

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

--size and --image are required. You can specify a region explicitly; if you omit it, the account’s default region is used. Replace each placeholder with a value returned by the listing commands rather than copying a dated slug. Review the current Droplet create command reference for optional settings, including SSH keys and user data.

For authentication to the Droplet itself, DigitalOcean says SSH-key authentication is more secure than password authentication. Decide how you will access and maintain the server before provisioning it, and keep private keys private. Other setup decisions—such as backups, monitoring, IPv6, private networking, tags, and firewall attachment—depend on the workload. Backups add cost, so check the current pricing and backup options before enabling them.

Inspect, operate, and destroy Droplets

Use the current command reference or doctl compute --help to identify commands for listing and retrieving Droplets and for actions such as rebooting, snapshots, and backup-related operations. DigitalOcean’s Droplet API reference documents the underlying resource operations.

Separate routine inspection from changes that interrupt service or delete data. Listing or retrieving a Droplet is observational; rebooting interrupts workloads; destroying a Droplet is destructive. Before running a destroy command, verify the target identifier and confirm that anything you need has been backed up or moved. Read the command’s current help output before executing an operation that changes or removes a resource.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Resize a Droplet safely

DigitalOcean’s resize guidance calls for shutting down the Droplet, performing the resize, and powering it back on. The documented approach recommends shutting down from inside the guest operating system first to reduce data-corruption risk:

  1. Connect to the Droplet and run sudo shutdown -h now to shut down the operating system cleanly. Ensure services have stopped and important data is saved.

  2. After the Droplet is off, use the documented doctl power-off and resize actions with a current size slug. Follow the current Droplet resize guide for exact syntax.

  3. Power the Droplet back on using the documented CLI action, then verify that it boots and that its services work as expected.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not treat --resize-disk=true as a harmless default. A disk resize changes disk capacity, and whether a resize direction is supported depends on the selected option. Check the current guide and the consequences for your Droplet before including that flag.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Apply Cloud Firewall rules deliberately

DigitalOcean Cloud Firewalls are stateful, network-based firewalls for Droplets. They block traffic unless a rule expressly allows it. Create inbound and outbound rules for the ports and sources the service actually needs; avoid broad access rules unless the workload requires them. DigitalOcean’s guides explain creating a Cloud Firewall and managing one.

When attaching a firewall, confirm that it applies to the intended Droplets. The management documentation describes listing Droplet IDs and using doctl compute firewall add-droplets or doctl compute firewall remove-droplets to change attachment. Use IDs or supported tags deliberately, then verify the resulting association and rules.

Common command-line management mistakes

  • A copied create command fails: a region, size, or image slug may no longer be available. Re-run the region, size, and distribution-image listing commands and use a current result.
  • Authentication fails: check that doctl auth init completed and that the token is valid and has the access needed for the operation. Do not disclose the token while troubleshooting.
  • A service becomes unreachable after firewall changes: Cloud Firewalls deny traffic without an allowing rule. Check the required inbound and outbound ports, sources, and Droplet attachment.
  • A resize does not proceed as expected: confirm that the Droplet was cleanly shut down, use the current resize workflow, and review disk-resize implications before setting --resize-disk=true.
  • A destructive command targets the wrong server: stop before execution and verify the Droplet ID and account context. Prefer an inspection step before any destroy operation.

Or let it run in the cloud

If your separate goal is keeping a pre-recorded YouTube channel live 24/7, StreamNeo is a different tool from doctl: upload a recording or build a playlist, add your YouTube stream key, and go live. Nothing has to stay on at home; it streams uploaded video at the quality you made it, up to 4K 60fps, at one price per slot, and automatically recovers if YouTube drops the stream. The first day is free with no card. Monthly: $9.99 per month. See StreamNeo or start the free day.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.