DockerSelf-Hosting

CapRover with Docker: Deploy Apps on Your Linux Server (Linux, Windows, Mac)

Before you start

  • 16 min read

Boxes marked Run in terminal are what you type; plain text explains why. Check what you need first

What you get in one minute#

CapRover turns a Linux server into an app platform: Docker Swarm runs your containers, nginx routes their domains, and a dashboard handles deployments, one-click apps and HTTPS.

CapRover official logo

Logo: CapRover project (https://raw.githubusercontent.com/caprover/caprover-website/a2cbf08a98acef930c8256b22ed55b19e918bec9/graphics/logo.svg), licence not expressly stated for this logo (project software: Apache-2.0 notice with a restrictive appendix).

We use one dedicated Linux machine or VM. You can deploy your projects from Linux, Windows or Mac without running Docker on that client. It suits small web apps, private tools and services you want to manage through one dashboard.

WhatValue (official sources, read 2 December 2026)
Current versionv1.16.1, released 18 November 2026
Image to pincaprover/caprover:1.16.1; Docker Hub confirms Linux amd64 and arm64
Client CLI[email protected]; requires Node.js 20 or newer
Time neededAbout 45–60 minutes, plus DNS propagation; our estimate
ResourcesOfficial minimum: 1 GiB RAM, 5 GiB free disk; no runtime measurement made
PortsTCP 80/443 for web traffic; TCP 3000 for initial administration
LicenceApache-2.0 text with an additional restrictive appendix in the tagged licence
Official docscaprover.com/docs

The v1.16.1 licence adds conditions about paid features, paid redistribution and distributing modified free features. Read the full appendix before you sell or redistribute anything built on CapRover.

At a glance:

  • Deploy committed Git content, an archive or an existing image.
  • Install one-click templates after reviewing their images, volumes and credentials.
  • Keep application data backups separately from CapRover's configuration backup.
  • Give CapRover its own ports and IP. Existing Traefik services belong on another machine or VM for this setup.

How it fits together#

Your CLI sends a deployment to CapRover, Swarm starts the app, and browsers reach it through wildcard DNS and CapRover's own nginx.

CapRover flow: Linux, Windows and Mac clients send deployments to the controller; wildcard DNS sends browsers to nginx on ports 80 and 443; Docker Swarm runs apps with separate persistent storage and configuration backups

Our diagram, based on the official installation, deployment and storage documentation.

A service describes what Swarm should run; each task schedules one container instance and can be pending, running, completed, failed or rejected. A root domain supplies the shared ending for app addresses. Neither extra tasks nor extra servers automatically copy your database files.

Before you start#

Note: every domain, password and key on this page is a dummy example (like change-me). Replace it with your own and keep real secrets out of Git.

SystemWhat to have
Linux serverFresh Ubuntu 24.04, amd64/arm64, sudo, Docker Engine supporting API 1.44, stable IP; no GPU required
Linux clientNode.js, Git, SSH and a terminal
Windows clientPowerShell, Node.js, Git and OpenSSH client; deploy to the Linux server
Mac clientTerminal, Node.js, Git and SSH; Intel or Apple Silicon client

Install Engine using the official Ubuntu instructions, not the snap package. Docker 25 introduced API 1.44; check the server's API range rather than assuming every newer Engine retains every older API. Compose is not used to manage CapRover.

  • [ ] Existing server configuration is backed up; this is a fresh VM, not a populated Swarm.
  • [ ] Ports 80, 443 and 3000 are free; SSH and a recovery console work.
  • [ ] Public route: you own a domain, can create wildcard DNS and can receive inbound TCP 80/443.
  • [ ] Home-only route: clients use your local DNS server; no public certificate is promised.
  • [ ] The server has space for images, builds, application data and backups beyond the minimum.

Tested on 2026-12-02: Linux = not run; Windows = not run; Mac = not run. We checked documentation, tagged source, registry metadata and issues. All checks below are expected results, not captured installation output.

Step 1: Prepare the Linux server and firewall#

Linux#

On the server, check Docker and create working folders:

Run in terminalbash
docker --version
sudo docker version
sudo docker info --format '{{.Swarm.LocalNodeState}}'
sudo ss -lntup
mkdir -p ~/docker_volumes/caprover/{data,config,logs,backups}

For a public web server, allow SSH before enabling UFW. Replace the quoted administrator address or subnet; if SSH uses a custom port, allow that port first.

Run in terminalbash
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow from '<admin-ip-or-cidr>' to any port 3000 proto tcp
sudo ufw enable
sudo ufw status

For LAN-only use, restrict 80/443 to your LAN as well. Keep TCP 2377, TCP/UDP 7946 and UDP 4789 private between cluster nodes; a single-node beginner setup needs no public Swarm rules. TCP 996 is only needed for the optional managed registry. See the port table.

Windows (PowerShell)#

Connect, then run the Linux block inside the server's shell:

Run in terminalpowershell
ssh '<user>@<linux-server>'

Mac (Terminal)#

Run in terminalbash
ssh '<user>@<linux-server>'

Run the Linux block on that server.

Check it worked. Docker reports both client and server; a fresh Swarm reports inactive. Check that the three required ports are unused and UFW is active. These are expected checks, not our test output.

Tip: Docker-published ports can bypass UFW filtering. Restrict administration at the router/provider firewall or with Docker-aware rules, then test from another network. A UFW rule alone does not prove port 3000 is private.

Step 2: Start CapRover on that server#

The standard installation keeps platform state in /captain. We retain that documented mount: the installer creates further services that use the same host path. Our ~/docker_volumes/caprover folders hold project files, selected app data and backup copies; they do not replace /captain or Docker's named volumes.

Linux#

Home network only: before the first install, create this override to skip public domain verification:

Run in terminalbash
sudo mkdir -p /captain/data
printf '%s\n' '{"skipVerifyingDomains":true}' | sudo tee /captain/data/config-override.json

For either route, replace <server-interface-ip> with the server's stable address: its LAN address behind your router, or its public interface address on a VPS.

Run in terminalbash
sudo docker run -p 80:80 -p 443:443 -p 3000:3000 \
  -e ACCEPTED_TERMS=true \
  -e MAIN_NODE_IP_ADDRESS='<server-interface-ip>' \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /captain:/captain \
  caprover/caprover:1.16.1

Read the terms before setting ACCEPTED_TERMS=true. MAIN_NODE_IP_ADDRESS selects the address used during installation; it does not create DNS or router forwarding.

This is the official bootstrap command with a pinned image and explicit address. It creates Swarm services. Do not wrap it in a perpetual Compose service with restart: unless-stopped; that ordinary-container recipe is inappropriate for this installer.

Windows (PowerShell)#

In the SSH session from Step 1, run the Linux commands. Bash line continuations belong in that remote shell, not directly in PowerShell.

Mac (Terminal)#

Same commands as Linux, inside the SSH session.

Check it worked. Run sudo docker service ls and sudo docker service ps captain-captain --no-trunc. Expect running control services and a reachable dashboard at http://<server-ip>:3000. Change the documented initial password, captain42, immediately through a trusted connection.

Step 3: Configure DNS and your deployment client#

For public hosting, create *.apps as an A record in your domain's DNS zone, pointing to the server's public address. Use apps.example.com as the example root domain throughout this guide, replacing it with yours. Behind a home router, forward TCP 80/443 to the Linux VM; keep 3000 private. CGNAT or blocked inbound ports prevents this ordinary public route.

For a private lab, configure local wildcard DNS for *.apps.home.example to the VM's LAN address and make clients use that resolver. If it lacks wildcards, create captain.apps.home.example and each app record individually. Hosts files do not support wildcard records. Set the root domain in the web dashboard without *. or captain..

Linux#

Back on your development computer:

Run in terminalbash
node --version
git --version
npm install -g [email protected]
caprover --version
nslookup captain.apps.example.com
nslookup test.apps.example.com

Windows (PowerShell)#

Run in terminalpowershell
node --version
git --version
npm install -g [email protected]
caprover --version
Resolve-DnsName captain.apps.example.com
Resolve-DnsName test.apps.example.com

Mac (Terminal)#

Same commands as Linux. Substitute the private domain in DNS checks for a LAN-only installation.

Public-server users can run caprover serversetup for interactive initial setup instead of configuring the dashboard manually. It requests domain, password and certificate information. Private-only users should use the web setup and skip its public certificate flow. After completing setup, use caprover login for subsequent access.

Check it worked. The CLI should report 2.4.4, and both DNS lookups should reach the intended server address. The dashboard should show your chosen root domain. None of these results was measured here.

Tip: Wildcard DNS and wildcard certificates are different. DNS makes new app names resolve; CapRover's normal Certbot workflow issues certificates for individual hostnames.

Step 4: Deploy a small app from Git#

Create a web app named hello in the dashboard. Set Container HTTP Port to 80; do not publish another host port. In a new client folder, create these three files with your editor.

captain-definition has no extension:

File contentjson
{"schemaVersion":2,"dockerfilePath":"./Dockerfile"}

Dockerfile:

File contentdockerfile
FROM nginx:1.31.9-alpine
COPY index.html /usr/share/nginx/html/index.html

index.html:

File contenthtml
<!doctype html>
<html lang="en"><meta charset="utf-8"><title>CapRover demo</title>
<h1>Hello from CapRover</h1></html>

The official nginx image supplies that document root. We verified this exact tag on Docker Hub. Configure your own Git author identity before committing.

Linux#

Create the folder, save the files there, then run the remaining commands:

Run in terminalbash
mkdir -p ~/docker_volumes/caprover/data/hello
cd ~/docker_volumes/caprover/data/hello
git init -b main
git add captain-definition Dockerfile index.html
git commit -m "Add CapRover demo"
caprover login
caprover deploy

Windows (PowerShell)#

Codepowershell
New-Item -ItemType Directory -Force "$HOME\docker_volumes\caprover\data\hello" | Out-Null
Set-Location "$HOME\docker_volumes\caprover\data\hello"
git init -b main
git add captain-definition Dockerfile index.html
git commit -m "Add CapRover demo"
caprover login
caprover deploy

Save the three files after entering the folder and before git add.

Mac (Terminal)#

Same commands as Linux.

At login choose your dashboard URL, preferably HTTPS after the next section. At deployment choose the saved server, hello and main. The CLI sends committed content to the Linux server to build.

Check it worked. Open http://hello.apps.example.com, or your local equivalent. The expected page says Hello from CapRover. Edit it, commit again and redeploy to check the whole path. We did not run this example.

Tip: Git deployments send only committed files: uncommitted changes and ignored untracked files are left out, but a file already committed still goes along even if .gitignore matches it later. For generated files, explicitly select an archive instead. Keep passwords and .env out of both sources.

HTTPS: why CapRover does not go behind Traefik#

With Traefik: give CapRover a separate machine#

This guide requires a dedicated machine or VM with its own IP. CapRover manages nginx and owns 80/443 for dashboard routing, app domains and certificate validation. Do not add Traefik labels or an external proxy network to the bootstrap command. A Caddy reverse_proxy listener on the same ports would conflict too. Advanced proxy arrangements need deliberate hostname, challenge and WebSocket routing; they are outside this beginner setup.

Without Traefik: use CapRover's own nginx#

On a public domain, enable dashboard HTTPS, verify it works, then enable Force HTTPS. Repeat in hello's HTTP settings. Keep public TCP 80 available for certificate issuance and renewal; redirecting normal HTTP traffic does not eliminate that requirement.

Linux/Mac:

Run in terminalbash
curl -I https://captain.apps.example.com
curl -I https://hello.apps.example.com

Windows:

Run in terminalpowershell
curl.exe -I https://captain.apps.example.com
curl.exe -I https://hello.apps.example.com

Expect a valid certificate and a successful response or appropriate login redirect. Do not use -k to hide certificate failures. Restrict external access to 3000 after this works.

Without a public IP#

The documented private installation uses HTTP. Local DNS and skipVerifyingDomains do not make Let's Encrypt reach your LAN. Keep that HTTP route on a trusted isolated lab network; it does not encrypt credentials.

For HTTPS, an owned public domain can use advanced DNS-01 validation without inbound public ports. CapRover needs a compatible Certbot DNS-plugin image, credentials and renewal configuration; this is not a checkbox. Alternatively, use a private-CA certificate with custom nginx configuration, and trust its CA on every client. Custom certificates need their own renewal process. We have not validated either advanced recipe and do not present one as ready to paste.

Security and testing#

The Docker socket gives CapRover administrative control over this server. Restrict dashboard access, protect CLI credentials and never make the socket world-writable. Runtime secrets belong in app environment settings, not committed files. Backups can contain those secrets.

On the Linux server, including through SSH from Windows/Mac:

Run in terminalbash
sudo docker service ls
sudo docker service logs captain-captain --tail 100
sudo docker service ps captain-nginx --no-trunc

Check dashboard login, an app response, a second deployment and HTTPS from another client. A successful build alone does not prove routing or storage works.

One-click apps, storage and other deployments#

One-click apps: open the catalog, review the template, choose its required variables and deploy. Record exact image versions. Templates may create several apps; check each service. Initial database passwords may only apply on first startup.

Persistence: enable Has Persistent Data when creating an appropriate app, then map the actual container data directory to a named volume or an absolute host path under your server's ~/docker_volumes/caprover/data. Expand ~ before entering the path. Set permissions for the image's user. Named volumes live in Docker storage, not this folder. Write a test file, redeploy and confirm it survives.

Archives: from the demo folder, these commands work in Linux/Mac shells and Windows with tar installed:

Run in terminalbash
tar -cf ../hello.tar captain-definition Dockerfile index.html
tar -tf ../hello.tar
caprover deploy --tarFile ../hello.tar

Prebuilt images: caprover deploy --imageName nginx:1.31.9-alpine deploys the stock welcome page instead of our custom one. Choose only one source: branch, archive or image.

Git webhooks: configure repository, branch and credentials in the app, then add its generated URL as a push webhook. Treat that URL as a secret. A repository in Forgejo or builds in Woodpecker CI can be part of your workflow; provider-specific integration still needs testing.

More nodes: configure a default push registry first, redeploy existing built apps into it, then add a worker through Cluster → Nodes. A registry such as Harbor needs matching credentials on CapRover. Node-local storage does not move with replicas. Start with one node.

Common mistakes#

These reports document real symptoms, often on older releases. The AI row is our warning about advice to reject; the linked report does not establish AI authorship.

MistakeWhy it happensDo this instead
Repeatedly running the installer after partial setupIssue 1043: This node is already part of a swarm.Inspect existing services and preserve state; do not force-leave a populated Swarm.
Using automatic public-address assumptions on a private hostIssue 1796: Couldn't find your IPSet the real interface address. That report also had host network-permission failures, which an IP setting cannot fix.
Assuming a valid certificate proves the app worksIssue 1252: 502 Bad Gateway despite certificate successInspect nginx's upstream and the service tasks. For apps, match Container HTTP Port and listen on 0.0.0.0.
Expecting wildcard DNS to prevent certificate limitsCLI issue 82: too many certificates already issuedStop retries, read the CA's retry guidance and preserve certificate state.
Blaming Certbot without checking custom nginxIssue 693: task: non-zero exit (1)The reporter found an invalid cache directive. Inspect nginx logs and restore the saved template.
Accepting an AI assistant's generic “add Traefik/Caddy” recipeIssue 2377 includes failed to bind host port 0.0.0.0:80/tcp: address already in useCheck port owners; put CapRover on its own VM. That report had a host nginx conflict and other host problems.

Troubleshooting#

ProblemSolution
Dashboard never becomes readysudo docker service ps captain-captain --no-trunc; inspect nginx and Certbot tasks too.
App returns 502Find its actual name with sudo docker service ls, then run sudo docker service logs '<app-service>' --tail 100.
Port conflictsudo ss -lntup; identify the owner before stopping anything.
Suspected mount or container failuresudo docker ps -a, then sudo docker inspect '<container-id>' and sudo docker logs '<container-id>' --tail 100. Inspect output can expose secrets.
New node cannot run an appCheck registry access and private cluster ports; inspect sudo docker service ps '<app-service>' --no-trunc.

Use Swarm service commands here, not docker compose ps. Run container-level commands on the node hosting the task.

502 Bad Gateway#

Read upstream logs before changing DNS or certificates. Issue 1252 involved dashboard networking; a web application's wrong port is a different possible cause, not that report's proven diagnosis.

This node is already part of a swarm.#

The reported installation failure needs state inspection. Re-running bootstrap or deleting Swarm state can make recovery harder.

too many certificates already issued#

The exact substring appears in CLI issue 82. Correct validation problems and follow the returned retry time; deleting local certificates does not reset a CA limit.

Known bugs#

Issue 2407 remains open for a 1.14.2 startup loop. We have no evidence it reproduces on 1.16.1; inspect task timing instead of copying an old downgrade command. Issue 2555 reports the 1.16.1 updater blocking an older Docker API despite an override. Upgrade Engine first; bypassing the check is not our beginner workaround.

Updates and backups#

Read releases and back up before updating through Maintenance → CapRover Updates. Verify the offered version, Docker API compatibility and app behavior afterward. CapRover updates its Swarm service; docker compose pull and docker compose up -d are not its update workflow.

Create and download Maintenance → Configuration Backup. It includes /captain/data and restoration metadata, including managed registry data stored there. It excludes ordinary app volumes, outside bind mounts and the local Docker image store. Keep usable image references and separate database exports.

For scheduled configuration backups, create ~/docker_volumes/caprover/config/.env on the Linux server with shell assignments for CAPROVER_URL and CAPROVER_PASSWORD. Quote values, set chmod 600 on the file and use a trusted HTTPS URL. Install curl and jq. Save this adaptation of the official backup API example as config/backup.sh:

File contentbash
#!/usr/bin/env bash
set -euo pipefail
umask 077
base="$HOME/docker_volumes/caprover"
source "$base/config/.env"
api_token=$(curl --fail --silent --show-error "$CAPROVER_URL/api/v2/login" \
  -H 'x-namespace: captain' -H 'content-type: application/json' \
  --data "$(jq -n --arg password "$CAPROVER_PASSWORD" '{password:$password}')" | jq -er '.data.token')
download_token=$(curl --fail --silent --show-error "$CAPROVER_URL/api/v2/user/system/createbackup" \
  -H "x-captain-auth: $api_token" -H 'x-namespace: captain' \
  --data '{"postDownloadFileName":"backup.tar"}' | jq -er '.data.downloadToken')
curl --fail --silent --show-error -G "$CAPROVER_URL/api/v2/downloads/" \
  --data-urlencode 'namespace=captain' --data-urlencode "downloadToken=$download_token" \
  -o "$base/config/backup.tar"
test -s "$base/config/backup.tar"
tar -czf "$base/backups/caprover-$(date +%Y-%m-%d-%H%M%S).tar.gz" \
  -C "$base" data config

Stop application writes or put consistent database dumps in data before archiving it. This script does not discover named volumes, stop writers or copy backups off-server. Add those jobs deliberately; our volume backup guide explains the distinction. Protect the archive because config includes credentials.

For Linux, add 0 3 * * * /bin/bash "$HOME/docker_volumes/caprover/config/backup.sh" with crontab -e. Windows Task Scheduler can run ssh.exe daily at 03:00 with arguments "<user>@<linux-server>" "bash ~/docker_volumes/caprover/config/backup.sh". Mac cron can run the same SSH command at 03:00. Choose one scheduler, configure SSH keys and failure alerts, and keep that computer awake. Private HTTP labs need a trusted encrypted access arrangement before using this credential-bearing API script.

Restore test: on a separate fresh Linux VM, unpack the dated archive into an empty working folder. Copy config/backup.tar to /captain/backup.tar before running Step 2's pinned bootstrap. Restore app volumes and database dumps separately, redeploy missing images and use isolated DNS while testing. Verify login, a saved data item, redeployment and HTTPS before switching real traffic. We have not performed this restore.

Performance and resources#

We measured no RAM, CPU or deployment time. Docker Hub reports about 83 MB compressed for the amd64 control image; nginx, Certbot, apps and build cache add more. The official 1 GiB/5 GiB minimum is a starting requirement, not a workload budget.

Monitor with sudo docker stats, sudo docker system df, free -h and df -h on the server. Builds can need much more memory than idle apps; build in CI and deploy images if necessary. Keep cleanup deliberate so images needed for recovery remain available.

FAQ#

Can Windows or Mac host this guide's server?

We use a Linux server. Windows and Mac run the CLI, editor and Git; SSH handles server administration.

Can it work without a public IP?

Yes, with local DNS and the private-install override. Ordinary public HTTP-01 certificate validation will not work; private HTTPS needs additional certificate planning.

Is a one-click app automatically backed up?

No. Its database and uploaded files require separate backups and a restore test.

Does adding a worker duplicate persistent storage?

No. Local volumes remain on their node; plan storage and image distribution first.

How does it compare with other app platforms?

Compare the deployment and recovery workflow with our Dokploy and Coolify guides. Here, the defining choice is letting CapRover manage Swarm and nginx on a dedicated host.

Sources#

Checked against the official docs on 2026-12-02.

Try one of these