-
Notifications
You must be signed in to change notification settings - Fork 0
DigitalOcean Setup
This step-by-step guide walks you through setting up DigitalOcean to work with Displace. No prior cloud experience required.
Subscription Required: DigitalOcean provider access requires a paid Displace subscription. Local development is always free.
DigitalOcean is the simplest cloud provider to set up. Here's how it compares:
| Setup Task | DigitalOcean | AWS | GCP |
|---|---|---|---|
| Authentication | 1 API token | IAM user + policy + access keys | Service account + JSON key + IAM roles |
| APIs to enable | None | None | 3 APIs |
| Permissions | Full Access scope | 50+ IAM permissions | 4 IAM roles |
| Setup time | ~5 minutes | ~20 minutes | ~15 minutes |
| Control plane | Free | $0.10/hour (~$72/mo) | Free (1 zonal) |
If you're new to cloud infrastructure, start here.
Before starting, you'll need:
- An email address for your DigitalOcean account
- A credit card or PayPal for account verification
- About 5-10 minutes to complete setup
To use Displace with DigitalOcean, you only need:
- DigitalOcean Account - Your cloud account
- API Token - A single token that authorizes Displace to manage your resources
That's it! No complex IAM policies, no service accounts, no APIs to enable.
If you already have a DigitalOcean account, skip to Step 2.
-
Go to digitalocean.com
-
Click Sign Up (top right)
-
Sign up using:
- Email and password, or
- Google account, or
- GitHub account
-
Verify your email address
-
Add a payment method:
- Credit card, or
- PayPal
-
(Optional) Enter a promo code if you have one
What you should see: The DigitalOcean dashboard/control panel
Free Credits: DigitalOcean often provides $200 in free credits for new accounts (valid for 60 days). Check their website for current offers.
This is the only credential you need. One token does everything.
-
Log into the DigitalOcean Control Panel
-
Click API in the left sidebar
- Or go directly to: cloud.digitalocean.com/account/api/tokens
-
In the "Personal access tokens" section, click Generate New Token
-
Configure your token:
-
Token name:
displace-cli(or any descriptive name) -
Expiration: Choose based on your needs:
-
No expiry- Convenient for personal projects -
90 daysor1 year- More secure, requires renewal
-
- Scopes: Select Full Access (both Read and Write)
-
Token name:
-
Click Generate Token
-
IMPORTANT: Copy the token immediately!
- The token is only shown once
- It looks like:
dop_v1_abc123def456...(64 characters) - Store it somewhere secure
What you should see: Your new token listed under "Personal access tokens"
Security Warning: This token can manage all your DigitalOcean resources.
- Never share it publicly
- Never commit it to git
- Store it securely (password manager recommended)
- You can revoke it anytime if compromised
Now connect Displace to your DigitalOcean account.
-
Open your terminal
-
Run the configuration command:
displace provider digitalocean configure
Or use the shorter alias:
displace provider do configure -
When prompted:
- API Token: Paste your token from Step 2
- Default Region: Enter a region code (see region table below)
What you should see:
✅ DigitalOcean provider configured successfully
Region: nyc3
Choose a region close to your users:
| Region Code | Location | Recommended For |
|---|---|---|
nyc3 |
New York | US East Coast |
sfo3 |
San Francisco | US West Coast |
tor1 |
Toronto | Canada |
lon1 |
London | UK/Western Europe |
ams3 |
Amsterdam | Europe |
fra1 |
Frankfurt | Central Europe |
sgp1 |
Singapore | Southeast Asia |
blr1 |
Bangalore | India |
syd1 |
Sydney | Australia/Oceania |
Tip:
nyc3andsfo3are the most reliable regions with full Kubernetes support.
Verify everything is working:
# Test the provider connection
displace provider test digitaloceanWhat you should see:
✅ DigitalOcean provider test successful
- Token valid
- API accessible
- Region available
You're ready to create a Kubernetes cluster!
# Create a cluster named "my-cluster"
displace cluster create my-cluster --provider digitaloceanOr using the short alias:
displace cluster create my-cluster --provider doThis will:
- Create a DOKS (DigitalOcean Kubernetes) cluster
- Provision worker nodes
- Configure kubectl to connect
- Install monitoring and ingress components
Wait time: DOKS cluster creation takes 4-8 minutes.
What you should see:
Creating cluster 'my-cluster' on DigitalOcean...
✅ DOKS cluster created
✅ Node pool ready (1 node)
✅ Kubectl configured
✅ Monitoring installed
✅ Ingress controller installed
Cluster 'my-cluster' is ready!
DigitalOcean has simple, predictable pricing.
DOKS control plane is FREE! You only pay for worker nodes.
Compare to other providers:
| Provider | Control Plane Cost |
|---|---|
| DigitalOcean | Free |
| AWS EKS | $0.10/hour (~$72/month) |
| GCP GKE | Free (1 zonal cluster) |
| Node Size | vCPUs | RAM | Monthly Cost |
|---|---|---|---|
s-1vcpu-2gb |
1 | 2GB | $12 |
s-2vcpu-4gb |
2 | 4GB | $24 |
s-4vcpu-8gb |
4 | 8GB | $48 |
s-8vcpu-16gb |
8 | 16GB | $96 |
For development and testing:
- 1 node (
s-2vcpu-4gb): $24/month - Add load balancer if needed: +$12/month
| Resource | Cost |
|---|---|
| Load Balancer | $12/month |
| Block Storage | $0.10/GB/month |
| Snapshots | $0.06/GB/month |
| Bandwidth | 1TB free, then $0.01/GB |
-
Destroy clusters when not in use:
displace cluster destroy my-cluster
-
Use smaller nodes for development:
displace cluster create dev --provider do --node-type s-1vcpu-2gb -
Start with one node:
displace cluster create dev --provider do --node-count 1 -
Monitor your spending: DigitalOcean dashboard shows real-time billing
# Create cluster
displace cluster create blog-cluster --provider do
# Initialize WordPress project
mkdir my-blog && cd my-blog
displace project init wordpress
# Deploy
displace project deploy --cluster blog-cluster
# Get site URL
displace project info# Create cluster
displace cluster create web-cluster --provider do
# Initialize static site project
mkdir my-site && cd my-site
displace project init static
# Deploy
displace project deploy --cluster web-cluster# Check current status
displace cluster status my-cluster --provider do
# Autoscaling is enabled by default (1-3 nodes)
# Kubernetes will automatically scale based on demandCause: Invalid or expired API token.
Solution:
- Verify you copied the full token (no spaces)
- Check the token hasn't expired in DO console
- Generate a new token if needed:
displace provider do configure # Enter new token
Cause: Some older regions don't support DOKS.
Solution: Use one of these confirmed DOKS regions:
-
nyc3,sfo3,ams3,sgp1,lon1,fra1,tor1,blr1,syd1
Cause: New accounts have resource limits.
Solution:
- Go to DigitalOcean Console > Settings > Team
- Click "Request Limit Increase"
- Or add a valid payment method to increase limits
Cause: Account needs payment method or has exhausted credits.
Solution:
- Add a credit card or PayPal to your account
- Check if free trial credits have expired
Cause: DOKS provisioning can take 4-8 minutes (this is normal).
Solution:
- Wait up to 10 minutes
- Check status in DigitalOcean Console > Kubernetes
- Check for any error notifications
Cause: Token created with Read-only access.
Solution:
- Go to API > Tokens in DO Console
- Generate a new token with Full Access
- Reconfigure:
displace provider do configure
-
Use descriptive token names
- Name tokens by purpose:
displace-production,displace-testing - Makes it easy to identify and revoke if needed
- Name tokens by purpose:
-
Set token expiration for production
- Use 90-day or 1-year expiration
- Set calendar reminders to rotate tokens
-
One token per environment
- Different tokens for dev, staging, production
- Limits blast radius if compromised
-
Revoke unused tokens
- Regularly audit tokens in DO Console
- Delete any you're not using
-
Never commit tokens
- Add
.credentialsto.gitignore - Use environment variables in CI/CD
- Add
- Go to DigitalOcean API Tokens
- See all your active tokens
- Go to API > Tokens
- Click the ... menu next to the token
- Click Revoke
- Confirm revocation
Note: Revoking a token immediately invalidates it. Displace will stop working until you configure a new token.
- Generate a new token (Step 2 above)
- Configure Displace with the new token:
displace provider do configure - Revoke the old token
When you're done testing or want to remove resources:
displace cluster destroy my-cluster --provider doThis removes:
- The DOKS cluster
- All worker nodes
- Associated load balancers
- Network resources
Check what's running:
- Go to DigitalOcean Kubernetes
- See all clusters and their status
- View nodes, workloads, and costs
To remove all Displace-managed resources:
# List all clusters
displace cluster list
# Destroy each cluster
displace cluster destroy cluster-name --provider do# Configure DigitalOcean provider
displace provider digitalocean configure
displace provider do configure # Short alias
# Test configuration
displace provider test digitalocean
displace provider test do
# Create cluster
displace cluster create my-cluster --provider digitalocean
displace cluster create my-cluster --provider do
# Check cluster status
displace cluster status my-cluster --provider do
# List all clusters
displace cluster list
# Destroy cluster
displace cluster destroy my-cluster --provider do| Size Slug | Specs | Best For |
|---|---|---|
s-1vcpu-2gb |
1 vCPU, 2GB | Testing, small apps |
s-2vcpu-4gb |
2 vCPU, 4GB | Development, WordPress |
s-4vcpu-8gb |
4 vCPU, 8GB | Production workloads |
-
Americas:
nyc3,sfo3,tor1 -
Europe:
lon1,ams3,fra1 -
Asia-Pacific:
sgp1,blr1,syd1
| Feature | DigitalOcean | AWS | GCP |
|---|---|---|---|
| Setup complexity | Very Easy | Complex | Medium |
| Control plane cost | Free | $72/month | Free |
| Min. node cost | $12/month | ~$50/month | ~$25/month |
| Best for | Beginners, small teams | Enterprise, complex needs | Data/ML workloads |
| Learning curve | Low | High | Medium |
Recommendation: Start with DigitalOcean to learn, then consider AWS/GCP for specific enterprise needs.
Related Documentation: