How to Install Plausible (Web Analytics Tool) on Ubuntu
Quickloss3
Update Server: apt update && apt upgrade -y
Set Hostname: hostnamectl set-hostname ex.example.com
Install Docker:
sudo apt-get install
ca-certificates
curl
gnupg
lsb-release
sudo mkdir -p /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
I'm replacing angled bracket with square bracket
echo
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list ] /dev/null
sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose
Installing Plausible Analytics: cd /opt sudo git clone https://github.com/plausible/hosting plausible cd plausible openssl rand 64 | base64 -w 0 ; echo sudo nano plausible-conf.env replace ADMIN_USER_EMAIL=email ADMIN_USER_NAME=admin ADMIN_USER_PWD=password BASE_URL=https://plausible.ca-mobilealertcenter.info SECRET_KEY_BASE=replace_with_above_output
sudo nano docker-compose.yml update ports: - 127.0.0.1:8000:8000
sudo docker-compose up --detach
Installing Nginx: sudo apt update sudo apt install nginx sudo ufw allow "Nginx Full" sudo nano /etc/nginx/sites-available/plausible.conf paste server { listen 80; listen [::]:80; server_name ex.example.com;
access_log /var/log/nginx/plausible.access.log;
error_log /var/log/nginx/plausible.error.log;
location / {
proxy_pass http://localhost:8000;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
} }
sudo ln -s /etc/nginx/sites-available/plausible.conf /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl reload nginx
Access UI: http://ex.example.com ... https://www.youtube.com/watch?v=xhJJ8mU8a-M
27158131 Bytes