Why install CapRover on your VPS
Deploying an application on a bare VPS means manually managing Nginx, certificates, Docker containers and restarts. CapRover wraps all of this behind a web interface and a CLI: it relies on Docker Swarm to orchestrate your containers, automatically generates Let's Encrypt certificates and offers a deployment system via git push or Docker image. Its “One-Click Apps” catalog lets you install WordPress, PostgreSQL, Redis, MongoDB or Ghost in a few clicks, each deployed in its own container. It's the ideal option for developers and agencies who want the Heroku experience without the bill, while keeping full control of their server.
The concrete benefits of CapRover
- Deployment via
git pushor thecaprover deployCLI, with no server configuration on each release. - Automatic, renewed Let's Encrypt SSL for every domain and subdomain.
- One-Click catalog to install databases and common services in seconds.
- Native horizontal scaling thanks to Docker Swarm: add worker nodes on the fly.
- Clear web interface with live logs, environment variables and data persistence.
- Deployment webhooks that integrate with GitHub, GitLab or Bitbucket for lightweight CI/CD.
Prerequisites for CapRover
CapRover is reasonable on resources but reserves memory for Docker Swarm and the builder. A VPS with 2 GB of RAM and 1 vCPU is enough for personal projects and a few small applications; move up to 4 GB of RAM and 2 vCPU as soon as you host several applications with their databases. Plan for 30 GB of SSD disk, since each Docker build consumes temporary space. On the network side: a wildcard domain name is strongly recommended (*.apps.mydomain.com) so that CapRover generates subdomains on the fly for each application. Ports 80, 443 and 3000 (admin panel) must be open. Docker is installed automatically by the CapRover script, so all you need to provide is a clean Ubuntu VPS.
Install CapRover and deploy an application
Launch the installation in a single command
On a clean Ubuntu, run docker run -p 80:80 -p 443:443 -p 3000:3000 -v /var/run/docker.sock:/var/run/docker.sock -v /captain:/captain caprover/caprover. CapRover initializes Docker Swarm and starts its admin panel on port 3000.
Configure the root domain
Point a wildcard DNS record *.apps.mydomain.com to the VPS IP. In the panel, enter this root domain: CapRover will use it as the suffix for all your applications and enable HTTPS via Let's Encrypt in one click.
Install the CLI and log in
On your machine: npm install -g caprover then caprover login. Provide the URL https://captain.apps.mydomain.com and the password set in the previous step. The CLI remembers the connection for subsequent deployments.
Create and deploy an application
In the panel, create an app mon-api. Add a captain-definition file at the root of your project pointing to your Dockerfile, then run caprover deploy. CapRover builds the image and brings the application online at https://mon-api.apps.mydomain.com.
Add a database and persist data
From the One-Click Apps tab, install PostgreSQL. Link your application via the generated environment variables, then enable a persistent volume in the “Persistent Directories” tab to keep data across redeployments.
Enable two-factor authentication on the panel and restrict access to port 3000 with a firewall (ufw allow from VOTRE_IP to any port 3000). For CI/CD, use CapRover's build webhooks: every push to your main branch automatically triggers a new deployment with no manual intervention. Consider increasing swap memory if your Docker builds are heavy, since the builder can saturate a small VPS during compilation.