Self-hosted Git server: Gitea, Forgejo and GitLab CE compared
By Pull This RepoPosted 5 min read
Short answer
For self-hosted Git, most people should run Gitea or Forgejo: both are light, open source GitHub style servers that start with one Docker container and SQLite. Forgejo is the community fork run under a non-profit. Choose GitLab Community Edition only if you want built in CI and planning tools and have at least 8 GB of RAM to spare.
Self-hosted Git means running your own server for Git repositories instead of keeping your code on GitHub, GitLab.com or Bitbucket. The three projects most people compare are Gitea, Forgejo and GitLab Community Edition, and for the smallest setups plain Git over SSH needs no extra software at all. We read each project's docs, licence and repository on 22 November 2026; here is how they compare and how to start each one.
Which self-hosted Git server should you pick?
| Gitea | Forgejo | GitLab CE | Plain Git over SSH | |
|---|---|---|---|---|
| Licence | MIT | GPL v3 or later (since v9) | MIT for the core | Git is GPL-2.0 |
| Who runs it | The Gitea project | Community, under non-profit Codeberg e.V. | GitLab Inc. | Nobody; it is just Git |
| Latest release on 22 Nov 2026 | v28.4.0 (15 Nov 2026) | v17.0.2 (18 Nov 2026) | Pin a specific version | Your distro's Git |
| Stars on 22 Nov 2026 | 59,210 on GitHub | 5,854 on Codeberg | 6,208 on GitLab.com | n/a |
| Hardware | Light; runs on small servers | Light; same roots as Gitea | Baseline 8 vCPU and 16 GB RAM | Any SSH server |
| Web interface, PRs, issues | Yes | Yes | Yes, plus planning tools | No |
| Built in CI | Gitea Actions | Forgejo Actions | GitLab CI/CD | No |
If you want a GitHub style site for yourself or a small team, start with Gitea or Forgejo. If you need GitLab's full DevOps feature set and have the hardware, GitLab CE. If you only need a private remote, plain SSH.
What is Gitea?
Gitea is a light, self-hosted Git service written in Go. On 22 November 2026 the go-gitea/gitea repo had 59,210 stars, an MIT licence and a latest release of v28.4.0, published 15 November 2026. Its README lists Git hosting, code review, issue tracking, a project kanban, a wiki, a package registry and "CI/CD which can reuse GitHub Actions" in one program.
Gitea's Docker guide gives a compose file like this:
networks:
gitea:
external: false
services:
server:
image: docker.gitea.com/gitea:28.4.0
container_name: gitea
environment:
- USER_UID=1000
- USER_GID=1000
restart: always
networks:
- gitea
volumes:
- ./gitea:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3000:3000"
- "222:22"Start it with:
docker compose up -dThen open http://server-ip:3000 and follow the installation wizard. With no database service configured, Gitea can set up SQLite3, which is fine for a small team. The guide also shows MySQL and PostgreSQL services for bigger installs. It warns that the ./gitea folder must be owned by the UID and GID in the file, or the container may not start. Port 222 on the host maps to SSH inside the container, so clone URLs over SSH use that port.
What is Forgejo, and how is it different from Gitea?
Forgejo is "a self-hosted lightweight software forge," in its own words, and it shares Gitea's roots. Its comparison page says Forgejo was created in October 2022 after Gitea's domains and trademark were "transferred to a for-profit company without knowledge or approval of the community." It started as a soft fork and became a hard fork in early 2024, so the two codebases now diverge.
Governance is the main reason people choose it. Forgejo is developed by a community under Codeberg e.V., which it describes as "a democratic non-profit organization." Its FAQ says Forgejo v9.0 and later are licensed GPL v3 or later; versions up to v8.0 were MIT. Forgejo's comparison page also lists differences it sees, such as security release notice for everyone and its work on federation between forges. Those are Forgejo's claims about itself; read Gitea's side before deciding if it matters to you.
On 22 November 2026 the Forgejo repository on Codeberg had 5,854 stars, and the latest release was v17.0.2, published 18 November 2026. Forgejo's Docker example uses the same shape as Gitea's, with its own image:
services:
server:
image: codeberg.org/forgejo/forgejo:17
container_name: forgejo
environment:
- USER_UID=1000
- USER_GID=1000
restart: always
volumes:
- ./forgejo:/data
- /etc/localtime:/etc/localtime:ro
ports:
- "3000:3000"
- "222:22"Run docker compose up -d, then open http://localhost:3000 to finish onboarding. Forgejo's FAQ says moving from Gitea is covered in its upgrade guide under "Preparing an upgrade from Gitea," so check which Gitea versions it supports before you migrate.
What does GitLab Community Edition need?
GitLab is the heavyweight. Its self-managed edition bundles Git hosting, CI/CD, a container registry, issue boards and much more. GitLab's licence file says code outside its ee/ directory is under the MIT Expat licence, and the Community Edition is that open source part. GitLab's system requirements page sets these baselines for a single node:
| Baseline | Floor | |
|---|---|---|
| CPU | 8 vCPU | ARM is supported |
| Memory | 16 GB | "at least 8 GB" in memory constrained setups |
| Application storage | 40 GB minimum | plus room for all your repositories |
| Database | PostgreSQL only | 5 to 10 GB for most instances |
GitLab's Docker guide shows the Enterprise image and says to "replace ee with ce" for Community Edition. Set a home folder first, then run:
export GITLAB_HOME=/srv/gitlab
sudo docker run --detach \
--hostname gitlab.example.com \
--env GITLAB_OMNIBUS_CONFIG="external_url 'http://gitlab.example.com'" \
--publish 443:443 --publish 80:80 --publish 22:22 \
--name gitlab \
--restart always \
--volume $GITLAB_HOME/config:/etc/gitlab \
--volume $GITLAB_HOME/logs:/var/log/gitlab \
--volume $GITLAB_HOME/data:/var/opt/gitlab \
--shm-size 256m \
gitlab/gitlab-ce:<version>-ce.0Replace <version> with a specific release. Sign in as root with the password from:
sudo docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_passwordThe docs say that file is deleted on the first container restart after 24 hours, so change the password right away. Note that this command publishes port 22, which clashes with the host's own SSH unless you move one of them.
How do you self-host Git with nothing but SSH?
If you just want a private remote, any Linux server you can SSH into will do. You need Git on both machines; our guide to installing Git covers that. On the server:
mkdir -p ~/repos/project.git
cd ~/repos/project.git
git init --bareOn your computer:
git remote add origin user@your-server:repos/project.git
git push -u origin mainAnyone with SSH access to that account can clone and push. There is no web view, no pull requests and no issues, but there is also nothing to update except the server itself.
What about Soft Serve?
Soft Serve, a Git server you browse in the terminal over SSH, was a popular middle ground. Its README now says the project has been sunset: the code stays open source, but "No further security updates will be applied," and the GitHub repo is archived. We would not start a new server on it today.
Can you run CI on a self-hosted Git server?
Yes. Gitea's README says its CI/CD can reuse GitHub Actions, Forgejo documents its own Forgejo Actions, and GitLab has GitLab CI/CD built in. Each needs its own runner program on a machine you control. If your code stays on GitHub but you want builds on your own hardware, see our guide to setting up a GitHub self-hosted runner.
What is the catch?
You become the host. Backups, updates, TLS certificates and security patches are yours, and a Git server on the public internet is a target, so keep it patched and behind HTTPS. Gitea and Forgejo are easy to run on a small machine; GitLab wants a real server. And your collaborators lose GitHub's network effects: stars, forks and drive by pull requests from strangers do not happen on a private server. For code that only you or your team touch, that trade is usually fine.
Pull it. Stash it.
Questions people ask
What is the best self-hosted Git server?
For a person or small team, Gitea or Forgejo. Both give you a GitHub style web interface, pull requests, issues and a package registry in one light container. GitLab Community Edition does more, including built in CI, but GitLab's docs set a baseline of 8 vCPU and 16 GB of memory for a single node.
What is the difference between Gitea and Forgejo?
Forgejo began in October 2022 as a fork of Gitea after Gitea's domains and trademark moved to a for-profit company, and became a hard fork in early 2024. Forgejo is run under the non-profit Codeberg e.V. and licensed GPL v3 or later since v9. Gitea is MIT licensed.
Can I self-host GitHub?
Not the github.com service itself for free. GitHub Enterprise Server is a paid product. The usual free route is to self-host a GitHub style server such as Gitea or Forgejo, and you can still use GitHub Actions runners on your own hardware for repositories that stay on GitHub.
Do I need a web interface to self-host Git?
No. Git can serve a repository over plain SSH from any server you can log in to. Create a bare repository with git init --bare and add it as a remote. You lose pull requests, issues and a browser view, but there is nothing extra to install or update.
Sources
- 1go-gitea/gitea
- 2Gitea Docs: Installation with Docker (read 2026-11-22)
- 3Forgejo official site (read 2026-11-22)
- 4Forgejo: Comparison with Gitea (read 2026-11-22)
- 5Forgejo FAQ (read 2026-11-22)
- 6Forgejo Docs: Installation with Docker (read 2026-11-22)
- 7Forgejo repository on Codeberg (read 2026-11-22)
- 8GitLab Docs: Installation system requirements (read 2026-11-22)
- 9GitLab Docs: Install GitLab in a Docker container (read 2026-11-22)
- 10charmbracelet/soft-serve
More repos like this
Get tomorrow's repo in your feed
One free, open source repo a day as a short video, shown working, with the catch named. Pull it. Stash it.
