DigitalOcean Basics Cheat Sheet
Covers DigitalOcean's core products including Droplets, App Platform, Spaces, and Managed Databases, with doctl CLI examples.
Core Products
DigitalOcean's main service offerings.
- Droplet- A virtual machine instance, DigitalOcean's core compute product
- App Platform- PaaS for deploying apps directly from a Git repo without managing servers
- Spaces- S3-compatible object storage with a built-in CDN
- Managed Databases- Hosted PostgreSQL, MySQL, Redis/Valkey, and MongoDB with automated backups
- DOKS- DigitalOcean Kubernetes Service, a managed Kubernetes offering
- Volumes- Block storage that can be attached to Droplets, resizable independently
doctl CLI: Manage Droplets
Create, list, and delete Droplets from the command line.
doctl auth init # authenticate the CLIdoctl compute droplet create my-droplet \ --region nyc1 \ --image ubuntu-22-04-x64 \ --size s-1vcpu-1gb \ --ssh-keys <fingerprint>doctl compute droplet list # list all dropletsdoctl compute droplet delete my-droplet # delete a droplet
App Platform Spec (app.yaml)
Declarative config for deploying a service on App Platform.
name: my-appservices: - name: web github: repo: my-org/my-repo branch: main build_command: npm run build run_command: npm start http_port: 8080 instance_size_slug: basic-xxs instance_count: 1
doctl: Manage DOKS Clusters
Provision and connect to a DigitalOcean Kubernetes cluster from the CLI.
doctl kubernetes cluster create my-cluster \ --region nyc1 \ --version latest \ --node-pool "name=default;size=s-2vcpu-4gb;count=3;auto-scale=true;min-nodes=2;max-nodes=5"doctl kubernetes cluster kubeconfig save my-cluster # merge creds into ~/.kube/configkubectl get nodesdoctl kubernetes cluster node-pool update my-cluster default --count 5doctl kubernetes cluster upgrade my-cluster --version latest
Spaces: S3-Compatible Sync & Access Keys
Use the AWS CLI against Spaces by pointing it at the DO endpoint, and scope access keys per project.
# Configure a named profile for Spacesaws configure --profile do-spaces# AWS Access Key ID: <spaces-key># AWS Secret Access Key: <spaces-secret>aws s3 sync ./dist s3://my-space --endpoint=https://nyc3.digitaloceanspaces.com --profile do-spaces --acl public-read# Generate a project-scoped Spaces access key (least privilege)doctl projects create my-project --purpose "Web App"doctl spaces list --region nyc3
App Platform: Encrypted Env Vars & Autoscaling
Mark secrets as SECRET-type and configure component-level autoscaling in app.yaml.
services: - name: web envs: - key: DATABASE_URL value: ${db.DATABASE_URL} type: SECRET - key: NODE_ENV value: production scope: RUN_TIME autoscaling: min_instance_count: 1 max_instance_count: 4 metrics: cpu: percent: 70 health_check: http_path: /healthz initial_delay_seconds: 10databases: - name: db engine: PG production: true
Cloud Firewalls & VPC Isolation
Lock down Droplet ingress with doctl and place resources in a private VPC network.
doctl vpcs create --name prod-vpc --region nyc1 --ip-range 10.10.0.0/24doctl compute firewall create \ --name web-fw \ --inbound-rules "protocol:tcp,ports:22,address:0.0.0.0/0 protocol:tcp,ports:443,address:0.0.0.0/0" \ --outbound-rules "protocol:tcp,ports:all,address:0.0.0.0/0" \ --droplet-ids <droplet-id># Attach an existing droplet to a private VPC at creation only;# moving an existing droplet requires a power-off migrationdoctl compute droplet-action reboot <droplet-id>
Advanced Operational Concepts
Terms that matter once you're running production workloads, not just a single Droplet.
- Floating/Reserved IP- a static IP you can re-assign between Droplets for zero-downtime failover
- Load Balancer health checks- configurable interval/timeout/unhealthy-threshold that removes a backend Droplet from rotation automatically
- doctl monitoring alert- creates CPU/memory/disk/bandwidth alert policies that page via email or Slack webhook
- Snapshot vs Backup- snapshots are manual and billed per GB-month; backups are automatic weekly images billed as % of Droplet cost
- 1-click Marketplace apps- pre-configured Droplet images (e.g. Docker, WordPress) that skip manual provisioning scripts
- doctl compute droplet-action resize- vertically resizes a Droplet; disk-only resizes are irreversible
- DOKS node pool taints- set via `--node-pool "...;taint=key=value:NoSchedule"` to dedicate pools to specific workloads
Use DigitalOcean's snapshot feature before major Droplet changes — snapshots are billed per GB and far cheaper than losing hours to a botched in-place upgrade with no rollback path.