PrivacyTools.io
Reviewed by Marco Wollank
Replace today: GitHub

The Best Self-Hosted Git Hosting in 2026

Private alternatives to GitHub, vetted against our public criteria.

Grouped by threat level

Covered Easy start and good defaults for everyone
Hardened Some setup and real gains for the willing

How they compare

Tool Hosting Based in Cost
Forgejo
Self-host · Free
Codeberg
Hosted (nonprofit) Germany Free
GitLab CE
Self-host or cloud United States Freemium
SourceHut
Hosted or self-host United States Freemium

Your repositories are the most valuable thing you produce, and the default place to keep them is owned by Microsoft. Code pushed to a platform you do not control can be folded into Copilot and governed by terms you never set. A Git host you run yourself, or one operated by a nonprofit, keeps the source on infrastructure that answers to you. The forges below let you own both the storage and the access rules without giving up pull requests or CI.

Why you can’t just turn off tracking on GitHub

GitHub belongs to Microsoft, and the parts that matter most are not yours to configure. No setting pulls your public code out of the training corpus behind Copilot, and no toggle moves your repositories onto storage you own. The default centralizes open source on one proprietary service, which means a single company sets the terms and the pricing and decides who keeps access. You can tighten your repository visibility and lock down a few permissions, but the structural facts stay fixed. The infrastructure and the rules both belong to Microsoft, and your code lives where it can be mined. The only real fix is to host the forge yourself or hand it to an organization whose purpose is to serve developers rather than to sell a model trained on them.

How we pick

Every forge here is measured against our public listing criteria. The code that runs the platform has to be open to inspection. You have to be able to self-host it or trust a provider with no incentive to mine your repositories. And the project needs a track record rather than a single weekend of hype. We weigh the license too, because a copyleft forge is far harder for a for-profit company to quietly capture than a permissive one. We only list a forge we would happily run for our own work, and we say plainly where each one asks more of you in return for the independence it buys.

What to look for in a Git host

Start with where the code lives. A forge you can self-host puts the repositories on infrastructure you own, which is the whole point of leaving GitHub. Read the license next: an open-source forge can be audited and forked, while an open-core one keeps its advanced features proprietary. Check the workflow you are buying into, because a familiar pull-request model is a gentle move while an email patch flow is a deliberate change of habit. Weigh the maintenance burden honestly, since a lightweight forge updates with one command and a full DevOps platform asks for real server resources. Look for working migration tooling so your issues and history survive the move. The right pick balances the control you gain against the upkeep you take on.

Will I lose pull requests and CI?

No, and this is the worry that keeps most people on GitHub longer than they need to be. Forgejo and GitLab CE both ship a full merge-request flow with inline review and branch protection, plus CI runners you point at your own machines. Codeberg gives you the same Forgejo experience as a hosted service, complete with its own CI. The labels differ from GitHub’s and the runners are wired up by hand, but the daily loop of opening a branch and merging the reviewed result is fully intact. The one genuine departure is SourceHut, which reviews code over email on purpose, a workflow the Linux kernel has used for decades. That is a different habit, not a missing feature.

How to switch

Stand up your chosen forge first, either by deploying a container on a small server or by creating an account on a hosted provider. Use the built-in importer to pull each repository across with its issues and history, then push your local clones at the new remote so your day-to-day work moves with you. Keep a read-only mirror on GitHub for a while so existing links resolve while you tell collaborators the real home of the project. If you are leaving Microsoft more broadly, the de-Microsoft playbook covers the rest of the stack, and our GitHub alternatives page walks through the move in detail. Give it a sprint before you judge it, because the forge fades into the background once your habits catch up.

Frequently asked

Why move my repositories off GitHub?
GitHub is owned by Microsoft, and the code you push sits on infrastructure you do not control. Public repositories have been used as training data for Copilot, and a single company decides the terms and who keeps access. Moving to a forge you host or to an independent provider puts that decision back in your hands.
Can my code be used to train Copilot if I stay on GitHub?
Public code on GitHub has been used to train Copilot, and the policies that govern this are set by Microsoft rather than by you. Hosting your own forge or using an independent provider means no third party is feeding your repositories into a model, because the storage and the rules both belong to you.
Is self-hosting a Git forge hard to maintain?
Less than it used to be. A lightweight forge runs comfortably on a small server and updates with a single container pull. The heavier platforms ask more of you, so the honest tradeoff is feature depth against upkeep. If you would rather not run a server at all, a nonprofit host gives you most of the independence with none of the maintenance.
Will I lose pull requests and CI when I leave GitHub?
No. Every forge here has its own merge-request and code-review flow, and most ship integrated CI. The terminology shifts and the runners are configured differently, but the daily loop of opening a branch and merging the reviewed result is intact. One forge uses an email patch workflow instead, which is a deliberate design choice rather than a missing feature.
Can I keep a mirror on GitHub while I move?
Yes, and many people do during the transition. You can push to your new forge as the primary remote and mirror to GitHub so existing links keep resolving. Over time the mirror becomes read-only signage that points people to the real home of the project.
Do these forges support Git LFS and large repositories?
The mainstream forges support Git LFS for large binary files, so artwork and assets travel with the project. Capacity on a self-hosted forge is whatever your disk allows, while a hosted nonprofit asks you to keep public open-source repositories within reasonable limits. Check the provider's policy before you move a very large monorepo.