Cachet is an open-source status page system written in PHP. It allows you to monitor downtime and system failure on your infrastructure. Cachet provides JSO API, even reports, metrics, multiple notification methods, and Two-Factor authentication.

In this tutorial, you’ll learn how to install and run Cachet on an Ubuntu 24.04 server with Docker. You’ll also install and set up Nginx as a reverse proxy and secure Cachet with HTTPS through Certbot and Letsencrypt.

Prerequisites

To complete this guide, make sure you have:

  • An Ubuntu 24.04 server.
  • A non-root user with administrator privileges.
  • A domain name pointed to the server IP address.

Installing Docker Engine

In this guide, you’ll run Cachet as a container using Docker. You’ll then install Docker Engine on your Ubuntu system.

First, run the command below to install packages ca-certificates and curl.

sudo apt install ca-certificates curl

Now run the following command to add the GPG key for the Docker repository.

sudo install -m 0755 -d /etc/apt/keyrings

sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc

sudo chmod a r /etc/apt/keyrings/docker.asc

Add the Docker repository with the following:

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

<img alt="setup docker repo" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/07/echo/1-setup-docker-repo.png668bd2ca1d436.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="220" loading="lazy" src="data:image/svg xml,” width=”750″>

Next, update your Ubuntu package index and install Docker Engine with the following apt command. Input Y to confirm the installation.

sudo apt update

sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

<img alt="install docker" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/07/echo/2-install-docker.png668bd2ca68510.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="233" loading="lazy" src="data:image/svg xml,” width=”750″>

After the installation, the docker service should be running and enabled on your Ubuntu system.

Run the command below to check the Docker service.

sudo systemctl is-enabled docker

sudo systemctl status docker

You’ll see similar output below:

<img alt="check docker" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/07/echo/3-check-docker.png668bd2cab2854.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="225" loading="lazy" src="data:image/svg xml,” width=”750″>

Setting up user to run Docker

After installing Docker, you must add your user to the docker group. This allows you to run the container as a non-root user.

To add your user to the docker group, run the command below. Change the username with your user.

sudo usermod -aG docker username

Now log in with your user and run the docker command to verify your configuration.

su - username

docker run hello-world

If your configuration is successful, you’ll see the Hello World message from Docker.

<img alt="docker run hello world" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/07/echo/4-docker-hello-world.png668bd2cb09d13.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="510" loading="lazy" src="data:image/svg xml,” width=”750″>

Installing Cachet with Docker

Now that you’ve installed Docker Engine and configured your user, you’ll download the Cachet project, set up the docker-compose.yml file, build images and reconfigure the container for Cachet, and then run Cachet as a container.

Download the Cachet docker version to the cachet-docker directory and move into it.

git clone https://github.com/cachethq/Docker.git cachet-docker

cd cachet-docker

Edit the docker-compose.yml using the nano editor.

nano docker-compose.yml

Change the default port to 8000 for both the container and Docker host.

ports:

- 8000:8000

Save the file and exit.

Now run the docker command below to build the Cachet image and start the Cachet container.

docker compose build

docker compose up

During the build process, you’ll see the following:

<img alt="build cachet image" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/07/echo/5-setup-cachet.png668bd2cb2b374.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="318" loading="lazy" src="data:image/svg xml,” width=”750″>

When starting the Cachet container, you’ll get an output like the following:

<img alt="build container" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/07/echo/6-run-and-build.png668bd2cb66b1d.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="426" loading="lazy" src="data:image/svg xml,” width=”750″>

The first time you run Cahet, it will generate a new APP_KEY like the following – Copy the APP_KEY and press Ctrl c to terminate Cachet containers.

<img alt="app_key" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/07/echo/7-app-key.png668bd2cb96c0c.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="58" loading="lazy" src="data:image/svg xml,” width=”750″>

Next, edit the docker-compose.yml file again and replace the APP_KEY like the following:

APP_KEY=base64:6ltZ62B69p6oxIVeQtf9jpX5BFvgUXU2qk5eXpw3OIQ=

Save the file and exit.

Now run the docker command below to delete old containers and new Cachet containers.

docker compose down

docker compose up -d

Lastly, run the following command to check running containers or services.

docker compose ps

You can see below the Cachet container is running on port 8000.

<img alt="rerun container" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/07/echo/8-rerun-container.png668bd2cbdcb34.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="331" loading="lazy" src="data:image/svg xml,” width=”750″>

Setting up Nginx as a reverse proxy

In this guide, you’ll run Cachet with Nginx as a reverse proxy. So now you’ll install Nginx and a new server block for a reverse proxy. Make sure that you’ve your domain name ready and pointed to the server IP address.

To install the Nginx web server, run the following apt command. Input Y to proceed with the installation.

sudo apt install nginx

<img alt="install nginx" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/07/echo/10-install-nginx.png668bd2cc3391c.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="330" loading="lazy" src="data:image/svg xml,” width=”745″>

After the installation is complete, create a new Nginx server block file /etc/nginx/sites-available/cachet.conf with the nano editor.

sudo nano /etc/nginx/sites-available/cachet.conf

Paste the following configuration and make sure to change the status.howtoforge.local with your domain name.

server {

listen 80;

server_name status.howtoforge.local;

location / {

proxy_pass http://127.0.0.1:8000;

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto $scheme;

}

}

When done, save the file and exit the editor.

Now run the command below to activate server block file cachet.conf /and verify your Nginx syntax. If you’ve proper syntax, you’ll see an output test- is successful – syntax is ok.

sudo ln -s /etc/nginx/sites-available/cachet.conf /etc/nginx/sites-enabled/

sudo nginx -t

<img alt="setup nginx" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/07/echo/11-setup-nginx.png668bd2cc60542.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="142" loading="lazy" src="data:image/svg xml,” width=”750″>

Lastly, run the systemctl command below to restart the Nginx service and apply your changes. Then, check the Nginx service status to ensure it is running.

sudo systemctl restart nginx

sudo systemctl status nginx

You can see below the Nginx service is running as a reverse proxy for the Cachet installation.

<img alt="check nginx" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/07/echo/12-check-nginx.png668bd2cc9fd3c.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="224" loading="lazy" src="data:image/svg xml,” width=”750″>

Securing Cachet with HTTPS

At this point, Cachet is running in a container, and you’ve configured Nginx as a reverse proxy for it. To secure Cachet, you’ll generate SSL certificates and implement HTTPS through Certbot and Letsencrypt.

Install the Certbot and Certbot Nginx plugin using the following apt command. Press Y to confirm the installation.

sudo apt install certbot python3-certbot-nginx

Now run the certbot command below to generate SSL certificates and secure Cachet with HTTPS. Make sure to change the domain name and email address with your information.

sudo certbot --nginx

Once the process is complete, your SSL certificates will be available in the /etc/letsencrypt/live/domain.com directory and your Cachet installation should be secured with HTTPS.

Installing Cachet

Visit your Cachet domain name such as https://status.howtoforge.local/ using your preferred web browser. you’ll see the installation wizard.

On the Environment Setup section, select the default Cache, Queue, and Session as Database and enter your SMTP details.

<img alt="env setup" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/07/echo/13-env-setup.png668bd2ccef5fd.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="473" loading="lazy" src="data:image/svg xml,” width=”750″>

Create your first status page and click Next to continue.

<img alt="create first page" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/07/echo/14-create-first-status-page.png668bd2cd46491.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="480" loading="lazy" src="data:image/svg xml,” width=”750″>

Enter the new administrator user, email address, and password for your Cachet installation.

<img alt="setup admin" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/07/echo/15-setup-admin.png668bd2cd6ae64.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="426" loading="lazy" src="data:image/svg xml,” width=”750″>

After the installation is finished, you’ll see an output Cachet has been configured successfully. And then click Go to dashboard to access Cachet.

<img alt="install success" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/07/echo/16-success.png668bd2cd9c1bd.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="379" loading="lazy" src="data:image/svg xml,” width=”750″>

Enter your admin user and password, then click Login.

<img alt="login" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/07/echo/17-login.png668bd2cdc97ef.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="460" loading="lazy" src="data:image/svg xml,” width=”431″>

If you have the correct credentials, you’ll see the Cachet dashboard like the following:

<img alt="dashboard" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/07/echo/18-dashboard.png668bd2cdf269b.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="309" loading="lazy" src="data:image/svg xml,” width=”750″>

Conclusion

Congratulations! You’ve completed the installation of the Cachet status page on an Ubuntu 24.04 server with Docker. You’ve configured Nginx as a reverse proxy for Cachet and secured Cachet with HTTPS through Certbot and Letsencrypt. You can now add and monitor your websites or services with Cachet and set up additional notifications with email addresses etc.