How To Install Plausible Analytics on Ubuntu 22.04

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

Plausible Analytics is an open-source, self-hosted web analytics application written in Elixir that focuses on privacy and mainly simplicity. You can track your website visitors and get valuable statistics that help to improve the user’s experience. It stores data in ClickHouse and PostreSQL Databases.

Requirements :

  • 2-4GB of RAM (Recommended on the website)
  • 2-4 vCore CPU (The more the better performance)
  • Ubuntu 22.04

Step 1 : Update your server

First step is to update your server which will look for newer packages and security releases for your distribution :

apt-get update -y
apt-get upgrade -y

Step 2 : Install Docker

In this step we will be installing Docker, As the Plausible Analytics repository is based on Docker. Run the following commands to install :

apt install apt-transport-https ca-certificates curl software-properties-common

We will be adding the GPG key for Docker Repository :

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –

add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable”
apt-cache policy docker-ce

Now, We can install Docker by running the following command :

apt install docker-ce

Step 3 : Install Docker Compose

In this step, We will be installing Docker Compose, Run the following command to install :

curl -L https://github.com/docker/compose/releases/download/v2.7.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose

Giving the file executable permission :

chmod +x /usr/local/bin/docker-compose

We can confirm the installation through the following command :

docker-compose –version

Step 4 : Install Plausible Analytics

We can now use Git to clone the Plausible Analytics Git Repository which includes all the configuration files required for self-hosting this application. Run the following command to continue the installation :

cd /opt
git clone https://github.com/plausible/hosting

cd hosting

We will be now generating a 64-character secret key :

openssl rand -base64 64

Now, We will be editing the configuration file and edit the following lines :

ADMIN_USER_EMAIL= EmailGoesHGere
ADMIN_USER_NAME=Admin_Username_Here
ADMIN_USER_PWD=Admin_Password_Here
BASE_URL=Domain_Name_here
SECRET_KEY_BASE=Paste_Secret_Key_Here

Now, We can run the docker container :

docker-compose up –detach

After this download, Your Plausible Analytics will be accessible at your IP Address http://yourip:8000

Conclusion :

You have installed Plausible Analytics on your Ubuntu 22.04. This tutorial assumes you are root!

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"
sAmI
sAmIhttps://losersgaming.com
I'm a freelancer and a semi-professional VALORANT Player from Pakistan, Expert in Network & System Administration & WordPress Developing.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook