Install CapRover on Ubuntu 20.04

Today we will show you how to install CapRover on Ubuntu 20.04 and setup your own Platform as a service(PaaS). CapRover is a simple app, database and web server manager. It supports multiple applications such as MongoDB, PostgreSQL, Node.js, PHP, Ruby and so on.

CapRover is free and enables you to focus on your apps increasing productivity. With pre-built application repository, you can install these applications through one click. Behind the scenes, CapRover runs Nginx, LetsEncrypt, Docker and NetData. It is a bit tricky to install CapRover on your local machine and that is why this guide is going to make it simple to Install CapRover on Ubuntu 20.04.

Install CapRover on Ubuntu 20.04

Step 1: Install Docker

You need Docker to install CapRover on Ubuntu 20.04.

  • Update the system packages:
sudo apt update
  • Install curl if not installed:
sudo apt install curl
  • Add Docker’s official GPG key:
curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  • Setup a stable repository:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  • Update the system packages again.
sudo apt update
  • Install the latest version of Docker.
sudo apt-get install docker-ce docker-ce-cli

Step 2: Verify Root domain

CapRover uses http://captain.captain.localhost as the root domain. You therefore need to make sure CapRover resolvers captain.captain.localhost to your local machines IP address.

Make sure you have Docker version 17.06.x and above

docker version
Client: Docker Engine - Community
 Version:           20.10.16
 API version:       1.41
 Go version:        go1.17.10

Run the command below and make sure it resolves to your local machine IP address, in my case,

nslookup randomstring123.captain.localhost

Non-authoritative answer:
Name:    randomstring123.captain.localhost
Name:    randomstring123.captain.localhost
Address: ::1

In case your system does not automatically resolve to the local IP address, add your local system’s IP to the wildcard entry.

Step 3: Install CapRover on Ubuntu 20.04

  • Create a folder to store the configurations
sudo mkdir -p /captain/data/
  • Create configurations under the folder you have created to allow CapRover to be installed locally. Ensure you are running the commands as a root user.
echo  "{\"skipVerifyingDomains\":\"true\"}" > /captain/data/config-override.json 
  • Install CapRover on Ubuntu 20.04. Replace MAIN_NODE_IP_ADDRESS with your IP address
docker run -e MAIN_NODE_IP_ADDRESS= -p 80:80 -p 443:443 -p 3000:3000 -v /var/run/docker.sock:/var/run/docker.sock -v /captain:/captain caprover/caprover
  • Port 80 is for HTTP connections, 443 for secure HTTPS connections and 3000 for initial Captain installation

Step 4: Accessing CapRover web interface

Access the web interface by visiting your browser typing in http://local.machine.IP.address:3000 i.e. Remember that you can’t run https locally.

The login screen loads as below. Enter the default password, captain42 and click login.

Install CapRover on Ubuntu 20.04

The dashboard loads:

Install CapRover on Ubuntu 20.04

You might want to change the password. So click on Settings and scroll downwards. Update your password.

Step 5: Deploying applications/Databases

Here you will install existing apps/database via one click, for instance, phpMyAdmin

Click on the Apps tab. Select one-click Apps/Databases. Wait for the wizard to load.

Search for phpMyAdmin and click on the first option.

Enter your app name like database name: my-app

Click on Finish

phpMyAdmin app is now visible on the under your apps. Click on the link under open to open your app in a new tab.

PhpMyAdmin opens:

Read more on CapRover Documentation

More interesting tutorials

Install Xrdp Server on Ubuntu 22.04

Install NFS Server on Ubuntu 22.04

Install Bacula Server with MariaDB on Ubuntu 22.04

Install and Configure Borgmatic on Ubuntu 22.04

Android Developer | Linux | Technical Writer | Backend Developer

Leave a Comment