Free, open-source alternatives to GitHub
Code hosting and collaboration. 7 apps you can run yourself instead of GitHub, sorted by how well they replace it. Each one is open source, so your data stays with you.
ForgejoBest match
A lightweight software forge focused on scaling, federation, and privacy (fork of Gitea).
Gitea
Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD.
GitLab
Self Hosted Git repository management, code reviews, issue tracking, activity feeds and wikis.
Gogs
Painless self-hosted Git Service written in Go.
OneDev
All-In-One DevOps Platform. With Git Management, Issue Tracking, and CI/CD. Simple yet Powerful.
gitbucket
Git platform powered with easy installation, high extensibility & GitHub API compatibility (alternative to GitHub).
Sourcehut
A full web git interface with no javascript.
Side by side
Why replace GitHub?
GitHub works, but your data lives in someone else's account, the price can change at any time, and features can disappear. An open-source app you run yourself is yours: you choose where it runs, who can see the data, and when to update.
Questions
What is the best free alternative to GitHub?
Forgejo is the closest open-source replacement for GitHub in our list. Gitea and GitLab are worth a look too, depending on what you need.
Can I self-host an alternative to GitHub?
Yes. All 7 apps on this page are open source and can run on your own server, usually with Docker, or on a managed host that installs them for you.