Self-host guide

How to Self-Host Plausible Analytics on a VPS

Run Plausible Community Edition on Ubuntu 24.04 with Docker Compose: .env setup, built-in Let's Encrypt on a dedicated IPv4, backups and upgrades.

Plausible Analytics is lightweight, cookie-free web analytics that shows visitors, sources, pages and goals on one dashboard. Plausible Community Edition (CE) is the self-hosted release. This guide installs it by hand on Ubuntu 24.04 with the Docker Compose setup from the CE repository: Plausible itself, PostgreSQL for accounts and settings, and ClickHouse for event data. Plausible then gets its own Let's Encrypt certificate, with no separate reverse proxy.

Prefer one click? Deploy Plausible from the VeloxaHost marketplace and skip the manual steps; this guide is for when you want to run every command yourself.

What you need

  • A server running Ubuntu 24.04 LTS with root access. You can use SSH or the browser terminal on the server's page.
  • A domain or subdomain for the dashboard, such as plausible.example.com.
  • A dedicated IPv4 address. Plausible's built-in Let's Encrypt support needs ports 80 and 443, and those are not available on VeloxaHost's shared IPv4 address. A dedicated IPv4 is a paid add-on: choose it under "Network access" when you create the server, or take one later from the IP addresses page and attach it. The console shows the current price. If none is free in the region, the request is refused.

The CE README asks for a CPU with SSE 4.2 (required by ClickHouse) and recommends at least 2 GB of RAM "for running ClickHouse and Plausible without fear of OOMs". You can check the CPU flag with grep -m1 -o sse4_2 /proc/cpuinfo. A Veloxa 1 (1 vCPU, 2 GB RAM, 50 GB disk) at $8 a month, billed at $0.02 an hour and capped at the monthly price, meets that minimum. For headroom, a Veloxa 2 (2 vCPU, 4 GB RAM, 80 GB disk) at $15 a month, billed at $0.03 an hour and capped at the monthly price, is the better fit. Disk use grows with traffic, since every pageview is stored.

Install Plausible

  1. Install Docker Engine and the Compose plugin from Docker's apt repository.

    # Add Docker's official GPG key:
    sudo apt update
    sudo apt install ca-certificates curl
    sudo install -m 0755 -d /etc/apt/keyrings
    sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
    sudo chmod a+r /etc/apt/keyrings/docker.asc
    
    # Add the repository to Apt sources:
    sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
    Types: deb
    URIs: https://download.docker.com/linux/ubuntu
    Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
    Components: stable
    Architectures: $(dpkg --print-architecture)
    Signed-By: /etc/apt/keyrings/docker.asc
    EOF
    
    sudo apt update
    sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    sudo docker run hello-world
    
  2. Make the server answer on its dedicated IPv4 address. Add it to the interface now, and to the network configuration so it survives a reboot. Then point an A record for plausible.example.com at it.

    ip addr add 198.51.100.5/32 dev eth0
    
  3. Clone the current release tag of the CE repository, as the README does. At the time of writing that is v3.2.1; the README always shows the current one.

    git clone -b v3.2.1 --single-branch https://github.com/plausible/community-edition plausible-ce
    cd plausible-ce
    
  4. Create .env with the two required settings. BASE_URL must be the real domain, because links and the tracking script are built from it, and the domain must resolve to the server for the certificate. SECRET_KEY_BASE must be at least 64 bytes; the command below produces that.

    touch .env
    echo "BASE_URL=https://plausible.example.com" >> .env
    echo "SECRET_KEY_BASE=$(openssl rand -base64 48)" >> .env
    
  5. Set the web ports and publish them with a compose.override.yml. With HTTP_PORT=80 and HTTPS_PORT=443, Plausible issues and renews Let's Encrypt certificates itself. The override file is not tracked by Git, so upgrades will not conflict with it.

    echo "HTTP_PORT=80" >> .env
    echo "HTTPS_PORT=443" >> .env
    
    cat > compose.override.yml << EOF
    services:
        plausible:
            ports:
                - 80:80
                - 443:443
    EOF
    
  6. Start the stack and watch the logs until Plausible is up. The pinned images are ghcr.io/plausible/community-edition:v3.2.1, postgres:16-alpine and clickhouse/clickhouse-server:24.12-alpine.

    docker compose up -d
    docker compose logs -f plausible
    

First login

Open https://plausible.example.com and create the first user, as the README says. Then add your first website. Plausible shows the snippet while you add a site; for an existing site, open its Settings, then General, and under Tracking click Review next to Site installation. Place the snippet inside the <head> of your pages.

The script must load over HTTPS if your site uses HTTPS. Browsers block scripts fetched over plain HTTP on an HTTPS page as mixed content, so a dashboard on http:// would record nothing from those sites. The domain setup above avoids that.

You could reach Plausible through a forwarded port on the shared address, or through an SSH tunnel, to try it out. Neither suits tracking real HTTPS sites unless you serve HTTPS on that port with a DNS-challenge certificate.

Secure it

VeloxaHost firewalls are network-level and stateful. Until you attach one, all traffic is allowed; once attached, inbound traffic no rule allows is dropped. Go to Firewalls, New Firewall, Add Rule, then attach it on the server's page:

  • Allow TCP 80 and 443 from 0.0.0.0/0. Visitors' browsers send events to port 443, and Let's Encrypt needs to reach the server.
  • Allow TCP 22 only from YOUR.IP/32.

Docker's docs warn that ports published by Docker bypass ufw rules, so rely on the VeloxaHost firewall.

Next, lock down sign-ups. The configuration wiki says DISABLE_REGISTRATION defaults to invite_only, so only invited users can register. After you have your own account, set it to true for full restriction and apply it.

echo "DISABLE_REGISTRATION=true" >> .env
docker compose up -d

Set up email so password resets and reports reach you. Outbound port 25 is blocked on VeloxaHost by default, and without SMTP_HOST_ADDR Plausible tries to send directly, which needs port 25. Use your provider's relay on 587, the default SMTP_HOST_PORT. For port 465, also set SMTP_HOST_SSL_ENABLED=true.

cat >> .env << EOF
MAILER_EMAIL=plausible@example.com
SMTP_HOST_ADDR=smtp.example.com
SMTP_HOST_PORT=587
SMTP_USER_NAME=your-smtp-user
SMTP_USER_PWD=your-smtp-password
EOF
docker compose up -d

Back it up

Data lives in Docker volumes: db-data (PostgreSQL), event-data (ClickHouse), event-logs and plausible-data. Compose prefixes them with the project name, such as plausible-ce_db-data; docker volume ls lists them. Keep .env and compose.override.yml too, since SECRET_KEY_BASE is in there.

The CE wiki has no dedicated backup page. Its PostgreSQL upgrade guide dumps the database like this, which also works as a backup:

docker compose exec plausible_db sh -c "pg_dump -U postgres plausible_db > plausible_db.bak"
docker compose cp plausible_db:plausible_db.bak plausible_db.bak

There is no documented ClickHouse dump for CE, so back up the volumes with the whole disk. For a consistent copy, run docker compose stop, take a snapshot, then docker compose up -d.

Snapshots are instant and free up to your plan's limit (5 on Starter, 30 on Pay as you go) and are stored in the same region. Create one under Snapshots on the server page, or schedule them every hour, 6 hours, 12 hours, daily or weekly, kept 1 to 30 days. Restoring overwrites the server's current state. The Backups page schedules server backups (every 6 hours up to weekly, keeping 1 to 10); download one now and then for an off-site copy.

Update it

Take a snapshot first. Each Plausible release has notes on upgrading from the previous version, so read them before you start. For a minor or patch release, the upgrade wiki's steps are:

cd plausible-ce
git pull origin <new-release-tag>
docker compose up -d
docker images --filter=reference='*plausible*'
docker rmi <image_id>

Major versions may need extra steps such as data migrations. Go through the release notes of each major version between yours and the target, in order. The wiki has a separate guide for upgrading PostgreSQL between major versions.

Troubleshooting

No certificate. Check that the A record points at the dedicated IPv4, that ports 80 and 443 are open in the firewall, and that BASE_URL matches the domain. Look at docker compose logs plausible.

ClickHouse will not start or restarts. Run docker compose logs plausible_events_db. Confirm the CPU has SSE 4.2 and the server has at least 2 GB of RAM.

Plausible exits at startup. Make sure BASE_URL and SECRET_KEY_BASE are both set and the secret is at least 64 bytes.

No pageviews. Check that the snippet loads from your BASE_URL over HTTPS and look for mixed content errors in the browser console.

No emails. Set SMTP_HOST_ADDR and use port 587 or 465, since outbound port 25 is blocked.

FAQ

Do I need a reverse proxy?

No. The wiki says CE handles HTTPS and automatic Let's Encrypt certificates itself since version 2.1.2. A proxy is only needed if something else must share ports 80 and 443.

Why does Plausible need a dedicated IPv4 address on VeloxaHost?

The built-in certificate issuing runs on ports 80 and 443, and the shared IPv4 address offers only a block of high ports. A dedicated IPv4, a paid add-on, gives the server its own 80 and 443.

How should I pin the version?

The upgrade wiki recommends pinning a patch version, which is what the release's compose.yml does, for example ghcr.io/plausible/community-edition:v3.2.1. Fixes are not backported, so keep upgrading.

What license is Plausible under?

Plausible Analytics is released under the AGPL-3.0 license. Plausible's self-hosting page says CE is a long-term release published twice a year.

Which VeloxaHost size fits Plausible?

A Veloxa 2 (2 vCPU, 4 GB RAM, 80 GB disk) at $15 a month, billed at $0.03 an hour and capped at the monthly price, gives ClickHouse room. A Veloxa 1 with 2 GB of RAM meets the README's minimum for small sites.

Commands and settings checked on 2026-10-18 against the official documentation: github.com, plausible.io, developer.mozilla.org, docs.docker.com. Software changes; if a step no longer matches, the vendor's docs win.

Ready to deploy?

Start a free trial, or compare plans to match your team's scale.