Deploying to DO App Platform
DigitalOcean's managed PaaS with git-push deploys, autoscaling, and managed DBs.
PlatformsBeginner
Why
App Platform is DO's answer to Heroku/Render — git-push deploys, auto HTTPS, and managed Postgres/Redis. It's cheaper than Heroku for equivalent specs and integrates with DO ecosystem.
Platform-as-a-Service adoption grew 24% in 2024 as teams shift from VM management to git-push deploys. the cloud infrastructure market reached $330B in 2024, growing 22% year-over-year (Synergy Research), and PaaS layers capture the majority of new workloads.
When
Use App Platform for managed PaaS on DO, especially if already using DO for other resources. Avoid for full VM control — use Droplets.
How
1. Create — cloud.digitalocean.com → Apps → Create → connect repo
2. Build — auto-detects or specify build/run commands
3. Env — set environment variables in app spec
4. Database — Components → Database → PostgreSQL
5. Domains — Settings → Domains, auto TLS
6. Scale — Settings → Instance size and count
7. App spec — .do/app.yaml for IaC
Example
# .do/app.yaml
name: myapp
services:
- name: web
source_dir: /
github: { repo: user/repo, branch: main }
run_command: npm start
environment_slug: node-js
instance_count: 2
instance_size_slug: basic-xxs
routes: [{ path: / }]
databases:
- name: db
engine: pg
version: "15"
Common Problems
- ⚠Build command not detected — specify in app spec or dashboard
- ⚠Database not linked — add database component and reference in env vars
- ⚠Configuration drift between environments — use infrastructure-as-code (Terraform/Pulumi) to keep dev/staging/prod identical
Best Practices
- ✓Use .do/app.yaml for IaC — version controlled, reproducible deploys
- ✓Start with basic-xxs, scale up as needed — pay only for what you use
- ✓Set up health checks and graceful shutdown — handle SIGTERM to drain in-flight requests before exit