plausible / community-edition Goto Github PK
View Code? Open in Web Editor NEWExample Docker Compose setup for hosting Plausible Community Edition
Example Docker Compose setup for hosting Plausible Community Edition
Leaving this here in case anyone stumbles across this issue. I was able to successfully self-host plausible on an arm64 based Oracle Compute Instance by modifying the docker-compose.
More information on the Discussion plausible/analytics#903 (comment)
In the docker-compose just replace:
bytemark/smtp
with navanchauhan/smtp
(I built a multi-arch version of the original docker file)plausible/analytics
with justsky/analytics
(They built and pushed a multi-arch version, will not be required if plausible officially starts supporting multi-arch builds)yandex/clickhouse-server:21.3.2.5
with clickhouse/clickhouse-server:22.4.2.1
I did not open a PR because it will be only useful after plausible starts publishing official multi-arch images. plausible/analytics#1287 A simple edit in the GitHub Actions workflow will allow for that
Thanks for the nice work with Plausible! We really like the clean approach.
We are trying to use the hosted version of Plausible but ran into a few issues. Setup itself was relatively easy with Docker, but integrating it with our website caused some issues. I'm breaking these down into seperate issues.
We have several issues with the plausible.js
script.
http://ourserver/js/plausible.js
. This didn't work because the BASE_URL
wasn't respected in the script, it was hardcoded to localhost
.http://ourserver/js/index.js
. This doesn't exist at all.plausible/docs#115 although it probably won't be required once we move to the new SMTP client.
Hey there,
thanks for this great example repo.
I used this as the basis for our self-hosted Plausible installation and it works like a treat.
I encountered one problem with the custom subdomains though.
When calling the "custom." subdomain I always receive SSL Errors.
This is the output of a Curl request to the "custom." subdomain:
* Connected to custom.plausible.domain (Plausible IP) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS alert, internal error (592):
* error:14004438:SSL routines:CONNECT_CR_SRVR_HELLO:tlsv1 alert internal error
* Closing connection 0
curl: (35) error:14004438:SSL routines:CONNECT_CR_SRVR_HELLO:tlsv1 alert internal error
EDIT: I am using the provided Caddy reverse proxy.
Going to track progress with this one. Here're the TODOs left.
upgrades/postgres.md
(naming is hard, suggestions are welcome) with the steps to upgrade postgres instances (more info in the PR above).🙋♂️ Why not put it in the release notes on https://github.com/plausible/analytics/releases?
👩🏫 Because this guide is unlikely to change from release to release and we can link to that document on each update.
Thanks for the nice work with Plausible! We really like the clean approach.
We are trying to use the hosted version of Plausible but ran into a few issues. Setup itself was relatively easy with Docker, but integrating it with our website caused some issues. I'm breaking these down into seperate issues.
Following the documentation here: https://docs.plausible.io/custom-event-goals/
we set up event tracking and the events show up ok in the analytics UI. However, all props seem to get lost in the process. I looked at the tracking request itself and saw that the JS didn't even include the props
object! I then looked at the snippet you are using on plausible.io and saw that there are substantial differences. Adapting your plausible.io script to my local installation was easy and now the props object is sent to the server (as well as referers, btw., that also didnt work before).
The events are shown on the analytics page, but there is no way to drill down like you show in your documentation. Is there some switch that i have to turn for this to work?
Relevant:
Plausible Self Hosted : Docker
Docker Version : Docker version 20.10.21, build baeda1f
Host informations : 5.4.0-97-generic #110-Ubuntu SMP Thu Jan 13 18:22:13 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Compose version : 3.3
Docker tag : latest
Error :
ERROR! Config provider Config.Reader failed with:
** (Jason.DecodeError) unexpected byte at position 38: 0x70 ("p")
lib/jason.ex:92: Jason.decode!/2
(stdlib 3.17.1) erl_eval.erl:685: :erl_eval.do_apply/6
(stdlib 3.17.1) erl_eval.erl:446: :erl_eval.expr/5
(elixir 1.13.4) src/elixir.erl:296: :elixir.recur_eval/3
(elixir 1.13.4) src/elixir.erl:274: :elixir.eval_forms/3
(elixir 1.13.4) lib/code.ex:404: Code.validated_eval_string/3
(elixir 1.13.4) lib/config.ex:260: Config.__eval__!/3
(elixir 1.13.4) lib/config/reader.ex:92: Config.Reader.read!/2
I use watchtower to auto pull and recreate, but i don't see any tags on the Docker Hub for plausible.
Hi!
I want to know if an ARM image is available? Compatible with the Raspberry Pi for exemple. It can be great ! But I don't know if dependencies are available for this architecture.
Matomo do (because the main dependencies is PHP). But with so many data I don't Care about.
Thanks and happy new year.
Relevant:
I've seen the latest change committed and merged in a735885 from #16, which is in my opinion a breaking-change and a bad decision:
- image: postgres:12
+ image: postgres:latest # or 13
Based on the commit, the description was:
By switching to the latest or 13 version, the plausible_db container will no more complain
about the wrong postgres version and shut down. This resolved my error, when i
implemented this docker-compose into my own docker-compose.
I don't understand the reasoning. Specially this commit introduces three negative problematic aspects:
All three are breaking changes, rendering the whole setup unstable, unreliable and unpredictable.
I've just merged the suggested change into my config, and then Postgres did not want to start:
$ docker-compose logs -f plausible_db
Attaching to plausible_plausible_db_1
plausible_db_1 |
plausible_db_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
plausible_db_1 |
plausible_db_1 | 2020-12-05 16:27:42.359 UTC [1] FATAL: database files are incompatible with server
plausible_db_1 | 2020-12-05 16:27:42.359 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 12, which is not compatible with this version 13.1 (Debian 13.1-1.pgdg100+1).
tl;dr: Using postgres:latest
is a terrible idea and makes the plausible stack unpredictable. It does seem introduce the issue the author seems wanted to fix actually? (Also, why was this commit even merged?)
Please do not submit issues here. Best place for self-hosting issues, questions and ideas is the community forum here on GitHub. Thanks!
Repository name community-edition is not stand Alone. I need to perform mkdir plausible before cloning this
I'm trying to setup plausible to send weekly and monthly reports. I added the relevant variables but I don't receive the emails.
I couldn't find any way to send an email immediately, and I don't really want to wait 1 week between retries 😊
Here's my conf:
MAILER_EMAIL=[email protected]
SMTP_HOST_ADDR=smtp.mailgun.org
SMTP_HOST_PORT=465
SMTP_USER_NAME=[email protected]
SMTP_USER_PWD=supersecurepassword
SMTP_HOST_SSL_ENABLED=true
SMTP_RETRIES=2
I am following the documentation here, but when I enter:
sudo certbot --nginx
and select the virtual host, I get this error:
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for plausible.laravelista.com
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. plausible.laravelista.com (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://plausible.laravelista.com/.well-known/acme-challenge/RIILIq6-u-mzcqo7mT8hDesS-VfPn1O1-obtFGt7ijI [2a03:b0c0:3:e0::476:7001]: "<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.16.1</ce"
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: plausible.laravelista.com
Type: unauthorized
Detail: Invalid response from
http://plausible.laravelista.com/.well-known/acme-challenge/RIILIq6-u-mzcqo7mT8hDesS-VfPn1O1-obtFGt7ijI
[2a03:b0c0:3:e0::476:7001]: "<html>\r\n<head><title>404 Not
Found</title></head>\r\n<body>\r\n<center><h1>404 Not
Found</h1></center>\r\n<hr><center>nginx/1.16.1</ce"
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
For some reason certbot is not getting the response from plausible container, but from my local nginx. When I try manually visiting the URL in browser I get the 404 response from plausible container.
Am I missing some options in the nginx virtual host config?
plausible.cnf
server {
server_name plausible.laravelista.com;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
This issue is used to track the next self-hosted release.
Hey,
I tried to spin up the docker environment and im having the following error which I cannot resolve. It seems that the plausible_events_db container is not reachable.
Loading plausible..
Starting dependencies..
Starting repos..
create Plausible.Repo database if it doesn't exist
create Plausible.ClickhouseRepo database if it doesn't exist
13:47:45.948 [error] Clickhousex.Protocol (#PID<0.244.0>) failed to connect: ** (ErlangError) Erlang error: :econnrefused
13:47:45.948 [error] Clickhousex.Protocol (#PID<0.245.0>) failed to connect: ** (ErlangError) Erlang error: :econnrefused
13:47:45.962 [error] GenServer #PID<0.265.0> terminating
** (UndefinedFunctionError) function :econnrefused.exception/1 is undefined (module :econnrefused is not available)
:econnrefused.exception([])
(db_connection 2.2.2) lib/db_connection/connection.ex:87: DBConnection.Connection.connect/2
(connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
(stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: nil
[... repeat former block * 4]
** (MatchError) no match of right hand side value: {:error, "killed"}
(plausible 0.0.1) lib/plausible_release.ex:56: anonymous fn/2 in Plausible.Release.createdb/0
(elixir 1.10.3) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
(plausible 0.0.1) lib/plausible_release.ex:55: Plausible.Release.createdb/0
(stdlib 3.12.1) erl_eval.erl:680: :erl_eval.do_apply/6
(elixir 1.10.3) lib/code.ex:341: Code.eval_string_with_error_handling/3
In the beginning the server couldn't even bind to the requested IPv6 address. So I instructed it to bind on IPv4 in two ways like this in clickhouse-config.xml
<yandex>
...
<listen_host>127.0.0.1</listen_host> // <listen_host>0.0.0.0</listen_host>
...
</yandex>
Due to the sparse log of where it tried to connect I set the upstream manually like this in plausible-conf.env
. Still no luck.
CLICKHOUSE_DATABASE_URL=http://plausible_events_db:8123/plausible_events_db
Either document or configure ERL_MAX_PORTS
env var
I'm having trouble getting IP geolocation to work. I've done a bit of debugging, and found that the geoip volume isn't mounted to the plausible container by default (as has someone else, it seems #7). After fixing this however, it still doesn't appear to work - no data is shown on the map, nor is there a tooltip when hovering.
So far I've tried:
geoip/docker-compose.geoip.yml
so the geoip volume is mounted at /geoip
for the plausible service.index 239577c..04ebf28 100644
--- a/geoip/docker-compose.geoip.yml
+++ b/geoip/docker-compose.geoip.yml
@@ -3,6 +3,8 @@ services:
plausible:
depends_on:
- geoip
+ volumes:
+ - geoip:/geoip:ro
environment:
- GEOLITE2_COUNTRY_DB=/geoip/GeoLite2-Country.mmdb
Then reload using docker-compose -f docker-compose.yml -f geoip/docker-compose.geoip.yml up -d
.
$ docker exec -it plausible_plausible_1 /bin/bash
# ls -l /geoip/
total 3836
-rw-r--r-- 1 root root 3926614 Oct 28 00:13 GeoLite2-Country.mmdb
# echo $GEOLITE2_COUNTRY_DB
/geoip/GeoLite2-Country.mmdb
$ docker-compose -f docker-compose.yml -f geoip/docker-compose.geoip.yml down -v
Stopping plausible_plausible_1 ... done
Stopping plausible_plausible_events_db_1 ... done
Stopping plausible_mail_1 ... done
Stopping plausible_plausible_db_1 ... done
Stopping plausible_geoip_1 ... done
Removing plausible_plausible_1 ... done
Removing plausible_plausible_events_db_1 ... done
Removing plausible_mail_1 ... done
Removing plausible_plausible_db_1 ... done
Removing plausible_geoip_1 ... done
Removing network plausible_default
Removing volume plausible_db-data
Removing volume plausible_event-data
Removing volume plausible_geoip
$ docker-compose -f docker-compose.yml -f geoip/docker-compose.geoip.yml up -d
Creating network "plausible_default" with the default driver
Creating volume "plausible_db-data" with local driver
Creating volume "plausible_event-data" with local driver
Creating volume "plausible_geoip" with local driver
Creating plausible_plausible_db_1 ... done
Creating plausible_mail_1 ... done
Creating plausible_geoip_1 ... done
Creating plausible_plausible_events_db_1 ... done
Creating plausible_plausible_1 ... done
$ docker logs plausible_plausible_1
Loading plausible..
Starting dependencies..
Starting repos..
create Plausible.Repo database if it doesn't exist
00:55:06.992 [error] Postgrex.Protocol (#PID<0.238.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "plausible_db" does not exist
00:55:06.992 [error] Postgrex.Protocol (#PID<0.237.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name) database "plausible_db" does not exist
00:55:07.126 [error] Clickhousex.Protocol (#PID<0.244.0>) failed to connect: ** (ErlangError) Erlang error: "Code: 81, e.displayText() = DB::Exception: Database plausible_events_db doesn't exist (version 20.10.2.20 (official build))\n"
00:55:07.126 [error] Clickhousex.Protocol (#PID<0.245.0>) failed to connect: ** (ErlangError) Erlang error: "Code: 81, e.displayText() = DB::Exception: Database plausible_events_db doesn't exist (version 20.10.2.20 (official build))\n"
create Plausible.ClickhouseRepo database if it doesn't exist
Creation of Db successful!
Loading plausible..
Starting dependencies..
Starting repos..
Running migrations for Elixir.Plausible.Repo
Running migrations for Elixir.Plausible.ClickhouseRepo
Migrations successful!
Loading plausible..
Starting dependencies..
Starting repos..
Admin user created successful!
01:07:01.181 [error] Task #PID<0.4448.0> started from #PID<0.4449.0> terminating
** (CaseClauseError) no case clause matching: []
(hackney 1.15.2) /app/deps/hackney/src/hackney_url.erl:224: :hackney_url.parse_netloc/2
(hackney 1.15.2) /app/deps/hackney/src/hackney.erl:349: :hackney.request/5
(httpoison 1.6.2) lib/httpoison/base.ex:796: HTTPoison.Base.request/6
(httpoison 1.6.2) lib/httpoison.ex:128: HTTPoison.request!/5
(elixir 1.10.3) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
(stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: #Function<0.124948693/0 in Plausible.Slack.notify/1>
Args: []
At this point I feel like more in-depth debugging is needed. I've verified that the file exists where Plausible is told it is, yet no data is returned from the /api/stats/:domain/countries
endpoint.
Other than that, Plausible is amazing so far; major props for putting a self-hosted version out there.
Is there a build method for the s390x architecture? I tried 'docker pull --platform linux/x86_64' and after downloading, the logs showed an error: "/entrypoint.sh: exec format error."
There are several problems with the bytemark/smtp
container used for e-mail:
May I suggest switching to another Exim relay Docker image that is well maintained like devture/exim-relay
.
When doing docker-compose up on master there is an error that causes the main app docker to terminate
Attaching to hosting_plausible_db_1, hosting_plausible_events_db_1, hosting_mail_1, hosting_plausible_1
mail_1 | 1 LOG: MAIN
mail_1 | 1 exim 4.89 daemon started: pid=1, -q30m, listening for SMTP on port 25 (IPv6 and IPv4)
plausible_db_1 |
plausible_db_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
plausible_db_1 |
plausible_db_1 | 2020-12-06 17:29:53.646 UTC [1] LOG: starting PostgreSQL 13.1 (Debian 13.1-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
plausible_events_db_1 | Processing configuration file '/etc/clickhouse-server/config.xml'.
plausible_db_1 | 2020-12-06 17:29:53.698 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
plausible_db_1 | 2020-12-06 17:29:53.698 UTC [1] LOG: listening on IPv6 address "::", port 5432
plausible_db_1 | 2020-12-06 17:29:53.708 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
plausible_db_1 | 2020-12-06 17:29:53.720 UTC [25] LOG: database system was shut down at 2020-12-06 17:23:28 UTC
plausible_events_db_1 | Merging configuration file '/etc/clickhouse-server/config.d/docker_related_config.xml'.
plausible_db_1 | 2020-12-06 17:29:53.733 UTC [1] LOG: database system is ready to accept connections
plausible_events_db_1 | Include not found: clickhouse_remote_servers
plausible_events_db_1 | Include not found: clickhouse_compression
plausible_events_db_1 | Logging warning to /var/log/clickhouse-server/clickhouse-server.log
plausible_events_db_1 | Logging errors to /var/log/clickhouse-server/clickhouse-server.err.log
plausible_events_db_1 | Logging warning to console
plausible_events_db_1 | Include not found: networks
plausible_events_db_1 | 2020.12.06 17:29:53.926051 [ 1 ] {} <Warning> Application: Listen [::1]:8123 failed: Poco::Exception. Code: 1000, e.code() = 99, e.displayText() = Net Exception: Cannot assign requested address: [::1]:8123 (version 20.11.4.13 (official build)). If it is an IPv6 or IPv4 address and your host has disabled IPv6 or IPv4, then consider to specify not disabled IPv4 or IPv6 address to listen in <listen_host> element of configuration file. Example for disabled IPv6: <listen_host>0.0.0.0</listen_host> . Example for disabled IPv4: <listen_host>::</listen_host>
plausible_events_db_1 | 2020.12.06 17:29:53.926781 [ 1 ] {} <Warning> Application: Listen [::1]:9000 failed: Poco::Exception. Code: 1000, e.code() = 99, e.displayText() = Net Exception: Cannot assign requested address: [::1]:9000 (version 20.11.4.13 (official build)). If it is an IPv6 or IPv4 address and your host has disabled IPv6 or IPv4, then consider to specify not disabled IPv4 or IPv6 address to listen in <listen_host> element of configuration file. Example for disabled IPv6: <listen_host>0.0.0.0</listen_host> . Example for disabled IPv4: <listen_host>::</listen_host>
plausible_events_db_1 | 2020.12.06 17:29:53.927464 [ 1 ] {} <Warning> Application: Listen [::1]:9009 failed: Poco::Exception. Code: 1000, e.code() = 99, e.displayText() = Net Exception: Cannot assign requested address: [::1]:9009 (version 20.11.4.13 (official build)). If it is an IPv6 or IPv4 address and your host has disabled IPv6 or IPv4, then consider to specify not disabled IPv4 or IPv6 address to listen in <listen_host> element of configuration file. Example for disabled IPv6: <listen_host>0.0.0.0</listen_host> . Example for disabled IPv4: <listen_host>::</listen_host>
plausible_events_db_1 | 2020.12.06 17:29:53.928301 [ 1 ] {} <Warning> Application: Listen [::1]:9004 failed: Poco::Exception. Code: 1000, e.code() = 99, e.displayText() = Net Exception: Cannot assign requested address: [::1]:9004 (version 20.11.4.13 (official build)). If it is an IPv6 or IPv4 address and your host has disabled IPv6 or IPv4, then consider to specify not disabled IPv4 or IPv6 address to listen in <listen_host> element of configuration file. Example for disabled IPv6: <listen_host>0.0.0.0</listen_host> . Example for disabled IPv4: <listen_host>::</listen_host>
plausible_events_db_1 | Include not found: clickhouse_remote_servers
plausible_events_db_1 | Include not found: clickhouse_compression
plausible_1 | Loading plausible..
plausible_1 | Starting dependencies..
plausible_1 | Starting repos..
plausible_1 | create Plausible.Repo database if it doesn't exist
plausible_db_1 | 2020-12-06 17:30:06.347 UTC [34] ERROR: database "plausible_db" already exists
plausible_db_1 | 2020-12-06 17:30:06.347 UTC [34] STATEMENT: CREATE DATABASE "plausible_db" ENCODING 'UTF8'
plausible_1 | create Plausible.ClickhouseRepo database if it doesn't exist
plausible_1 | 17:23:12.470 [error] Clickhousex.Protocol (#PID<0.245.0>) failed to connect: ** (ErlangError) Erlang error: :econnrefused
plausible_1 | 17:23:12.470 [error] Clickhousex.Protocol (#PID<0.244.0>) failed to connect: ** (ErlangError) Erlang error: :econnrefused
plausible_1 | 17:23:12.475 [error] GenServer #PID<0.265.0> terminating
plausible_1 | ** (UndefinedFunctionError) function :econnrefused.exception/1 is undefined (module :econnrefused is not available)
plausible_1 | :econnrefused.exception([])
plausible_1 | (db_connection 2.2.2) lib/db_connection/connection.ex:87: DBConnection.Connection.connect/2
plausible_1 | (connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
plausible_1 | (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
plausible_1 | Last message: nil
plausible_1 | 17:23:12.477 [error] GenServer #PID<0.266.0> terminating
plausible_1 | ** (UndefinedFunctionError) function :econnrefused.exception/1 is undefined (module :econnrefused is not available)
plausible_1 | :econnrefused.exception([])
plausible_1 | (db_connection 2.2.2) lib/db_connection/connection.ex:87: DBConnection.Connection.connect/2
plausible_1 | (connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
plausible_1 | (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
plausible_1 | Last message: nil
plausible_1 | 17:23:12.479 [error] GenServer #PID<0.267.0> terminating
plausible_1 | ** (UndefinedFunctionError) function :econnrefused.exception/1 is undefined (module :econnrefused is not available)
plausible_1 | :econnrefused.exception([])
plausible_1 | (db_connection 2.2.2) lib/db_connection/connection.ex:87: DBConnection.Connection.connect/2
plausible_1 | (connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
plausible_1 | (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
plausible_1 | Last message: nil
plausible_1 | 17:23:12.482 [error] GenServer #PID<0.268.0> terminating
plausible_1 | ** (UndefinedFunctionError) function :econnrefused.exception/1 is undefined (module :econnrefused is not available)
plausible_1 | :econnrefused.exception([])
plausible_1 | (db_connection 2.2.2) lib/db_connection/connection.ex:87: DBConnection.Connection.connect/2
plausible_1 | (connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
plausible_1 | (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
plausible_1 | Last message: nil
plausible_1 | ** (MatchError) no match of right hand side value: {:error, "killed"}
plausible_1 | (plausible 0.0.1) lib/plausible_release.ex:56: anonymous fn/2 in Plausible.Release.createdb/0
plausible_1 | (elixir 1.10.3) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
plausible_1 | (plausible 0.0.1) lib/plausible_release.ex:55: Plausible.Release.createdb/0
plausible_1 | (stdlib 3.12.1) erl_eval.erl:680: :erl_eval.do_apply/6
plausible_1 | (elixir 1.10.3) lib/code.ex:341: Code.eval_string_with_error_handling/3
hosting_plausible_1 exited with code 1
This is no longer relevant since Docker Compose v2 doesn't delete volumes on docker compose down
but the previous behaviour should be documented just to be safe.
Relevant:
Hi.
Just for people who are on Windows Server 2019. I have made a very small fork for a working configuration https://github.com/Brouilles/hosting. Please change the volumes path with yours. You need Docker with WSL (Windows Subsystem Linux 1.0).
No volume path for postgres because crash on Windows with authorize error. It's an known issue. (So it's recommended to use Docker volumes).
It's not really an issue. Sorry if it's the bad place.
When launching the docker-compose up --detach
command on current head 09fb07e I end up with an error related to ports.
$ docker-compose up --detach
Removing hosting_plausible_1
Starting hosting_mail_1 ... done
Starting hosting_plausible_db_1 ... done
Starting hosting_plausible_events_db_1 ... done
Starting 08bc5c668828_hosting_plausible_1 ... error
ERROR: for 08bc5c668828_hosting_plausible_1 Cannot start service plausible: driver failed programming external connectivity on endpoint 08bc5c668828_hosting_plausible_1 (35456500b7f62f11d746ef8e6ff73a321e38abf7342a3904d0b83631f6f0c701): Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use
ERROR: for plausible Cannot start service plausible: driver failed programming external connectivity on endpoint 08bc5c668828_hosting_plausible_1 (35456500b7f62f11d746ef8e6ff73a321e38abf7342a3904d0b83631f6f0c701): Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use
ERROR: Encountered errors while bringing up the project.
I feared it was due to my host port 8000 being in use first (preventing the guest 80 mapping to it) but even freeing my host port 8000 didn't help.
The error code being about port 80, I assume it's an issue on guest side but I'm not knowledgeable enough in docker to figure this error out.
Thanks in advance for your help.
Please do not submit issues here. Best place for self-hosting issues, questions and ideas is the community forum here on GitHub. Thanks!
I am testing plausible and trying to integrate to my web App. Added tracker script. everything is running smooth on client side. There are no errors in docker logs. but No events are getting detected.
No Error on Client side from plausible
check for existence of my tracker scripts in browser
As script https:///js/script.js is loaded into by browser. I can see it from browser inspect -> sources
I am testing in my local web app.
I am using UI but nothing is happening in plausible. "it says Waiting for first pageview on problempulse.store"
The latest docker compose on here fails. Replacing the plausible pull with plausible/analytics:v2.0 makes it work again.
How can I use city level data from MaxMinds?
I tried this in the geoip environment:
- GEOIPUPDATE_EDITION_IDS=GeoLite2-City
And this in the plausible environment:
- GEOLITE2_COUNTRY_DB=/geoip/GeoLite2-City.mmdb
But only see country level data in my dashboard. Am I missing a configuration option? Or is this level of detail a potential new feature/enhancement?
Great job! Many thanks for this alternative platform!
Please do not submit issues here. Best place for self-hosting issues, questions and ideas is the community forum here on GitHub. Thanks!
Please do not submit issues here. Best place for self-hosting issues, questions and ideas is the community forum here on GitHub. Thanks!
Relevant: plausible/docs#465
Relevant: plausible/docs#365
The postgres database is no longer supported by postgres 14
.
I can only get my installation to boot by changing to version 12
in the docker-compose.yml file.
https://github.com/plausible/hosting/blob/master/docker-compose.yml#L9
plausible_db:
# supported versions are 12, 13, and 14
#image: postgres:14-alpine
image: postgres:12-alpine
root@analytics:~# docker logs 9186dfbb124d #postgres:14-alpine
PostgreSQL Database directory appears to contain a database; Skipping initialization
2023-04-15 15:07:35.529 UTC [1] FATAL: database files are incompatible with server
2023-04-15 15:07:35.529 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 12, which is not compatible with this version 14.5.
It seems like version 14.5 of this postres docker image has dropped backwards support for 12.
Please consider using release tags, then people can get notified when a new release is ready and update in time.
Hi,
I have buy a server on Kimsufi. But I have the following error during docker-compose up:
plausible_events_db_1 | Instruction check fail. The CPU does not support SSE4.1 instruction set.
plausible_events_db_1 | Instruction check fail. The CPU does not support SSE4.1 instruction set.
And so hosting_plausible_1
and hosting_plausible_events_db_1
exited. The CPU is an Intel Atom N2800.
Thanks.
Hi there,
I'm trying to setup emails notifications on my Plausible self-hosted.
docker-compose.yml
version: "3.3"
services:
mail:
image: bytemark/smtp
restart: always
plausible_db:
image: postgres:12
restart: always
volumes:
- db-data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=**********
plausible_events_db:
image: yandex/clickhouse-server:21.3.2.5
restart: always
volumes:
- event-data:/var/lib/clickhouse
- ./clickhouse/clickhouse-config.xml:/etc/clickhouse-server/config.d/logging.xml:ro
- ./clickhouse/clickhouse-user-config.xml:/etc/clickhouse-server/users.d/logging.xml:ro
ulimits:
nofile:
soft: 262144
hard: 262144
plausible:
image: plausible/analytics:latest
restart: always
command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh db init-admin && /entrypoint.sh run"
depends_on:
- plausible_db
- plausible_events_db
- mail
ports:
- 8000:8000
env_file:
- plausible-conf.env
plausible-conf.env
ADMIN_USER_EMAIL=**********
ADMIN_USER_NAME=**********
ADMIN_USER_PWD=**********
BASE_URL=**********
SECRET_KEY_BASE=**********
DISABLE_REGISTRATION=true
GOOGLE_CLIENT_ID=**********
GOOGLE_CLIENT_SECRET=**********
[email protected]
SMTP_HOST_ADDR=in-v3.mailjet.com
SMTP_USER_NAME=API_KEY
SMTP_USER_PWD=API_SECRET_KEY
SMTP_HOST_SSL_ENABLED=false
SMTP_RETRIES=2
Thank you !
I already have a postgresql server running so I created a database and a non-privileged user for Plausible but the app can't start with the provided docker-compose.
Here's the database url I used:
DATABASE_URL=postgres://plausible:[email protected]/plausible
Plausible complains it can't connect to the postgres
database. I guess it's using it to create the db I put in the URL, and I didn't allow the plausible user to connect to the postgres database anyway.
I tried various things such as allowing the user to connect to the postgres db, trying not to run db createdb
in the command, ...
Everything led to an error:
db createdb
: clickouse db is not set upWould it be possible to allow connections to pre-existing databases ? Like just test if the DB exists and the user can create a table and if so well, continue with the setup.
a simpler, matomo like installation process:
finished... go and integrate the js into all webs...
Relevant: plausible/docs#430
Please make use of releases, that will make it easier to track for new releases and setup Ansible to act on that. Checking out the main branch, while config files need to be changed in there, creates issues with git. A git repo cannot pull in new changes with local changes. When using releases I can receive a notification of a new release, update the variable of that release tag, run a test and deploy it. Thanks for considering.
version: "3.8"
services:
mail:
image: bytemark/smtp:latest
env_file:
- plausible-conf.env
networks:
- internal
labels:
- traefik.enable=false
plausible_db:
image: postgres:latest
volumes:
- db-data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
networks:
- internal
labels:
- traefik.enable=false
plausible_events_db:
image: yandex/clickhouse-server:21.3.2.5
volumes:
- event-data:/var/lib/clickhouse
- ./clickhouse/clickhouse-config.xml:/etc/clickhouse-server/config.d/logging.xml:ro
- ./clickhouse/clickhouse-user-config.xml:/etc/clickhouse-server/users.d/logging.xml:ro
ulimits:
nofile:
soft: 262144
hard: 262144
networks:
- internal
labels:
- traefik.enable=false
plausible:
image: plausible/analytics:latest
command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh db init-admin && /entrypoint.sh run"
depends_on:
- plausible_db
- plausible_events_db
- mail
ports:
- 8000
env_file:
- plausible-conf.env
networks:
- traefik-public
- internal
deploy:
labels:
- traefik.enable=true
- traefik.constraint-label=traefik-public
- traefik.http.routers.plausible.rule=Host(`site`)
- traefik.http.routers.plausible.entrypoints=https
- traefik.http.services.plausible.loadbalancer.server.port=8000
- traefik.http.routers.plausible.tls=true
- traefik.http.routers.plausible.tls.certresolver=le
volumes:
db-data:
driver: local
event-data:
driver: local
geoip:
driver: local
networks:
traefik-public:
external: true
internal:
external: false
2022.07.11 09:51:18.477067 [ 51 ] {} DynamicQueryHandler: Code: 81, e.displayText() = DB::Exception: Database plausible_events_db doesn't exist, Stack trace (when copying this message, always include the lines below):
Hello all,
I'm running Plausible in a Docker container and I just noticed that it's storing 47GB of data, the majority of it in the ./store
directory:
8.0K ./495
16K ./108
16K ./1b3
16K ./1eb
16K ./2b1
16K ./8db
16K ./bd3
16K ./c2f
16K ./c58
16K ./f69
20K ./403
40K ./58b
56K ./8fb
840K ./9d2
848K ./c99
36M ./fe5
88M ./38d
3.3G ./964
19G ./7a2
25G ./ee7
47G .
I'm not sure what any of these directory names signify, so I'm hesitant to delete any of them. Nevertheless, I'd like to know if there's a way to limit the amount of historical data stored? 47GB is a bit excessive for a handful of small sites, especially given the fact that I have no intention of reviewing statistics from years ago.
Thanks!
I believe the javascript snippet we get to paste before is wrong. Currently, it is this
<script defer data-domain="localhost" src="http://localhost/js/script.js"></script>
but script.js does not exist at that location, since Plausible will run on port 8000 by default.
(A spinoff of plausible/docs#331)
Hello,
I have a 4xCPU server with 8GB RAM at Digital Ocean, the site has 20-40 million pageviews per month and when I do queries with filters, for example page > contains > /url/
and 3 months ago
, the CPU usage goes at 100% on clickhouse, but it stays like that for 20 seconds and crashes.
But apparently it generates some timeout and the result is not shown on the screen.
Is there any configuration for clickhouse to force the CPU usage for a longer time, until the required query finishes?
In the env, I already configured it as:
CLICKHOUSE_FLUSH_INTERVAL_MS=5000
CLICKHOUSE_MAX_BUFFER_SIZE=200000
But it didn't have much effect.
Putting a dedicated instance for the clickhouse could help?
What would be the CPU recommendation?
Hey guys,
I've been running the docker version for a little while now, but one of the accounts is getting an error when he tries to access his domain stats.
Login works fine, but when clicking on a domain, he is being redirected to /settings, not the domain.
In the mean time the docker container is throwing an error:
plausible_1 | Request: GET /kwacha.webflow.io plausible_1 | ** (exit) an exception was raised: plausible_1 | ** (Plug.Conn.AlreadySentError) the response was already sent plausible_1 | (plug 1.10.1) lib/plug/conn.ex:1535: Plug.Conn.put_session/3 plausible_1 | (plausible 0.0.1) lib/plausible_web/controllers/stats_controller.ex:21: PlausibleWeb.StatsController.stats/2 plausible_1 | (plausible 0.0.1) lib/plausible_web/controllers/stats_controller.ex:1: PlausibleWeb.StatsController.action/2 plausible_1 | (plausible 0.0.1) lib/plausible_web/controllers/stats_controller.ex:1: PlausibleWeb.StatsController.phoenix_controller_pipeline/2 plausible_1 | (phoenix 1.4.17) lib/phoenix/router.ex:288: Phoenix.Router.__call__/2 plausible_1 | (plausible 0.0.1) lib/plug/error_handler.ex:65: PlausibleWeb.Router.call/2 plausible_1 | (plausible 0.0.1) lib/plausible_web/endpoint.ex:1: PlausibleWeb.Endpoint.plug_builder_call/2 plausible_1 | (plausible 0.0.1) lib/plausible_web/endpoint.ex:1: PlausibleWeb.Endpoint."call (overridable 3)"/2 plausible_1 | 12:34:33.670 request_id=FksO5iElfq0pwW4AAAFF [warn] Failed to send Sentry event.Cannot send Sentry event because of invalid DSN plausible_1 | 12:34:33.676 [error] #PID<0.4461.0> running PlausibleWeb.Endpoint (connection #PID<0.4460.0>, stream id 1) terminated plausible_1 | Server: stats.vejnoe.dk:80 (http) plausible_1 | Request: GET /kwacha.webflow.io plausible_1 | ** (exit) an exception was raised: plausible_1 | ** (Plug.Conn.AlreadySentError) the response was already sent plausible_1 | (plug 1.10.1) lib/plug/conn.ex:1535: Plug.Conn.put_session/3 plausible_1 | (plausible 0.0.1) lib/plausible_web/controllers/stats_controller.ex:21: PlausibleWeb.StatsController.stats/2 plausible_1 | (plausible 0.0.1) lib/plausible_web/controllers/stats_controller.ex:1: PlausibleWeb.StatsController.action/2 plausible_1 | (plausible 0.0.1) lib/plausible_web/controllers/stats_controller.ex:1: PlausibleWeb.StatsController.phoenix_controller_pipeline/2 plausible_1 | (phoenix 1.4.17) lib/phoenix/router.ex:288: Phoenix.Router.__call__/2 plausible_1 | (plausible 0.0.1) lib/plug/error_handler.ex:65: PlausibleWeb.Router.call/2 plausible_1 | (plausible 0.0.1) lib/plausible_web/endpoint.ex:1: PlausibleWeb.Endpoint.plug_builder_call/2 plausible_1 | (plausible 0.0.1) lib/plausible_web/endpoint.ex:1: PlausibleWeb.Endpoint."call (overridable 3)"/2
Not a self-hosting issue here, but I tried out the repo and it “just works”, but it makes me wonder how does it even work?
In particular, while you’re standing up both the postgres and clickhouse database, they’re on different containers (meaning you can’t access them using “localhost”, which is the default for both postgres and clickhouse configurations), not to mention the fact that we haven’t even created the database in both postgres and clickhouse…
In short, how is the plausible instance able to actually connect to and make queries to the database containers when the configuration is seemingly wrong and it’s not actually (seemingly) connected to the database?
Document the issue described in plausible/docs#432
Submitting here since this is not a support request.
In the GeoIP section, the documentation calls the configuration variables GEOIP_ACCOUNT_KEY
and GEOIP_LICENSE_KEY
, whereas in this repository they are called GEOIPUPDATE_ACCOUNT_ID
and GEOIPUPDATE_LICENSE_KEY
respectively.
There should be some documentation or warning about the Postgres ports being exposed (and maybe suggest changing password the postgres password).
I brought the docker compose up to test and got caught out by this issue docker-library/postgres#664. Docker opens up the ports within iptables and combine this with the weak default password. I'm sure others might make the same configuration mistake.
The ports don't actually need to be exposed in the compose file as the other containers use the docker network?
Relevant:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.