Self-Hosting
Run your own instance of Crit Web
Prerequisites
- Docker (with Compose)
- PostgreSQL 17 (or use the bundled one in docker-compose)
Quick start with Docker Compose
Download the example files and configure your environment:
curl -o docker-compose.yml https://raw.githubusercontent.com/tomasz-tomczyk/crit-web/main/contrib/docker-compose.example.yml
curl -o .env https://raw.githubusercontent.com/tomasz-tomczyk/crit-web/main/.env.example
Generate a secret key and set it in .env:
openssl rand -base64 64
Update
SECRET_KEY_BASE
and PHX_HOST
in .env,
then start the services:
docker compose up -d
Environment Variables
| Variable | Required | Description |
|---|---|---|
DATABASE_URL
|
Yes | PostgreSQL connection URL |
SECRET_KEY_BASE
|
Yes | 64+ byte secret for signing cookies |
PHX_HOST
|
Yes | Hostname where crit-web is served |
PHX_SERVER
|
Yes |
Set to true to start the web server
|
PORT
|
No | HTTP port (default: 4000) |
Running with your own Postgres
If you already have a PostgreSQL instance, skip the
db
service
and run the app container directly:
docker run -d \
--name crit-web \
--restart unless-stopped \
-e DATABASE_URL="postgres://user:pass@your-host:5432/crit" \
-e SECRET_KEY_BASE="your-generated-secret" \
-e PHX_HOST="crit.example.com" \
-e PHX_SERVER=true \
-e PORT=4000 \
-p 4000:4000 \
ghcr.io/tomasz-tomczyk/crit-web:latest \
sh -c "/app/bin/migrate && /app/bin/server"
Updating
Pull the latest image and restart:
docker compose pull
docker compose up -d
Docker image
Images are published to GitHub Container Registry. Available tags:
-
latest— latest stable release -
main— bleeding edge (built from main branch) -
1.2.3— specific version