Deploying GitBlixt

Architecture

GitBlixt runs as Docker containers managed by Docker Compose and Docker Swarm:

  • PostgreSQL 16 — stores all application data (users, repositories, issues, etc.)
  • GitBlixt (Elixir/Phoenix) — the application itself. Handles HTTP, HTTPS, SSH, and git operations.
  • Caddy (optional) — reverse proxy for deployed apps. Only needed if you use the App Deployment feature to deploy repositories as running services.

On first boot, the GitBlixt container automatically:

  1. Waits for PostgreSQL to be healthy
  2. Runs all database migrations
  3. Generates SSH host keys
  4. Requests an SSL certificate from Let's Encrypt (if SSL_MODE=auto)

Standard Deployment

Create a .env file and a docker-compose.yml, then run docker compose up -d. See Getting Started for the full walkthrough.

Using an External Database

To use your own Postgres instance instead of the bundled one, set DATABASE_URL in the gitblixt service and remove the postgres service from your compose file:

    services:
  gitblixt:
    image: gitblixt/gitblixt:latest
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
      - "22:22"
    environment:
      DATABASE_URL: ecto://user:pass@your-db-host:5432/gitblixt
      GITBLIXT_HOST: git.yourdomain.com
    volumes:
      - ./data:/data

Minimum Postgres version: 14.

Data Storage

Persistent data is stored across two locations:

Location Contents
data/postgres/ PostgreSQL data directory (managed by the postgres container)
/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://git@#gitblixt.com:2222/user/repo.git.