How to Install Plausible Analytics on Debian Latest

Plausible Analytics is an open-source web analytics tool that provides privacy-friendly and straightforward web analytics reports. In this tutorial, we will walk you through the steps to install Plausible Analytics on Debian Latest system.

Prerequisites

Before installing Plausible Analytics, you need to have these prerequisites:

Step 1: Update and Upgrade the System

Before installing any packages, it is recommended to update and upgrade the system packages for better performance and security.

To update and upgrade the system, run the following commands:

sudo apt update
sudo apt upgrade

Step 2: Install Docker and Docker Compose

Plausible Analytics uses Docker to run and manage the containerized application. Therefore, you need to install Docker and Docker Compose on your system.

To install Docker, run the following command:

sudo apt install docker.io

After installing Docker, install Docker Compose using the following commands:

sudo apt install curl
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Step 3: Create a Plausible Directory

Next, create a plausible directory to store the plausible configuration files.

sudo mkdir /opt/plausible

Step 4: Get Plausible Docker Compose Configuration File

Plausible Analytics provides a docker-compose configuration file to quickly deploy the complete environment. You can clone it using the following command:

sudo git clone https://github.com/plausible/docker-compose.git /opt/plausible

Step 5: Customize Plausible Configuration

You can customize the Plausible configuration by editing the .env file located at /opt/plausible/.env. Use any text editor of your choice to modify the configuration. If you want to use the default configuration, then you can skip this step.

Here is the default plausible configuration which is taken from .env file:

#PLAUSIBLE_DOMAIN=example.com
PLAUSIBLE_DATA_DIR=/opt/plausible/data
PLAUSIBLE_POSTGRES_USER=plausible
PLAUSIBLE_POSTGRES_PASSWORD=plausible
PLAUSIBLE_POSTGRES_DB=plausible
PLAUSIBLE_APP_SECRET=changeme
PLAUSIBLE_API_SECRET=changeme

You can edit the PLASAUBLE_DOMAIN variable to use your domain name.

Step 6: Start Plausible Analytics

You can start Plausible Analytics using the following command:

cd /opt/plausible
sudo docker-compose up -d

This command will start the Plausible Analytics container in the background. Wait for a few minutes to allow the container to start up and initialize the setup.

Step 7: Access Plausible Analytics Dashboard

Once the container is up and running, access the Plausible Analytics dashboard by visiting your domain name or IP address in your web browser:

https://yourdomain.com

You will be prompted to enter the email address, password, and site name during the initial setup.

Congratulations! You have successfully installed Plausible Analytics on Debian Latest.

Conclusion

In this tutorial, you have learned how to install Plausible Analytics on Debian Latest using Docker and Docker Compose. You can now enjoy privacy-friendly analytics reports for your website or blog.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!