GoatCounter
GoatCounter is an open source, privacy-friendly, web analytics platform
Postgres
railwayapp-templates/postgres-ssl:latest
Just deployed
/var/lib/postgresql/data
goatcounter
arp242/goatcounter
Just deployed
Overview
GoatCounter is an open source web analytics platform available as a free donation-supported hosted service or self-hosted app. It aims to offer easy to use and meaningful privacy-friendly web analytics as an alternative to Google Analytics or Matomo. More about why it was made here.
Configuration
There are two environment variables that require manual updates (the default values for the rest are sufficient):
[email protected]
SITE_USER_PASSWORD=password
The site user email and password are both required to setup the goatcounter inital user. The email used need not exist, it will simply be used as the username for the goatcounter user - no activation email will be sent for this user. Additional users can be added in-app after signing in as this initial user.
Deploy
Service
In order to successfully build and deploy the service, the Build Command
and Start Command
in the services' General
settings need to be updated.
The value for the Build Command
should be set to:
go build ./cmd/goatcounter
The value for the Start Command
should be set to:
./goatcounter db create site -vhost ${HOST_DOMAIN} -user.email ${SITE_USER_EMAIL} -user.password ${SITE_USER_PASSWORD} -db ${DATABASE} -createdb && ./goatcounter serve -db ${DATABASE} -listen 0.0.0.0:${PORT} -tls http
Note: The Start Command
above is only valid for the first time the service is deployed - it will create the database entries for the site and initial user.
After the service has successfully deployed for the first time. This Start Command
will need to be updated to remove the ./goatcounter db create site
command.
So for subsequent deploys to be successful, it should be updated ot the following:
./goatcounter serve -db ${DATABASE} -listen 0.0.0.0:${PORT} -tls http
Failing to do so will result in the following deployment error:
goatcounter: there is already a site for the host ""
Website
Sending metrics to your new goatcounter requires adding a `
Template Content
goatcounter
arp242/goatcounter