A Terraform module to provision the self-hosted version of Plausible Analytics on a Docker Swarm cluster with the Traefik ingress controller. A great way to quickly deploy Plausible for development/testing or 'low traffic' sites.
- Requires Terraform 1.2.0 or higher.
- Traefik ingress controller, see: colinwilson/terraform-docker-traefik-v2 (or any other ingress controller e.g. nginx)
Basic usage of this module is as follows:
module "plausible_docker" {
source = "github.com/colinwilson/terraform-docker-plausible"
hostname = "plausible.example.com"
base_url = "https://plausible.example.com"
networks = ["traefik"] # name of your Traefik Network
}
Example output:
connected_networks = [
"traefik",
]
options_status = {
"external_pg_enabled" = false
"maxmind_enabled" = false
"smtp_enabled" = false
}
Setup DNS records pointing your domain to your ingress and navigate to your hostname
e.g. https://plausible.example.com
You'll be presented with a registration page to create the admin/owner account.
Name | Description | Type | Default | Required |
---|---|---|---|---|
base_url | Plausible base URL | string |
"http://localhost" |
no |
clickhouse_container_name | ClickHouse Container name. | string |
"plausible_event_db" |
no |
clickhouse_db_name | ClickHouse Database name. | string |
"plausible" |
no |
clickhouse_version | ClickHouse image version. | string |
"22.6-alpine" |
no |
disable_registration | Disables registration of new users. Valid options are true, false & invite_only | string |
"invite_only" |
no |
ext_postgres_creds | Postgres database credentials. | object({ |
{} |
no |
geoip_creds | MaxMind credentials. | object({ |
{ |
no |
geoip_db | Set which MaxMind Database Plausible will utilise? | string |
"GeoLite2-City" |
no |
geoip_version | MaxMind GeoIP Update Tool image version. | string |
"v5.1.1" |
no |
google_api_creds | Google API Console credentials. | object({ |
{ |
no |
hcaptcha_creds | hCaptcha credentials. | object({ |
{ |
no |
hostname | Plausible hostname | string |
"localhost" |
no |
log_level | Log level | string |
"warn" |
no |
networks | Set of existing networks to connect Plausible to. | set(string) |
[] |
no |
plausible_version | Plausible Analytics image version. | string |
"v2.0.0" |
no |
postgres_container_name | Postgres container name | string |
"plausible_db" |
no |
postgres_version | PostgreSQL image version. | string |
"14-alpine" |
no |
reduce_event_logging | Reduce the level of query logging in ClickHouse? | bool |
true |
no |
smtp_creds | SMTP Credentials | object({ |
{ |
no |
Name | Description |
---|---|
connected_networks | List of existing networks the Plausible service is connected to. |
options_status | Brief summary of which options are enabled? |