Skip to Content
All memories

Fathom Setup

Installing Fathom with Dokku

# install additional dokku utilities: herokuish, sshcommand, plugn
# sudo apt install -y herokuish sshcommand plugn
# install plugins if necessary
# sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
# sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
# sudo dokku plugin:install https://github.com/dokku/dokku-redirect.git
# setup let's encrypt email address
# dokku config:set --no-restart --global DOKKU_LETSENCRYPT_EMAIL=mokht@rmi.al
# init app
dokku apps:create analytics.mokhtar.dev
# init db
dokku postgres:create fathom-database
dokku postgres:link fathom-database analytics.mokhtar.dev
# dokku postgres:info fathom-database # get the password here
# environment variables
# DATABASE_URL:  postgres://postgres:PASSWORD@dokku-postgres-fathom-database:5432/fathom_database
dokku config:set analytics.mokhtar.dev FATHOM_SERVER_ADDR=:8080
dokku config:set analytics.mokhtar.dev FATHOM_GZIP=true
dokku config:set analytics.mokhtar.dev FATHOM_DATABASE_DRIVER=postgres
dokku config:set analytics.mokhtar.dev FATHOM_DATABASE_URL=$(dokku config:get analytics.mokhtar.dev DATABASE_URL)
dokku config:set analytics.mokhtar.dev FATHOM_SECRET=$(openssl rand -base64 128 | tr -d /=+ | sed 'N;s/\n//' | cut -c -64 | head -n 1)
#dokku config:set analytics.mokhtar.dev FATHOM_DATABASE_DRIVER=sqlite3
#dokku config:set analytics.mokhtar.dev FATHOM_DATABASE_DRIVER=postgres
dokku domains:add analytics.mokhtar.dev analytics.mokhtar.dev
# make new git project with Docker file containing `FROM usefathom/fathom:latest`
# git remote add dokku dokku@dokku.mokhtar.dev:analytics.mokhtar.dev # RUN THIS ON HOST
# setup domain and https
dokku proxy:ports-add analytics.mokhtar.dev http:80:8080
dokku letsencrypt analytics.mokhtar.dev
# create fathom user
dokku enter analytics.mokhtar.dev
./fathom user add --email=mokht@rmi.al --password=secret
Dockerfile
FROM usefathom/fathom:latest