We expect that you have created Server on your cloud provider. Now it’s time to access the server and install the Caprover.
Video Guide
Step 2: CapRover Installation
First, open the terminal or console of your Ubuntu server. You can do this by using SSH to connect to your server. or use broswer based SSH to connect. For example:
ssh root@[YOUR_SERVER_IP]
Docker Installation:
Run the following command to uninstall all conflicting packages:
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
Installing using apt
Repository
Step 1: setup docker’s apt
Repository
Copy and paste the given commands to terminal.
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
Step 2: Install the Docker packages.
Copy and paste below command to your server/SSH terminal.
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Step 3: Verify Docker Installation.
to verify the installation run following command.
sudo docker run hello-world
This command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits.
Step 4: Configuring Firewall
Copy and paste the below given command to SSH terminal, to modify firewall settings.
Note: Some providers like AWS restricts the firewall settings, However they provide dedicated page to manage Inbound & Outbound Ports. You’ll have to look for the your cloud provider’s guide to setup the firewall.
For DigitalOcean it’s straight foreward, just paste the below given command, and that’s it.
ufw allow 80,443,3000,996,7946,4789,2377,3306,22/tcp; ufw allow 7946,4789,2377/udp;
You have now successfully installed and started Docker Engine.
Installing Caprover using Docker:
Once Docker is installed, run the following command to install CapRover:
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
NOTE: Do not change the port mappings. CapRover only works on the specified ports.
You will see a bunch of outputs on your screen. Once CapRover is initialized, visit http://[IP_OF_YOUR_SERVER]:3000 in your browser and log in to CapRover using the default password captain42
. You can change your password later. However, do not make any changes in the dashboard. We’ll use the command line tool to set up the server (recommended).
STEP 3 : Custom Domain Configuration
To set up your own domain to point to your server, follow these steps:
-
Find Your Server’s External IP Address:
- You can find your server’s IP address in your hosting provider’s control panel. This is referred to as the Primary IP / Public IP or External IP.
-
Login to Your Domain Registrar:
- Go to the website where you purchased your domain (e.g. Hostinger, GoDaddy, Namecheap).
- Locate the DNS management panel for your domain. This is where you’ll configure your domain records.
-
Add an A Record:
- You’ll need to add an A Record to point your domain to your server’s external IP address.
- Create an A Record for a wildcard subdomain (e.g.,
*.yourdomain.com
) to point to your server’s IP.
For example, if your server’s Public IP is
45.210.99.200
and you’re using a wildcard subdomain like*.apps
, your A Record will look like this:Type Host Value TTL A Record *.apps 45.210.99.200 Automatic A Record backend 45.210.99.200 Automatic A Record @ 45.210.99.200 Automatic -
Finish DNS Setup:
- Once the A Records are added, DNS is configured, and you won’t need to change anything further in your domain settings.
That’s it! You’re ready to move on to the next step in setting up your server.