← Blog

Self-Host Your Git with Gitea

December 1, 2026 · 4 min read

Gitea is a lightweight, self-hosted Git service with the features you'd expect: repositories, issues, pull requests, a web editor — and built-in CI with Gitea Actions. It runs comfortably on a small VPS.

Which plan

Spark (2 GB RAM) handles a team of a few people. Add more memory if you also run CI jobs on the same server.

Run it with Docker Compose

services:
  gitea:
    image: gitea/gitea:latest
    restart: unless-stopped
    environment:
      USER_UID: "1000"
      USER_GID: "1000"
    volumes:
      - ./gitea:/data
    ports:
      - "127.0.0.1:3000:3000"
      - "2222:22"
docker compose up -d

The web UI listens on localhost behind your reverse proxy. Git over SSH uses port 2222, so it doesn't clash with the server's own SSH on 22.

HTTPS

Put Caddy or Nginx in front of port 3000 with a domain such as git.example.com.

First-run setup

Open the site and complete the installer:

  • Database: SQLite is fine for small teams; PostgreSQL for larger ones.
  • Server domain and SSH port 2222 so clone URLs are correct.
  • Create the admin account, then turn off open registration in the settings if this is a private server.

Mirror from GitHub

Gitea can mirror repositories from GitHub or GitLab and keep them in sync — an easy off-site copy of your code.

CI with Gitea Actions

Gitea Actions uses the same workflow syntax as GitHub Actions. Register a runner — ideally on a separate server so builds don't slow down Git.

Back it up

Everything lives in the gitea/ folder. Gitea also has a built-in dump:

docker compose exec -u git gitea gitea dump -c /data/gitea/conf/app.ini

Copy the result off the server.

Deploy a server and host your own code.

Ready to deploy?

Fund a balance in crypto and get a server in ~60 seconds.

Get started →