Deploying GitBlixt
Standard Deployment
The standard deployment is a single docker run command. All data persists in a
named Docker volume (gitblixt_data) that survives container restarts and upgrades.
docker run -d \
--name gitblixt \
--restart unless-stopped \
-p 80:80 \
-p 443:443 \
-p 22:22 \
-e GITBLIXT_HOST=git.yourdomain.com \
-e GITBLIXT_SECRET_KEY_BASE=<your-secret> \
-v gitblixt_data:/data \
gitblixt/gitblixt:latest
What Runs Inside the Container
GitBlixt uses s6-overlay to supervise two processes inside the container:
-
PostgreSQL 16
— stores all application data. Listens on
127.0.0.1only; not accessible from outside the container. - GitBlixt (Elixir/Phoenix) — the application itself. Handles HTTP, HTTPS, SSH, and git operations.
On first boot, the container automatically:
- Initializes the Postgres data directory
- Creates the
gitblixtdatabase and user - Runs all database migrations
- Requests an SSL certificate from Let's Encrypt (if
SSL_MODE=auto)
Using an External Database
If you have an existing Postgres instance, pass its URL as DATABASE_URL.
GitBlixt will skip starting the bundled Postgres entirely.
docker run -d \
--name gitblixt \
-p 80:80 -p 443:443 -p 22:22 \
-e GITBLIXT_HOST=git.yourdomain.com \
-e GITBLIXT_SECRET_KEY_BASE=<your-secret> \
-e DATABASE_URL=postgresql://user:pass@db-host:5432/gitblixt \
-v gitblixt_data:/data \
gitblixt/gitblixt:latest
Minimum Postgres version: 14.
Using Docker Compose
services:
gitblixt:
image: gitblixt/gitblixt:latest
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "22:22"
environment:
GITBLIXT_HOST: git.yourdomain.com
GITBLIXT_SECRET_KEY_BASE: your-secret
volumes:
- gitblixt_data:/data
volumes:
gitblixt_data:
Data Storage
All persistent data is stored under /data inside the container:
| Path | Contents |
|---|---|
/data/postgres |
PostgreSQL data directory (bundled Postgres only) |
/data/repos |
Bare git repositories |
/data/uploads |
User avatars and file uploads |
/data/ssl |
Let's Encrypt certificates |
/data/ssh |
SSH host keys (auto-generated on first boot) |
Firewall Requirements
| Port | Protocol | Purpose |
|---|---|---|
| 80 | TCP | HTTP (redirects to HTTPS; also used for Let's Encrypt ACME challenges) |
| 443 | TCP | HTTPS |
| 22 | TCP | Git over SSH |
If port 22 is already in use by your server's own SSH daemon, you can run GitBlixt's SSH on
a different port with -e GITBLIXT_SSH_PORT=2222
and expose it with -p 2222:2222. Users will then clone with git clone ssh://[email protected]:2222/user/repo.git.