TOWERBY CETMIX
← Hangar / jet_template_plausible_docker

Plausible Community Edition Analytics with PostgreSQL and ClickHouse

Deploy self-hosted Plausible web analytics with dedicated databases on shared services and HTTPS through Traefik.

↓ Download↓ 1 download

Summary

Category
Jet Templates
Tags
MonitoringWeb
Authors
Cetmix OÜ
License
AGPL-3
Version
1.0.0
Call sign
jet_template_plausible_docker

This snippet imports the Plausible CE Jet Template, defaulting to ghcr.io/plausible/community-edition:v3.2.1. Each Jet runs one Plausible container with a persistent application volume. It uses a dedicated PostgreSQL database for application data and a dedicated ClickHouse database for analytics events. Traefik routes HTTPS to Plausible's internal port 8000 by default. The YAML includes the Traefik 3, PostgreSQL 17, ClickHouse 24.12, Docker, Fail2ban and Tower Core dependency templates.

Configure and launch

  1. Import the YAML and install the Plausible template on the target server. Set the shared PostgreSQL Jet's postgres_password in Tower Keys and Secrets. Plausible validates that the password uses only letters, digits, ., _, ~ and - because it is embedded in the database URL. ClickHouse Build and Plausible Prepare generate missing server-scoped clickhouse_password and plausible_secret_key_base values, respectively.
  2. Set plausible_admin_email and optionally plausible_admin_password. Prepare generates a password in the Jet variables if one is absent. Set the Jet URL or web_domain, configure Traefik's instance_certbot_email, and ensure the hostname resolves to the server. For automatic Cloudflare DNS registration, set cloudflare_token and cloudflare_zone_id. For a Traefik DNS challenge, set the selected provider's credentials (cloudflare_token, digitalocean_api_token, hetzner_api_token, or aws_dns_key_id and aws_dns_access_key).
  3. Create a Jet targeting Running. Prepare resolves the linked database Jets and sets the database names. Build starts Plausible long enough to create and migrate the databases and bootstrap an administrator if there are no users. The rendered administrator creation command includes the password in Tower's command log. Public registration is disabled by default. Sign in at the Jet URL, add a site and install the tracking snippet shown for that site.

Configure optional services

  • For invitations, password resets, reports and alerts, configure the mail sender and SMTP settings. If using SMTP authentication, set plausible_smtp_password. To discard email intentionally, set MAILER_ADAPTER=Bamboo.LocalAdapter in plausible_extra_env.
  • MaxMind geolocation uses plausible_use_maxmind and plausible_maxmind_license_key. The Google integration uses plausible_google_client_id and plausible_google_client_secret.
  • For S3 backups on the bundled PostgreSQL Jet, configure its pgBackRest repository and supply aws_key_id and aws_access_key.

Operate and troubleshoot

Use Rebuild to apply container settings or a new plausible_version. Plausible runs database migrations when the container starts. Remove removes the container and preserves the databases and volume. Destroy drops both Plausible databases, removes the Jet volume, and removes the managed Cloudflare record when applicable.

For startup failures, check Plausible logs, the Flight Plan output and connectivity to PostgreSQL and ClickHouse. For HTTPS issues, check DNS and Traefik logs. When migrating a site from Plausible Cloud, replace its tracking snippet with the one from the new instance and import its history using the site's CSV import.