# CapRover — Automated Docker Deployment PaaS with Web UI > CapRover is an open-source PaaS (Heroku on Steroids) with a beautiful web UI, one-click apps, automatic HTTPS, and Docker Swarm support. Deploy any app in seconds. ## Install Save as a script file and run: ## Quick Use ```bash # Install on any VPS with Docker 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-data:/captain caprover/caprover ``` Open `http://your-server-ip:3000` — set your password and root domain to start deploying. ## Intro **CapRover** is an extremely easy-to-use PaaS (Platform as a Service) that automates Docker deployment with a beautiful web interface. It provides one-click app deployment, automatic HTTPS via Let's Encrypt, a built-in app store with 100+ pre-configured applications, and Docker Swarm support for horizontal scaling. With 15K+ GitHub stars and Apache-2.0 license, CapRover markets itself as "Heroku on Steroids" — offering all the simplicity of Heroku with the power and flexibility of Docker, at just the cost of your VPS. ## What CapRover Does - **Web Dashboard**: Beautiful web UI for managing all deployments and settings - **One-Click Apps**: 100+ pre-configured apps (WordPress, PostgreSQL, MongoDB, Redis, Ghost, etc.) - **Git Push Deploy**: Deploy via git push, CI/CD webhook, or Docker image - **Automatic HTTPS**: Let's Encrypt certificates for all apps, auto-renewed - **Docker Swarm**: Built-in cluster support for high availability and scaling - **Dockerfile/Docker Compose**: Deploy any Dockerfile or docker-compose.yml - **CLI Tool**: Command-line tool for deployment from CI/CD pipelines - **Persistent Storage**: Managed volumes for databases and stateful apps - **Custom Nginx**: Full nginx configuration per app for advanced routing ## Architecture ``` ┌──────────────────────────────────────┐ │ CapRover Server │ │ ┌──────────┐ ┌──────────────────┐ │ │ │ Captain │ │ Docker Swarm │ │ │ │ (Web UI) │ │ ┌────┐ ┌────┐ │ │ │ │ (Node.js)│ │ │App1│ │App2│ │ │ │ └──────────┘ │ └────┘ └────┘ │ │ │ ┌──────────┐ │ ┌────┐ ┌────┐ │ │ │ │ Nginx │ │ │ DB │ │Cache│ │ │ │ │ (Proxy) │ │ └────┘ └────┘ │ │ │ └──────────┘ └──────────────────┘ │ └──────────────────────────────────────┘ ``` ## Getting Started ### 1. Install CapRover ```bash # On a VPS with Docker installed 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-data:/captain caprover/caprover ``` ### 2. Configure Domain ``` Point *.apps.yourdomain.com to your server IP (A record) Open http://your-ip:3000 Set root domain: apps.yourdomain.com Enable HTTPS for dashboard ``` ### 3. Deploy an App **Via Web UI:** 1. Click "Apps" → "Create New App" 2. Enter app name → "Create" 3. Upload source code or Docker image 4. App is live at `https://app-name.apps.yourdomain.com` **Via CLI:** ```bash npm install -g caprover caprover login # In your project directory: caprover deploy ``` **Via captain-definition file:** ```json { "schemaVersion": 2, "dockerfilePath": "./Dockerfile" } ``` ### 4. One-Click Apps From the web UI, deploy pre-configured apps with one click: - **Databases**: PostgreSQL, MySQL, MongoDB, Redis, ClickHouse - **CMS**: WordPress, Ghost, Strapi, Directus - **Dev Tools**: Gitea, Drone CI, Portainer, Adminer - **Monitoring**: Grafana, Prometheus, Netdata - **Communication**: Rocket.Chat, Mattermost - **And 100+ more** ## Key Features ### App Configuration (Web UI) ``` App: my-api ├── HTTP Settings │ ├── Enable HTTPS ✅ (auto Let's Encrypt) │ ├── Force HTTPS ✅ │ ├── Container Port: 8080 │ └── Custom domain: api.mysite.com ├── App Configs (Environment Variables) │ ├── DATABASE_URL: postgres://... │ ├── REDIS_URL: redis://... │ └── SECRET_KEY: *** ├── Deployment │ ├── Instance Count: 3 (horizontal scaling) │ ├── Deploy via: Git, Tarball, Docker Image │ └── Captain Definition file └── Persistent Directories └── /app/data → managed volume ``` ### Docker Compose Deployment ```yaml # captain-definition { "schemaVersion": 2, "dockerComposeFileContent": "version: '3' services: web: image: nginx ports: - 80:80" } ``` ### CI/CD Integration ```yaml # GitHub Actions - name: Deploy to CapRover uses: caprover/deploy-from-github@v1 with: server: https://captain.apps.yourdomain.com app: my-app token: ${{ secrets.CAPROVER_TOKEN }} ``` ## CapRover vs Alternatives | Feature | CapRover | Dokku | Coolify | Heroku | |---------|----------|-------|---------|--------| | Web UI | Beautiful | No (CLI) | Modern | Yes | | One-click apps | 100+ | Plugins | 100+ | Marketplace | | Cluster support | Docker Swarm | Single server | Yes | Dynos | | Deploy method | Git/UI/CLI/Image | Git push | Git/UI | Git push | | Configuration | Web UI | CLI | Web UI | Web/CLI | | Learning curve | Low | Medium | Low | Low | | Best for | Visual management | CLI users | Modern UI | SaaS | ## 常见问题 **Q: CapRover 和 Dokku 怎么选?** A: CapRover 有漂亮的 Web UI 和一键应用商店,适合喜欢图形界面的用户。Dokku 是纯命令行,更贴近 Heroku 体验,适合 DevOps 工程师。功能上两者相当。 **Q: 一台服务器够用吗?** A: 对于小型项目完全够用。CapRover 支持 Docker Swarm,需要扩展时可以添加工作节点形成集群。单台 2GB RAM VPS 可以运行 3-5 个小型应用。 **Q: 如何备份 CapRover?** A: 备份 `/captain` volume(包含配置和 nginx 设置)。数据库需要单独备份(pg_dump 等)。应用代码在 Git 仓库中已有备份。 ## 来源与致谢 - GitHub: [caprover/caprover](https://github.com/caprover/caprover) — 15K+ ⭐ | Apache-2.0 - 官网: [caprover.com](https://caprover.com) --- Source: https://tokrepo.com/en/workflows/ed45050b-34d8-11f1-9bc6-00163e2b0d79 Author: Script Depot