Self-Hosting Your Git Repos with Forgejo

Most developers don’t think twice about pushing their code to GitHub. It’s convenient, it’s fast, and everyone’s on it. But convenience always comes at a price — and with code repositories, that price is handing over your intellectual property to a platform you don’t control.

We recently completed the migration of our own repositories to a self-hosted Git server powered by Forgejo, and it’s prompted us to reflect on why this matters — and why more developers and small teams should consider doing the same.

Your Code Lives Where You Put It

When your repositories sit on GitHub, your source code — the primary intellectual property of any software project — lives on servers owned and operated by Microsoft. You are subject to their terms of service, their pricing decisions, their availability guarantees, and increasingly, their AI training pipelines. GitHub’s Copilot was trained on public repositories, and while opt-outs exist, many developers remain uncomfortable with the idea of their code feeding models they never agreed to contribute to.

Self-hosting changes that equation entirely. Your code stays on your hardware, under your rules.

What Is Forgejo?

Forgejo is an open-source, self-hosted Git platform — a community fork of Gitea that became fully independent in 2024 under the non-profit Codeberg e.V. It provides everything you’d expect from a modern Git forge: repository hosting, pull requests, issue tracking, user management, and a web UI that will feel immediately familiar to anyone coming from GitHub.

It runs in a single Docker container, uses minimal resources, and can be up and serving repositories in under an hour. There are no per-seat fees, no usage caps, and no third party involved.

Locking It Down Properly

Self-hosting doesn’t mean sacrificing security — in fact it’s an opportunity to apply exactly the controls you want, without compromises imposed by a SaaS platform. On our instance, we disabled the local login form entirely in favour of SSO via our existing identity provider, meaning there’s no password-based attack surface on the Git interface. Repositories are not visible to unauthenticated users. Self-registration is disabled. Access to code requires an authenticated session, full stop.

This kind of hardening is straightforward to apply on Forgejo and gives you a level of access control that most hosted platforms simply don’t offer at this granularity.

Who Should Consider This?

Self-hosting a Git server isn’t for everyone. If you’re collaborating with a large distributed team that relies heavily on GitHub’s ecosystem — Actions, Packages, advanced code review tooling — the switching cost is real. But for solo developers, small teams, or anyone already running their own server stack, Forgejo is a natural fit. The migration from GitHub is clean: all history, branches, and tags transfer without loss.

For anyone building tools or products where data sovereignty is a core value, keeping your source code under your own roof is a logical extension of that principle. It’s one less third party with access to what you’re building — and one more system you fully understand and control.

Forgejo is available at forgejo.org.

Key Takeaways

  • Forgejo is a lightweight, fully open-source Git platform you run on your own hardware — no vendor, no fees, no third-party access to your code.
  • Migrating from GitHub preserves all history, branches, and tags with minimal effort.
  • Self-hosting enables access controls not available on SaaS platforms: SSO-only login, no public registration, authenticated-only repo visibility.
  • For anyone where data sovereignty is a priority, keeping source code off third-party infrastructure is a straightforward win.

Photo: panumas nikhomkhai via Pexels

Scroll to Top