# Running Cachet Open Source Status Page System in Docker on Linux

## What is Cachet?

> Cachet is a beautiful and powerful open source status page system. -https://github.com/CachetHQ/Cachet

## Installing Docker

1. Log into the Linux based device
2. Run the following commands in the terminal
   # install prerequisites
   sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y
   # add docker gpg key
   curl -fsSL https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)/gpg | sudo apt-key add -
   # add docker software repository
   sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release) $(lsb_release -cs) stable"
   # install docker
   sudo apt install docker-ce docker-compose containerd.io -y
   # enable and start docker service
   sudo systemctl enable docker && sudo systemctl start docker
   # add the current user to the docker group
   sudo usermod -aG docker $USER
   # reauthenticate for the new group membership to take effect
   su - $USER

## Running Cachet

1. Now that Docker is installed, run the following commands to setup the Cachet container and run it
   # create working directories
   mkdir /home/$USER/docker/postresql -p
   # set owner of working directories
   sudo chown "$USER":"$USER" /home/"$USER"/docker -R
   # run the postgesql docker container
   docker run -d --name postgres -e POSTGRES_USER=cachet -e POSTGRES_PASSWORD=Cach3t -e POSTGRES_DB=cachet -v /home/$USER/docker/postresql:/var/lib/postgresql/data --restart=unless-stopped postgres:latest
   # run the cachet docker container
   docker run -d --name cachet --link postgres -e DB_DRIVER=pgsql -e DB_HOST=postgres -e DB_DATABASE=cachet -e DB_USERNAME=cachet -e DB_PASSWORD=Cach3t -e APP_KEY=base64:YAWZR/UkMlVTBWEET95ZGiL7g13mhNwaKF4hzYmo9oc= -e APP_ENV=production -p 8000:8000 --restart=unless-stopped cachethq/docker:latest
2. Open a web browser and navigate to http://DNSorIP:8000/setup
3. The Cachet setup screen should be displayed
4. Set the Cache, Queue and Session drivers to Database
5. Optionally setup the SMTP host and email address > Click Next
6. Enter a site name, set the timezone and language > Click Next
7. Create an administrator account by entering a username, email address and password > Click Complete Setup
8. Click the Go to dashboard button
9. Login with the administator account created earlier
10. Welcome to Cachet
11. To view the status page navigate to http://DNSorIP:8000

Documentation: https://hub.docker.com/r/cachethq/docker