Plausible Analytics Β· deploy guide
Self-host Plausible Analytics Community Edition on a VPS
Install Plausible Community Edition (privacy-friendly web analytics) on a bashrack VPS with Docker Compose and automatic HTTPS.
about 20 minutes of hands-on time
Who it's for
Site owners who want cookie-free analytics with the data on their own server.
You'll need
- An Ubuntu or Debian VPS with your SSH key
- A domain, e.g. stats.example.com, with an A record to the VPS IP
Steps
step 1
Open only SSH and HTTPS
Enable the firewall before exposing anything. Port 80 is needed for the certificate challenge and the redirect to HTTPS.
bashsudo apt-get update && sudo apt-get install -y ufw sudo ufw allow 22/tcp sudo ufw allow 80/tcp sudo ufw allow 443/tcp sudo ufw --force enablestep 2
Install Docker
Log in to the VPS as your sudo user and install Docker Engine with the official convenience script, then allow your user to run it.
bashcurl -fsSL https://get.docker.com | sudo sh sudo usermod -aG docker "$USER" newgrp docker docker compose versionstep 3
Get the Community Edition files
Clone the official repository. Its README names the current release branch β check it out so you run a released version.
bashgit clone https://github.com/plausible/community-edition plausible-ce cd plausible-ce git branch -r # pick the latest release branch from the README, then: # git checkout <release-branch>step 4
Configure the base URL and secret
Create the .env file with your domain and a random secret, and let Plausible serve HTTPS itself on ports 80/443.
bashtouch .env echo "BASE_URL=https://stats.example.com" >> .env echo "SECRET_KEY_BASE=$(openssl rand -base64 48)" >> .env echo "HTTP_PORT=80" >> .env echo "HTTPS_PORT=443" >> .env cat > compose.override.yml <<'EOF' services: plausible: ports: - 80:80 - 443:443 EOFstep 5
Start it
Start the stack, wait for the certificate, then open your domain and register the first (admin) account.
bashdocker compose up -d docker compose logs -f plausible
Security and upkeep
- Register the admin account right away; registration can then be restricted in the configuration.
- Back up the Docker volumes (PostgreSQL and ClickHouse data) regularly, e.g. with VPS automated backups where available.
- Upgrade by following the release notes for the next release branch.