The Free Encyclopedia

Self-Hosted Git with Gitea

Gitea is a fast, tiny self-hosted Git service — repos, issues, pull requests, CI, and a web UI — that runs comfortably on a small box.

Run it with Compose

services:
  gitea:
    image: gitea/gitea:latest
    restart: unless-stopped
    volumes: ["gitea:/data"]
    ports: ["127.0.0.1:3000:3000", "2222:22"]   # web + SSH
volumes: { gitea: {} }

Front the web port with a reverse proxy for HTTPS, and push over SSH on the dedicated port:

git remote add origin git@your-host:2222/you/repo.git

Why self-host git

Gitea Hosted (GitHub/GitLab)
Private, on your hardware Someone else's servers
No repo/seat limits Tiered limits
Tiny footprint N/A
Feature Note
Actions GitHub-Actions-compatible CI
Mirroring Auto-pull from GitHub as backup
Webhooks Trigger deploys on push

Back up the /data volume and the DB — see Database Backups and Replication.

Related: Docker Compose for Self-Hosting · Reverse Proxy with Caddy and Nginx · Database Backups and Replication