- Published on
CapRover: Painless Self-Hosted Deployments for Any Stack (2025 Guide)
- Authors
- Name
- Ahmed Farid
- @
TIP
If you’re tired of YAML rabbit holes and vendor lock-in invoices, CapRover might be your new favourite DevOps sidekick.
CapRover is an open-source PaaS that converts any Docker-enabled server (AWS, Hetzner, DigitalOcean, even Raspberry Pi) into a Platform-as-a-Service with a slick web dashboard, CLI and one-command app deployments. In this article you’ll:
- Install CapRover on a fresh Ubuntu VPS.
- Deploy a sample Node.js app with zero downtime.
- Set up free HTTPS via Let’s Encrypt.
- Add a Postgres database in one click.
- Automate deployments using caprover deploy + GitHub Actions.
- Scale horizontally & roll back with a single button.
Table of Contents
- Table of Contents
- 1. Prerequisites & Terminology
- 2. Install CapRover in 60 Seconds
- 3. Deploy Your First App (Node.js Example)
- 4. Attach a Custom Domain & Free SSL
- 5. One-Click Databases & Add-ons
- 6. Zero-Downtime Rolling Updates & Rollbacks
- 7. Horizontal Scaling & Auto-Scaling
- 8. GitHub Actions CI/CD
- 9. Backups & Disaster Recovery
- 10. Monitoring & Alerts
- 11. CapRover vs Alternatives
- 12. Production Checklist
- 13. Further Reading & Resources
- 14. Conclusion
1. Prerequisites & Terminology
- Ubuntu 22.04 server (1 vCPU / 1 GB RAM works).
- DNS A-record pointing
captain.example.com
to the server IP. - Docker 25+ installed (CapRover installs if missing).
Term | Meaning |
---|---|
Captain Root | Main domain (e.g. captain.example.com ) hosting CapRover dashboard |
App | A containerised service managed by CapRover |
One-Click App | Pre-configured template (e.g. Postgres, Ghost) |
2. Install CapRover in 60 Seconds
SSH into your server:
curl -fsSL https://get.caprover.com | bash
The script:
- Installs Docker & Docker Compose.
- Pulls
caprover/caprover
image. - Creates a Docker swarm (single-node).
- Exposes ports 80 & 443.
Once complete, run:
caprover serversetup
Answer prompts for root domain (captain.example.com
) and email for SSL.
Browse to https://captain.example.com
→ create admin password.
3. Deploy Your First App (Node.js Example)
In project root, add captain-definition
:
{
"schemaVersion": 2,
"dockerfilePath": "Dockerfile",
}
Install CLI locally:
npm i -g caprover
caprover login
# URL: https://captain.example.com Token: found in dashboard Settings → API Tokens
caprover deploy
CapRover builds the image, pushes to its private registry, schedules container behind an Nginx proxy, and gives a default sub-domain like myapp.captain.example.com
.
4. Attach a Custom Domain & Free SSL
Dashboard → Apps / myapp / Networking:
- Add
api.example.com
. - Click Enable HTTPS → Let’s Encrypt certificate issued.
- Zero-downtime reload completes in ~10 s.
5. One-Click Databases & Add-ons
Dashboard → One-Click Apps / Databases → PostgreSQL 16.
Set root password, volume size, click Deploy. Connection string appears—use in your app via secrets.
Secrets: Apps / myapp / Env Vars → add DATABASE_URL
.
6. Zero-Downtime Rolling Updates & Rollbacks
Every caprover deploy
spins up a new container, waits for health check, then switches traffic. Previous version retained for instant rollback (Apps / Deploys tab).
7. Horizontal Scaling & Auto-Scaling
- Manual: Apps / myapp / Instance Count → 3.
- Autoscale: Enable
captain-autoscale
label with CPU/RAM thresholds (experimental in 2025 release).
8. GitHub Actions CI/CD
.github/workflows/deploy.yml
:
name: CapRover Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crazy-max/ghaction-docker-meta@v6
- uses: caprover/github-action@v2
with:
server: ${{ secrets.CAPROVER_SERVER }} # https://captain.example.com
app: myapp
token: ${{ secrets.CAPROVER_TOKEN }}
Push to main → workflow builds and triggers caprover deploy
API.
9. Backups & Disaster Recovery
- Use Volumes tab to mount
/var/lib/postgresql/data
. - Schedule
docker exec
based backups or integrate with Restic. - CapRover allows cluster mode (multiple manager nodes) if you join extra servers to the Docker swarm.
10. Monitoring & Alerts
- Built-in Netdata integration (enable in Settings) for system metrics.
- Configure Slack Webhook for failed deploys under Notifications.
11. CapRover vs Alternatives
Feature | CapRover | Dokku | Fly.io | Render |
---|---|---|---|---|
Self-host | ✅ | ✅ | ❌ | ❌ |
Web UI | ✅ | ❌ | N/A | ✅ |
Built-in registry | ✅ | ❌ | ✅ | ✅ |
One-click DB | ✅ | Community | ✅ | ✅ |
Auto SSL | ✅ | LetsEncrypt plugin | ✅ | ✅ |
Scaling | Manual + exp. autoscale | Manual | Global | Automatic |
12. Production Checklist
✅ Change default captain admin password.
✅ Enable geo-redundant backups for DB volumes.
✅ Use Cloudflare Proxy in front of CapRover for DDoS & caching.
✅ Keep VPS updated (unattended-upgrades
).
✅ Set up UFW: only ports 80/443 open.
13. Further Reading & Resources
- Official docs: caprover.com/docs
- Community one-click app repo.
- DigitalOcean marketplace image.
- YouTube: CapRover in 15 minutes by SwizzTech.
14. Conclusion
CapRover bridges the gap between DIY Docker and expensive PaaS bills. In under half an hour you get push-to-deploy workflows, managed SSL, horizontal scaling and a growing catalog of one-click services—all running on your affordable VPS. Give it a spin and reclaim control of your deployments! 🚀