Self-host gitfor

gitfor is open source under 0BSD. Deploy it to your own Cloudflare account, and your repositories, issues, logs and artifacts are stored there.

  1. Get the code

    Clone the repository and install dependencies.

    terminal
    git clone https://gitfor.dev/gitfor/platform.git gitforcd gitforbun install
  2. Create storage

    Create the database, key-value namespace, bucket and queues, then copy their IDs into wrangler.jsonc.

    terminal
    bunx wrangler d1 create gitforbunx wrangler kv namespace create gitforbunx wrangler r2 bucket create gitforbunx wrangler queues create gitfor-eventsbunx wrangler queues create gitfor-events-dlqbunx wrangler secret put SECRETS_KEY
  3. Point it at your domain

    Set PUBLIC_URL to your forge's URL and USERCONTENT_ORIGIN to a separate domain for raw files and uploads, so user content can never read your session. Add GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET to enable GitHub sign-in.

  4. Deploy

    Apply migrations and ship. Create the administrator by signing up with the one-time BOOTSTRAP_TOKEN link (/signup?bootstrap=…), or set ADMIN_EMAIL and verify that address; set SIGNUPS_ENABLED to "false" to keep registration closed.

    terminal
    bun run deploy
  5. Add a runner (optional)

    Managed runners work out of the box. To run jobs on your own hardware, create a registration token under repository or organization settings.

    terminal
    gfd runner register --url https://your-forge.example --token gitfor_reg_...gfd runner run

Local development

To work on gitfor itself, run it locally. The dev server uses your real Artifacts namespace, so you work against live repositories.

terminal
echo "SECRETS_KEY=$(openssl rand -hex 32)" > .dev.varsbun run db:migratebun run dev