Skip to content

Install GitNotify

Run these commands from the repository root. GitNotify listens on port 8000 and stores its default SQLite database at /data/gitnotify.db inside the container.

Copy the environment template and add the values from the configuration reference:

Terminal window
cp selfhosted/.env.example selfhosted/.env
chmod 600 selfhosted/.env

Keep this file out of version control and readable only by the account that runs GitNotify.

Start the gitnotify service:

Terminal window
docker compose -f selfhosted/docker-compose.yml up -d gitnotify

The Compose service mounts persistent storage at /data and publishes GitNotify on 127.0.0.1:8000. The optional cloudflared service is in the tunnel profile and is covered in Public URL.

After any change to selfhosted/.env, apply it with docker compose -f selfhosted/docker-compose.yml up -d gitnotify. docker compose restart keeps the old environment. Without Compose, remove the container and run the docker run command again.

Check the service:

Terminal window
docker compose -f selfhosted/docker-compose.yml ps
curl -fsS http://127.0.0.1:8000/health

The health response is JSON with ok set to true and the running version.

The production image is built from selfhosted/Dockerfile. To build and run it without Compose:

Terminal window
docker build -t gitnotify:local selfhosted
docker volume create gitnotify-data
docker run -d \
--name gitnotify \
--restart unless-stopped \
--env-file selfhosted/.env \
-p 127.0.0.1:8000:8000 \
-v gitnotify-data:/data \
gitnotify:local

Verify it with the same health request:

Terminal window
curl -fsS http://127.0.0.1:8000/health

The native binary needs a current Rust toolchain and a writable database path. The default /data/gitnotify.db only works if /data exists and the service account can write to it. Otherwise set DATABASE_URL=sqlite://./gitnotify.db in selfhosted/.env.

Terminal window
cd selfhosted
cargo build --release --locked
./target/release/gitnotify

GitNotify reads selfhosted/.env when it starts from this directory. Put the binary behind a service manager so it restarts after a reboot. The process handles SIGTERM and closes its background tasks and database pool before exiting.