This is an unofficial Docker image for Goatcounter, heavily based on baethon/docker-goatcounter, but adapted to use Goatcounter v2.
docker run --name goatcounter \
-p 8080:8080 \
-v $(pwd)/db:/goatcounter/db \
-e GOATCOUNTER_DOMAIN=stats.domain.com \
-e GOATCOUNTER_EMAIL=admin@domain.com \
-e GOATCOUNTER_PASSWORD=pa55w0rd \
ghcr.io/riesinger/goatcounter-docker:2
This variable is used to create the initial site. Set this to the domain you want to run Goatcounter on.
Defines the email address of the admin user. Used to sign in.
The password to use for the admin account. It is recommended to not pass this on the CLI but to read
it from a file, for example using docker-compose
.
Sets the SMTP server to be used by the server to send emails.
Example: smtp://user:pass@server.com:587
Default: stdout - print email contents to stdout
The database to use. By default, the server will use an SQLite database which is the easiest solution. Note that this image isn't tested for usage with PostgreSQL, but it should work fine.
For persistence when using SQLite, make sure to mount a volume into /goatcounter/db
, for example
with docker run -v $(pwd)/db:/goatcounter/db ...
Default: sqlite:///goatcounter/db/goatconter.sqlite3