7 of the Best Self-Hosted Alternatives to Github

A photograph of a monitor screen displaying a Git commit history.

After Microsoft acquired Github, many developers have been looking for alternatives to host their code. Microsoft (and many other giant companies) has a habit of purchasing proven technology, websites, and products to expand its reach. Skype is one example, and now Github is as well.

Fortunately, there are a lot of other version control systems for you to choose from. Not all of them have all the functionality of Github, but depending on what you need them for, the choices are pretty good. This article will go through some of the best self-hosted alternatives for Github that you can install on your own machine today.

1. GitLab

Even before Microsoft acquired Github, GitLab was already a popular alternative code management platform. It’s an open-source DevOps lifecycle tool with planning, testing, packaging, and releasing functionality. It also comes with a wiki and issue-tracking features, which makes it incredibly attractive for users who want to have a self-hosted “Github-like” experience.

A screenshot of the GitLab landing webpage.

While you can use GitLab as a self-hosted code management platform, its developers also offer a paid premium SaaS version. This comes with additional features such as the ability to sync to an LDAP server and advanced CI/CD pipelines.

That said, you can deploy GitLab on your machine as well as on their hosted platform for free. The Premium edition, on the other hand, currently starts at $29 per user per month.

Tip: learn what makes GitLab different from Github and determine which is the best for you.

2. Gogs

Gogs is a lightweight Git hosting platform that you can deploy on just about any hardware. Written in Go, its developers designed the program to be as quick as possible while relying on little to no external dependencies. For instance, it’s possible to run Gogs on a system with just 512 MB of RAM.

A screenshot of the default Gogs webpage.

One of the biggest selling points of Gogs is that it’s incredibly easy to run even on virtual servers. By default, Gogs also comes with all of the tools that you need to manage your code, track issues, and document your changes. As such, Gogs is a great option if you’re looking for a “no fuss” Github alternative with the best “power to weight” ratio.

Good to know: learn the basics of managing a Git repository.

3. Trac

Trac is a simple and highly flexible code management platform for Linux. Unlike GitLab and Gogs, Trac can work with both Subversion and Git for its backend version control system. This makes it useful if you already have a project working on either of those systems.

A screenshot of the Trac project landing webpage.

Aside from being a flexible tool, Trac is also an enhanced wiki and issue-tracking system for your project. It can manage various tickets, assign different roles, as well as create priority levels for every issue in your repository.

Further, Trac also provides a number of plugins that can change how your instance behaves by default. For example, it has a plugin that allows you to integrate Trac to an existing Github project. As a result, Trac is a good choice if you have to regularly and closely monitor the progress of projects.

4. GitBucket

GitBucket is a JVM-based GitHub clone written in Scala. It doesn’t have as many features as the other apps on the list. In fact, its main advantage is its similarity to GitHub. In other words, if you start missing GitHub, you can always resort to GitBucket.

gitbucket-landing-webpage

That said, GitBucket comes with a decent repository viewer, an issue tracker, the ability to review and accept pull requests, as well as a simple wiki. Apart from that, you can also extend GitBucket’s functionality through the help of plugins. These are small bits of code that can either introduce new features or change existing ones for your repository. For example, you can install a GitHub Gist plugin to your GitBucket as well as custom websites similar to GitHub Pages.

Tip: check out some of the best Git hooks use to optimize your repository.

5. Gitea

Gitea is a lightweight and security-focused code management platform for Linux. Based on Gogs, it aims to provide a comprehensive plug-and-play GitHub alternative while consuming little to no system resources.

gitea-landing-webpage

Some of the biggest features of Gitea compared to Gogs are its built-in RSS feeds, support for CI/CD workflows, as well as multiple user roles for your repository. Further, it also comes with its own extensions framework which allows you to add features such as custom websites similar to GitHub pages. Gitea is a great alternative if you’re looking for a lightweight self-hosted GitHub that’s also highly extensible.

FYI: are you an Emacs user? Learn how you can integrate Git into Emacs using Magit.

6. Mercurial

Unlike the previous entries on this list, Mercurial is a completely different code management platform compared to GitHub. It provides a more clean and concrete way of managing code that is easier to learn for new software developers. Similar to Subversion, Mercurial aims to cut the cruft by giving you commands that are already similar to your Linux system.

mercurial-landing-webpage

One of the selling points of Mercurial is that it’s cross-platform and highly modular. As a result, the platform comes with a ton of extensions which you can use your customize your Mercurial workflow. For instance, the hgnested extension allows you to create smaller sub-repositories inside your main one.

7. Fossil

Fossil is a non-Git source code management system for Linux that focuses on simplicity and reliability. Unlike Git and Mercurial, Fossil provides a complete, all-in-one platform for developing and sharing code with other people. Right out of the box, every Fossil installation comes with a forum, issue tracker, and even a simple IRC chat.

Best Github Alternatives - Fossil Landing Webpage

One unique selling point of Fossil is that it’s easy to deploy and flexible to your machine’s demands. It’s possible to create your Fossil repository from a single binary without any sudo permissions as well as run it as a container using Docker and Docker Compose. This makes it attractive to users who already have a server and need an adaptable code management platform that’s easy to deploy in almost any environment.

Learning some of the best GitHub alternatives that you can install on your machine is just the first step in taking back your digital privacy online. Explore this wonderful world of self-hosting by creating your own bit.ly alternative using Shlink.

Image credit: Yancy Min via Unsplash. All alterations and screenshots by Ramces Red.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Ramces Red
Ramces Red - Staff Writer

Ramces is a technology writer that lived with computers all his life. A prolific reader and a student of Anthropology, he is an eccentric character that writes articles about Linux and anything *nix.