Hosting your own Git server gives you control over your code, no per-user fees, private infrastructure, and independence from a third party’s policies or outages. The main options range from a single Go binary that runs on 256 MB of RAM, to a full DevOps platform that wants 8 GB. Here’s how they compare.

Quick comparison

Gitea Forgejo GitLab CE OneDev Git over SSH
Footprint Very light (≈200–500 MB RAM) Very light Heavy (4 GB min, 8 GB recommended) Moderate (Java) Minimal
Web UI, issues, PRs Yes Yes Yes, very extensive Yes No
Built-in CI/CD Gitea Actions (GitHub Actions compatible) Forgejo Actions GitLab CI (mature) Built-in No
Container / package registry Yes Yes Yes Yes No
Federation Planned In progress (ForgeFed) No No No
Governance Gitea Ltd + community Community (Codeberg e.V.) GitLab Inc. (open core) Open source —
Best for Small teams, homelabs Same, community-governed Larger teams wanting an all-in-one DevOps suite Teams wanting integrated CI with less setup Solo developers, simple backups

Gitea

A single binary written in Go, with a GitHub-like interface: repositories, issues, pull requests, wikis, releases, a package registry and Gitea Actions (compatible with most GitHub Actions workflows). It runs happily on the smallest VPS, with SQLite for small setups or PostgreSQL or MySQL for more users. Upgrades are simple.

See install Gitea and Gitea Actions.

Forgejo

A community-governed fork of Gitea (stewarded by Codeberg e.V.). It’s functionally very similar, with a focus on community governance and federation, and powers Codeberg.org. Migration between Gitea and Forgejo is straightforward for most versions. Choose it if project governance matters to you.

GitLab Community Edition

A complete DevOps platform: Git hosting, merge requests, the very capable GitLab CI/CD, a container registry, issue boards, wikis, a security scanning framework (some features are Enterprise-only) and more. The trade-off is resources and maintenance:

  • 4 GB RAM is a bare minimum, and 8 GB+ is realistic for comfortable use;
  • regular monthly updates, with upgrade paths you must follow for major versions;
  • many components (PostgreSQL, Redis, Gitaly, Sidekiq, Puma) inside the Omnibus package.

See install GitLab and GitLab CI deploys over SSH.

OneDev

A Java-based Git server with built-in CI/CD, code search and issue tracking, and a different UI philosophy. It’s moderately resource-hungry. Worth a look if you want CI tightly integrated, without GitLab’s weight.

Plain Git over SSH

Git needs no special server: any machine with SSH can host bare repositories.

# on the server
sudo adduser --disabled-password git
sudo -u git mkdir -p /home/git/projects/app.git && sudo -u git git init --bare /home/git/projects/app.git

# on your machine
git remote add origin git@server:/home/git/projects/app.git
git push -u origin main

Restrict the git user with git-shell and SSH keys. It’s perfect for a solo developer, or as an extra backup remote. There’s no web UI, no PRs and no CI. See Git commands cheat sheet.

Resource guide for a VPS

Setup Suggested VPS
Gitea or Forgejo, a few users, SQLite 1 vCPU, 1–2 GB RAM
Gitea or Forgejo + PostgreSQL + Actions runner 2 vCPU, 4 GB RAM (runners need extra for builds)
GitLab CE, small team 4 vCPU, 8 GB RAM
GitLab CE + runners on the same host 8 GB+ RAM, or separate runner servers

CI runners do the heavy lifting (builds, tests, Docker images). Run them on separate servers when builds are frequent or large. See how much RAM a VPS needs.

Migrating from GitHub

Gitea, Forgejo and GitLab all have migration importers: enter a GitHub token, and they import repositories, issues, pull requests, labels, milestones and releases. Gitea and Forgejo can also keep mirrors that sync from GitHub periodically, which is a gentle way to start, or a backup strategy for important open-source dependencies.

Operational essentials

  • HTTPS via a reverse proxy, and SSH for Git operations (a non-conflicting port, or the built-in SSH server). See Nginx reverse proxy.
  • Backups: repositories plus database plus config, off-site. Gitea has gitea dump. GitLab has gitlab-backup create plus config files. See backup strategy.
  • Updates: follow releases, especially security fixes. See updating self-hosted apps.
  • Security: enforce 2FA, disable open registration, restrict admin access.

Quick recommendation

  • Most small teams and individuals: Gitea or Forgejo, with Actions for CI.
  • Larger teams wanting one integrated platform, with resources to run it: GitLab CE.
  • Just need a private remote: Git over SSH.

Related: GitLab Runner and CI/CD explained.

  • Git
  • Self-Hosting
  • DevOps