Deployment Overview of CapRover on Server¶
Prerequisites and Basic Requirements¶
To successfully deploy CapRover, the following system requirements must be met:
- Operating System: Debian-based Linux distribution.
- Privileges: Root access or
sudoprivileges are required to install Docker and manage system services. - Network: The server must have a public IP address accessible from the internet.
- Ports: Ports
80,443, and3000must be open and available for binding. - DNS: A domain zone must be configured to accept a wildcard A record pointing to the server's IP address.
File and Directory Structure¶
The deployment utilizes specific directories and mount points for data persistence and Docker communication:
/var/run/docker.sock: The Docker socket is mounted into the container to allow CapRover to manage the host's Docker daemon./captain: This directory serves as the persistent data volume for CapRover, storing application configurations, logs, and state.
Application Installation Process¶
CapRover is installed and run as a Docker container using the official caprover/caprover image. The installation process involves executing a single docker run command that initializes the service with the necessary environment variables and volume mounts.
The deployment command includes the following parameters: - Port mappings: 80 (HTTP), 443 (HTTPS), and 3000 (CapRover UI). - Environment variable: ACCEPTED_TERMS=true to automatically accept the terms of service. - Volume mounts: The Docker socket and the /captain directory.
Docker Containers and Their Deployment¶
The application is deployed using a single container instance. The container is launched with the following configuration:
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
This command ensures that: - The container listens on the standard web ports and the CapRover management port. - The container has direct access to the host's Docker engine to orchestrate other containers. - Data is persisted in the /captain directory on the host.
Proxy Servers¶
CapRover includes an integrated reverse proxy and SSL certificate management system. Upon deployment:
- The container binds to ports
80and443to handle incoming HTTP and HTTPS traffic. - It automatically manages SSL certificates for deployed applications.
- A wildcard DNS record (
*.prefixserverid.zone) is configured to point to the server's IP address, enabling dynamic domain routing for applications deployed via CapRover.