Skip to main contentSkip to navigation
[email protected]
Client AreaSupport
Hosting Mammoth
HostingMammothYour Data, Our Responsibility
Home
Solutions
Hosting Services
Store
Pricing
About
Blog
API
Contact

Stay Ahead of the Curve

Get the latest insights on cybersecurity, AI innovations, and enterprise data solutions delivered to your inbox.

Hosting Mammoth
HostingMammothEnterprise Solutions

Enterprise-grade data solutions. Hosting, recovery, cybersecurity, and AI-powered services for businesses worldwide.

[email protected]
Sun - Fri, 9:00am - 5:00pm

Services

  • Cloud Hosting
  • Data Recovery
  • Cybersecurity
  • Legal Support
  • MSP Services
  • Web Development
  • AI Services
  • Free Server Migration

Hosting

  • VPS Hosting (NVMe SSD)
  • VDS Hosting (NVMe)
  • Storage VPS (High SSD)
  • GPU Servers
  • Managed Services
  • Cloud Firewall
  • Load Balancer
  • One-Click Apps
  • n8n Hosting
  • Object Storage
  • FAQ

Company

  • Store
  • Pricing
  • About Us
  • Locations
  • Blog
  • Testimonials
  • Contact
  • Affiliate Program
  • White-Label
  • Terms of Service
  • Privacy Policy
  • Browser Cookies
  • SLA

Support

  • Client Area
  • Submit Ticket
  • Knowledge Base
  • Server Status
  • API Documentation

© 2026 Hosting Mammoth. All rights reserved.

Knowledge Base
Getting StartedAccount ManagementVPS HostingGPU ServersStorage VPSCloud FirewallLoad BalancerServer ManagementBilling & PaymentsSupport & TicketsAffiliate ProgramReseller ProgramMarketplace & Appsn8n HostingManaged ServicesServer MigrationAPI & DevelopersSecurityTroubleshootingGlossaryInstall Guides
  1. Home
  2. /
  3. Support
  4. /
  5. Install Guides
  6. /
  7. How To Install Caprover Ubuntu
GUIDEInstall Guides

How to Install CapRover on Ubuntu 24.04 — Self-Hosted Heroku Alternative

16 min read

How to Install CapRover on Ubuntu 24.04 — Self-Hosted Heroku Alternative

Quick Summary

CapRover is an open-source Platform-as-a-Service (PaaS) built on Docker Swarm that lets you deploy apps, databases, and services with a single command or a git push. This guide walks you through installing CapRover on Ubuntu 24.04, pointing a wildcard domain at it, deploying your first app, and enabling automatic HTTPS via Let's Encrypt. Estimated time: 15 minutes.
>
Skip the setup? Use our 1-click CapRover installer — we provision a fully configured CapRover node with wildcard DNS preset in under 2 minutes.

Table of Contents

  • What is CapRover?
  • CapRover vs Coolify vs Dokploy
  • Why Self-Host CapRover?
  • Prerequisites
  • Step 1: Update System and Open Firewall Ports
  • Step 2: Install Docker
  • Step 3: Run the CapRover One-Liner
  • Step 4: Verify captain-01 Is Running
  • Step 5: Install the CapRover CLI
  • Step 6: Run the Captain Setup Wizard
  • Step 7: Enable HTTPS with Let's Encrypt
  • Deploy Your First App from a Docker Image
  • Deploy an App from Git
  • One-Click Apps: WordPress, Ghost, Redis, Postgres
  • Environment Variables and Persistent Volumes
  • Scaling Replicas and the Managed Nginx Layer
  • Backups and Updates
  • Troubleshooting
  • FAQ
  • Next Steps

What is CapRover?

CapRover is a free, open-source Platform-as-a-Service that sits on top of Docker Swarm and Nginx to give you a Heroku-like developer experience on your own hardware. You push code from Git or upload a tarball, CapRover builds a Docker image using your Dockerfile (or a language-specific Captain Definition), rolls the new image out across the swarm, and Nginx reverse-proxies traffic to healthy containers. The whole thing is controlled from a web dashboard at captain.yourdomain.com or from a cross-platform CLI written in Node.js.

What makes CapRover different from a bare Docker host is the opinionated glue around it: automatic Let's Encrypt certificates for every app, a one-click app marketplace with over 100 curated images (WordPress, Ghost, MongoDB, Postgres, Redis, MinIO, Gitea, n8n, Metabase, and more), a managed Nginx template you can override per-app, and built-in webhooks that trigger a rebuild whenever you push to a branch. You can scale any app to multiple replicas, mount persistent volumes for stateful workloads, and inject environment variables without rebuilding the image.

CapRover has been around since 2017 and is one of the most battle-tested self-hosted PaaS projects. It powers thousands of small businesses, indie hackers, and internal platforms because it is simple enough to run on a 1 GB VPS yet capable enough to manage a 10-node production cluster.

CapRover vs Coolify vs Dokploy

All three projects aim to be the "self-hosted Heroku," but they make different trade-offs:

FeatureCapRoverCoolifyDokploy
BackendDocker SwarmDocker + ComposeDocker Swarm + Compose
Minimum RAM1 GB2 GB recommended2 GB recommended
Wildcard DNS requiredYesNo (per-app subdomain OK)No
One-click apps100+ curated100+ via Docker Compose templatesGrowing catalog
Git-push deployYes, via webhookYes, native GitHub/GitLab/Gitea appYes, native
UI maturityFunctional, utilitarianModern, polishedModern, polished
Multi-serverYes (Swarm join)Yes (remote Docker hosts)Yes (remote Docker hosts)
LicenseApache 2.0Apache 2.0Apache 2.0
Best forRock-solid simplicity, Swarm scalingPolished UX, lots of integrationsModern alternative, Compose-first workflow
Pick CapRover if you want the most mature, most predictable option with the widest community of production users. Pick Coolify if UX polish and native Git integration matter more than Swarm scaling. Pick Dokploy if you want a fresh take with Docker Compose as a first-class deploy unit.

Why Self-Host CapRover?

  • Full data ownership — your code, databases, and secrets stay on your server
  • No vendor lock-in — CapRover deploys standard Docker images; you can walk away any time
  • Cost savings — runs comfortably on an EUR 7.99/mo VPS vs USD 25+/mo per Heroku dyno, or USD 20+/mo for a comparable Render team
  • Unlimited apps — deploy as many apps as your RAM can hold, no per-app pricing
  • Automatic HTTPS — every app gets a free Let's Encrypt certificate without touching certbot
  • Git-push deploys — mimic the Heroku workflow with a simple webhook per app

Prerequisites

Before you begin, you need:

  • A VPS with at least 1 vCPU, 1 GB RAM, 20 GB storage
> Recommended: Our CloudCore Professional plan gives you 4 vCPU, 8 GB RAM, and 100 GB NVMe storage starting at EUR 7.99/mo — enough to run CapRover and a dozen apps comfortably.

  • Ubuntu 24.04 LTS (fresh install recommended)
  • SSH access with a non-root sudo user (How to connect via SSH)
  • A domain name with wildcard DNS — you must create an A record for *.caprover.yourdomain.com pointing to your server's public IP. CapRover gives every app a subdomain, so wildcard DNS is not optional.
  • Ports 80, 443, 3000, 996, 7946, 4789, and 2377 open on the firewall (more on this below)

Step 1: Update System and Open Firewall Ports

bash
sudo apt update && sudo apt upgrade -y
sudo apt install -y ufw curl

CapRover needs several ports: 80 and 443 for HTTP/HTTPS traffic, 3000 for the initial captain-01 verification, 996 for CapRover's WebSocket API, and 7946/4789/2377 for Docker Swarm overlay networking.

bash
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 3000/tcp
sudo ufw allow 996/tcp
sudo ufw allow 7946/tcp
sudo ufw allow 7946/udp
sudo ufw allow 4789/udp
sudo ufw allow 2377/tcp
sudo ufw --force enable

Step 2: Install Docker

CapRover requires Docker 24.x or newer. Install it from the official Docker repo so you get the latest stable release:

bash
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER
newgrp docker
docker --version

Expected output:

text
Docker version 27.3.1, build ce12230

If you plan to run CapRover on a single node, Docker is enough. If you want a multi-node cluster later, you can run docker swarm init now — CapRover will detect and reuse the existing swarm.

Step 3: Run the CapRover One-Liner

The official installer pulls the caprover/caprover image and wires it to the host's Docker socket so it can orchestrate containers:

bash
docker run -p 80:80 -p 443:443 -p 3000:3000 \
  -e ACCEPTED_TERMS=true \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /captain:/captain \
  caprover/caprover

The command publishes three ports, mounts the Docker socket so CapRover can create swarm services, and mounts /captain on the host for persistent configuration. The first run takes 60-90 seconds while the swarm initialises and the dashboard image is pulled.

You will see log lines ending with:

text
CapRover is ready on port 3000!!

Press Ctrl+C to detach — CapRover keeps running because the installer launches detached background services. If you prefer an explicit detached container, add -d to the docker run command.

Step 4: Verify captain-01 Is Running

Open a browser and go to http://YOUR_SERVER_IP:3000. You should see the CapRover login screen asking for the default password captain42. If the page loads, the captain-01 service is healthy. Close the browser tab — you will do the real configuration from the CLI in the next step, not this temporary port-3000 UI.

From the terminal you can also confirm the swarm service:

bash
docker service ls

Expected output:

text
ID             NAME       MODE         REPLICAS   IMAGE                      PORTS
abc123def      captain-captain  replicated   1/1        caprover/caprover:latest

Step 5: Install the CapRover CLI

The CLI is the recommended way to run the setup wizard, deploy apps, and manage secrets. Install Node.js 20 and the CLI globally:

bash
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
sudo npm install -g caprover
caprover --version

Expected output:

text
2.4.0

You can run the CLI from your laptop too — it talks to the server over HTTPS on port 443 (or HTTP on 3000 during initial setup).

Step 6: Run the Captain Setup Wizard

Point your wildcard DNS at the server before running the wizard. With the A record for *.caprover.yourdomain.com propagated, run:

bash
caprover serversetup

The wizard asks a series of questions:

  • IP address of your captain server — enter your VPS public IP
  • CapRover root domain — enter caprover.yourdomain.com (no wildcard, no http://)
  • New CapRover password — pick a strong password, this replaces captain42
  • Your email address for HTTPS certs — Let's Encrypt will send expiry notifications here
  • CapRover machine name (for CLI) — a friendly label like prod-caprover
  • Behind the scenes the wizard does four things:

    • Changes the admin password
    • Sets the root domain, which tells CapRover that every app should be served under *.caprover.yourdomain.com
    • Requests a wildcard Let's Encrypt certificate
    • Force-enables HTTPS, so port 3000 is no longer needed
    Once it finishes, close port 3000 on the firewall:

    bash
    sudo ufw delete allow 3000/tcp

    From now on you access the dashboard at https://captain.caprover.yourdomain.com with your new password.

    Step 7: Enable HTTPS with Let's Encrypt

    If the wizard did not enable HTTPS (for example, you chose to skip it), you can enable it manually from the dashboard:

  • Log in at https://captain.caprover.yourdomain.com
  • Go to Settings → Root Domain
  • Click Enable HTTPS — CapRover requests the wildcard cert in about 30 seconds
  • Click Force HTTPS by redirecting all HTTP traffic to HTTPS
  • Every app you create from now on automatically inherits HTTPS. If an app uses a custom domain, CapRover requests a dedicated cert for that domain too, again with zero configuration.

    Deploy Your First App from a Docker Image

    The fastest way to test CapRover is to deploy a pre-built image. From the dashboard:

  • Go to Apps
  • Enter an app name like hello-world and click Create New App
  • Open the app, go to the Deployment tab
  • Under Method 6: Deploy plain Dockerfile, paste a public image reference: caprover/docker-getting-started
  • Click Deploy
  • Within 10 seconds the container is running and reachable at https://hello-world.caprover.yourdomain.com.

    Or do the same from the CLI:

    bash
    caprover deploy --appName hello-world --imageName caprover/docker-getting-started

    Deploy an App from Git

    CapRover supports two Git workflows: push-based (you push to a repo and a webhook triggers the build) and pull-based (CapRover clones the repo on demand).

    Push-based with a webhook:

  • Create the app in the dashboard
  • Go to Deployment → Method 3: Deploy from Github/Bitbucket/Gitlab
  • Enter the repository URL, branch, username, and a personal access token
  • CapRover displays a webhook URL — paste this into the repo's webhook settings
  • Every git push to the selected branch triggers a rebuild
  • CLI-based from a local checkout:

    bash
    cd my-node-app
    caprover deploy

    The CLI tars the working directory, uploads it to CapRover, and triggers a build. Your repo needs either a Dockerfile at the root or a captain-definition JSON file that points to a template (/dockerfile-nodejs-12, /dockerfile-python-3.8, etc.).

    Example captain-definition for a Node.js app:

    json
    {
      "schemaVersion": 2,
      "templateId": "node/20"
    }

    One-Click Apps: WordPress, Ghost, Redis, Postgres

    CapRover's one-click marketplace is the fastest way to spin up production-ready services. From the dashboard:

  • Go to Apps → One-Click Apps/Databases
  • Browse or search the catalog (WordPress, Ghost, MariaDB, MongoDB, Postgres, Redis, MinIO, Gitea, n8n, Metabase, Uptime Kuma, Plausible, and 100+ more)
  • Fill in the required fields (version, admin password, database name)
  • Click Deploy
  • CapRover chains the required services together — a WordPress install, for example, creates a MariaDB container, a WordPress container, links them over an internal overlay network, and exposes only the WordPress container to the outside world.

    To deploy Redis from the CLI:

    bash
    caprover api --path "/user/apps/appDefinitions/redis" \
      --method "POST" \
      --data '{"appName":"my-redis","hasPersistentData":true}'

    Environment Variables and Persistent Volumes

    Every app has an App Configs tab where you manage environment variables and persistent volumes.

    Environment variables are injected at container start. Add them as KEY=value pairs, then click Save & Update to roll the app with the new values. Use this for database URLs, API keys, and feature flags. Variables are stored encrypted in /captain/data/config-captain.json.

    Persistent volumes survive container restarts and rebuilds. For a stateful app like Postgres or Ghost, add a volume mapping such as:

    • Path in app: /var/lib/postgresql/data
    • Label (recommended): postgres-data
    CapRover creates a named Docker volume under /captain/data/ on the host. Back up this directory and you back up all app state.

    You can also mount specific host paths if you need to share files between the host and the container, but labels are preferred because they are portable across nodes in a swarm.

    Scaling Replicas and the Managed Nginx Layer

    To scale an app horizontally, open the app, go to App Configs, and change Instance Count from 1 to 3 (or whatever you need). CapRover rolls out the additional replicas across the swarm, and the managed Nginx layer round-robins traffic between them. Downtime is zero because Nginx waits for a new replica to be healthy before retiring the old one.

    The managed Nginx runs as a swarm service called captain-nginx and reloads automatically whenever you add, remove, or update an app. Its config is generated from a template you can override per-app in HTTP Settings → Edit Default Nginx Configurations. This is the escape hatch for WebSockets, large uploads, custom cache headers, or rate limits.

    If you need to force a reload manually:

    bash
    docker service update --force captain-captain

    Backups and Updates

    Backups — everything CapRover needs to restore a node lives in /captain on the host. A nightly tarball is enough:

    bash
    sudo tar czf /backup/caprover-$(date +%F).tar.gz /captain

    Ship the tarball to S3, Backblaze B2, or a second VPS with rclone or restic on a cron. To restore on a new server, install Docker, stop the default CapRover container, replace /captain with your backup, and run the installer again — CapRover picks up where you left off.

    Updates — from the dashboard go to Settings → Update CapRover. CapRover pulls the latest image and restarts the captain service with no downtime for your apps. Major-version updates occasionally require manual steps documented in the release notes, so always read them first.

    From the CLI:

    bash
    caprover api --path "/user/system/versionInfo" --method "GET"
    caprover api --path "/user/system/versionInfo" --method "POST" \
      --data '{"latestVersion":"1.12.0"}'

    Troubleshooting

    ProblemCauseSolution
    caprover serversetup times outWildcard DNS not propagatedWait 5-10 minutes and re-run, or test with dig *.caprover.yourdomain.com
    App deploys but returns 502Container not listening on the expected portSet Container HTTP Port in HTTP Settings to the port your app binds (e.g., 3000, 8080)
    Let's Encrypt fails with rate-limit errorToo many cert requests for this domainWait 1 hour, then retry — Let's Encrypt allows 5 duplicate certs per week
    Dashboard unreachable after updateCaptain container crashed during upgradeSSH in, run docker service ls, then docker service logs captain-captain
    Builds fail with no space left on deviceOld build layers filling /var/lib/dockerRun docker system prune -af --volumes (careful — removes unused volumes)
    App keeps restartingOut-of-memory killsCheck docker stats, scale down replicas or upgrade the VPS RAM
    Webhook from GitHub does nothingToken expired or branch mismatchRegenerate the token in the app's Deployment tab and re-paste the webhook URL

    FAQ

    Q: What are the minimum server requirements for CapRover?

    A: CapRover itself runs on 1 vCPU and 1 GB RAM, but that leaves almost nothing for your apps. For a real workload with two or three apps plus a database, go with at least 2 vCPU and 4 GB RAM. Our CloudCore Professional plan at EUR 7.99/mo (4 vCPU / 8 GB / 100 GB NVMe) is the sweet spot.

    Q: Can I run CapRover alongside other services on the same VPS?

    A: Technically yes, but CapRover wants exclusive use of ports 80 and 443 for its managed Nginx. If you have other services that need those ports, proxy them through a CapRover app instead of running them directly on the host.

    Q: How do I update CapRover to the latest version?

    A: Go to Settings → Update CapRover in the dashboard and click Update. Or from the CLI, use the /user/system/versionInfo API endpoint shown in the Backups and Updates section.

    Q: Is there a Docker Compose installation option?

    A: The official installer is the recommended path because it configures Docker Swarm, the captain service, and the persistent volume in one step. You can inspect the underlying Compose-equivalent by reading the caprover/caprover image Dockerfile, but there is no officially supported Compose install.

    Q: Can CapRover manage multiple servers?

    A: Yes. Run docker swarm join on additional nodes, then add them from Cluster → Add a New Node in the dashboard. CapRover schedules app replicas across the cluster automatically. Database containers should stay on a single node unless you pick a replication-aware image.

    Q: How do I back up my CapRover data?

    A: Tar the /captain directory nightly and ship it off-box with rclone or restic. That directory contains app configs, persistent volumes, and Let's Encrypt certificates — everything needed for a full restore.

    Q: Does CapRover support custom domains per app?

    A: Yes. In the app's HTTP Settings tab, click Connect New Domain, enter the domain (e.g., blog.example.com), and point a CNAME record at captain.caprover.yourdomain.com. CapRover issues a dedicated Let's Encrypt cert for the custom domain.

    Next Steps

    • How to Secure Your VPS with Fail2Ban — protect SSH and the CapRover dashboard from brute-force attacks
    • How to Monitor with Uptime Kuma — deploy Uptime Kuma as a CapRover one-click app and monitor all your services
    • How to Set Up Automated Backups — never lose a /captain directory
    • How to Install Docker on Ubuntu 24.04 — deeper Docker reference if you want to understand what CapRover is managing under the hood

    ### Skip the Manual Install
    >
    We offer CapRover as a 1-click app on all VPS plans.
    Your server comes pre-configured with wildcard DNS, HTTPS enabled, and the CLI ready to deploy — production-ready in under 2 minutes.
    >
    Deploy CapRover Now | Starting from EUR 7.99/mo | 172+ 1-click apps | 9 global locations

    Was this article helpful?

    ← Back to Install GuidesBrowse all categories →

    Still have questions?

    Contact Support →Submit a Ticket