170

I need a self-hosted replacement for Github. It is crucial it works on firewalled intranet, with no access to the Internet (for example, styles, license checks, etc.).

  1. Relatively good web UI: source code and commit browsing are a must.
  2. Support for git and/or mercurial. Support for both is a plus.
  3. SSH shell (repositories must be accessible over ssh, instead of just http, even though at least git supports all operations over http relatively well)
  4. Permissions: at least
    • private/public repositories
    • read-only and full access
    • Same permission set for web UI and for SSH (when granting/modifying permissions, it should be reflected to both)
    • preferably integration to LDAP (both users and groups for permissions)
  5. Pull requests (aka. merge request)
  6. Administration tools: creating repositories, granting access
  7. Simple issue tracker: creating tickets, commenting, closing, tags/labels
  8. Preferably search, including tickets, users, projects, filenames and inside source code
  9. Preferably forking from web UI
  10. Preferably runs in Linux

Must be either open source (which means it is okay if it is missing some minor functionality) or affordable (>2400€/year for 30 users is too expensive).

I know there is at least:

But I don't have experiences with these - this list is not excluded from answers in any way. However, as I already know there are some alternatives, so I'm not looking for a list of possible solutions, but recommendations based on what you have used and tried. I can use a search engine too, so there is no need to post answers with only copy-pasted content from the first hit.

11 Answers 11

132

We've used GitLab for over a year to host projects of my students.

TL;DR;EDIT: there used to be a demo, but now it's missing. You can register for free and create some public repositories.

I must say I am really satisfied.

As an iteration through your requirement is encouraged on this site, I'll do just that.

  1. Relatively good web UI: You can browse source and history, statistics (global and per user) and graphs of commits (like "network" on Github). You can comment each line of commit from GUI, it's a great feature! Sorry, but I can't provide any screenshots, I'd have to manually anonymise them. Generally it's similar to Github.

  2. Support for git and/or mercurial. Support for both is a plus. Git only.

  3. SSH shell (repositories must be accessible over ssh, instead of just http, even though at least git supports all operations over http relatively well): It's like in Github. HTTP for read-only access, SSH for read-write.

  4. Permissions: at least

    • private/public repositories: It's there.

    • read-only and full access: You can define roles (I believe the defaults are master, developer, reporter, guest).

    • Same permission set for web UI and for SSH (when granting/modifying permissions, it should be reflected to both): I believe it works just like that, but as I don't have admin access right now, it's hard to test. But, again, it's like github.

    • preferably integration to LDAP (both users and groups for permissions): We have that. Everyone logs in via ldap, staff with more privileges than students. BUT I can't really tell if that was very easy, it's just possible.

  5. Pull requests (aka. merge request): Present.

  6. Administration tools: creating repositories, granting access: All from web interface, with a nice searching for users and ability to define groups of users.

  7. Simple issue tracker: creating tickets, commenting, closing, tags/labels: Yep, it's there. Not sure what do you mean by tags tough, couldn't see anything like this. Milestones?

  8. Preferably search, including tickets, users, projects, filenames and inside source code: This would be probably the least fancy feature of gitlab. You can search for users/projects/groups, you can find the content of files, but not a filename. I find it quite clumsy.

  9. Preferably forking from web UI: Present.

  10. Preferably runs in Linux: Obviously ;-)

  11. Upgrade process: it's pretty straightforward if you know your system. Every release has it's own upgrade guide, which is always a bit related to the default, recommended setup (i.e. paths, users, commands etc). If you have a non-standard (in their terms) system, if you customize your setup, you'll have to spend a little while to pimp everything up, but it's never complicated - mainly a new clone, run few scripts and you're done. Never had any problems, but I stopped following the process quite a long time ago. UPDATE Gitlab now includes (as of 6.4.2) an easy upgrade script. Assuming you have the standard system layout, the actual upgrade process is now a single command.

It's under active development with a new release every month, so it's definitely worth trying. It's open-source, free for commercial use.

An Internet connection is not required for Gitlab to work. You will need Internet to set up Gitlab because it downloads its dependencies from RubyGems. Alternatively, you can build a RubyGems mirror, or do the install on another server and copy the complete install directory (by default /home/git/) to this server.

Screenshot

gitlab repository page from version 8.11, August 2016

  • 5
    GitLab now offers packages that you can download and install without an internet connection, meeting the first requirement listed in the question. See about.gitlab.com/downloads – Sytse Sijbrandij Jun 27 '14 at 14:11
  • 4
    I would use GoGS (gogs) instead. 1st, I'm weary of any software that has a pricing/buy button with a "free" (lockin) edition and an enterprise edition with critical features (hooks). Second, because this adds a dependency to Ruby, with all security holes contained in Ruby. GoGS doesn't add any dependencies (apart from the C runtime library, which Ruby uses, too, along with pretty much anything). And Go has an outstanding security record, plus it doesn't link in anything more than the atomic dependencies you actually need (less code - more security). – Stefan Steiger Apr 8 '16 at 10:01
  • 2
    Gitlab has become too bloated and too sluggish now – user3791372 Feb 24 '17 at 23:53
  • 2
    Administration of Gitlab is a mess. I tried installing 4.5 hours without success. – Thomas Weller Jun 27 '17 at 7:00
  • 2
    @ThomasWeller I didn't want to install it specifically because of that, I wanted a fast and easy way to do it. Then I found that TurnkeyLinux has an appliance for it. ISO or VM-Image. You just setup the passwords and basic settings at your first boot. I'm currently testing it and it looks super promising. turnkeylinux.org/gitlab – Broco Mar 15 '18 at 11:16
33

We use Atlassian Stash along with Jira for issue tracking.

Stash

Stash is licensed at $10 for 10 users, $1,800 for 25 users, $3,300 for 50 users, $6,000 for 100 users, and $12,000 for 500 users. Stash itself does not include issue tracking, but a separate issue tracking solution, Jira, is distributed by Atlassian under the same licensing model.

Of course, to address your requirements

  1. You'll have to decide for yourself, but I've had no problems with the Web UI so far. It's highly extensible with support for plugins and a REST API.
  2. Stash only supports Git.
  3. Stash supports http, https, and ssh.
  4. Multiple users (limited by license) and permissions system.
  5. Full repository management including pull requests.
  6. Full admin tools, public facing repositories (accessible without an account), user repositories, and project repositories with access rights.
  7. Integration with Jira issue tracking.
  8. Search by repository, commit, issue, and file.
  9. Fork project repositories, user repositories, etc.
  10. Available on Linux, Windows, and OS X (for evaluation purposes only).
  • Any problems with stash? Overall, good answer. – Olli Feb 12 '14 at 21:54
  • 2
    @Olli Not many that I can think of. The pricing is the main drawback. It'll also require a compatible Oracle Java or OpenJDK installation and supported database installation to install successfully. See supported platforms for more details. – DanteTheEgregore Feb 12 '14 at 22:24
  • there is only one problem which you can't fork any repository from github by web interface. They provide a console based solution! Most users already requested this feature but nobody listening. – Oğuz Çelikdemir Apr 14 '15 at 19:12
  • 1
    GitLab is way ahead on features, and includes a Kanban issue board, issue tracking, and continuous integration in one handy package. And it's free to deploy GitLab CE on your own server. And if you want to pay for support, GitLab EE is cheaper than Stash. – Warren P Aug 24 '16 at 19:32
25

Gogs (Go Git Service) is a painless self-hosted Git Service written in Go. http://gogs.io

I've tried this one and I have found it quite appealing. Simple interface, feature almost on par with what I would expect from a GitHub look alike, and maintainer eager to implement feature and fix bugs. The installation is dead simple. Drop the binary in a folder and call it from the cmd line. The initial configuration is through a config file. And it has Git and Web hooks. Anyway, I hope the following answer the question even if a bit late.

  1. Relatively good web UI: source code and commit browsing are a must. - both present
  2. Support for git and/or mercurial. Support for both is a plus. - only supporting Git
  3. SSH shell (repositories must be accessible over ssh, instead of just http, even though at least git supports all operations over http relatively well) - both SSH and HTTP from what I can tell
  4. Permissions: at least
    • private/public repositories - both
    • read-only and full access - not sure about the read-only, I haven't tried to set it up for any repo yet and I couldn't find the settings after a quick look
    • Same permission set for web UI and for SSH (when granting/modifying permissions, it should be reflected to both) - same thing: I haven't used SSH yet (only accessible on the LAN)
    • preferably integration to LDAP (both users and groups for permissions) - this is either already integrated or in the process of being integrated
  5. Pull requests (aka. merge request) - ofc
  6. Administration tools: creating repositories, granting access - yep
  7. Simple issue tracker: creating tickets, commenting, closing, tags/labels - the usual feature present
  8. Preferably search, including tickets, users, projects, filenames and inside source code - no search from what I can tell apart on the commit UI per repo
  9. Preferably forking from web UI - UI feature present, but I have never used it
  10. Preferably runs in Linux - it runs on anything in can be compiled against. Binary and source available.
  • 3
    If you Gogs, you may want to install Gitea instead. It is a community-managed fork of Gogs So Gogs but better. HN post. – aloisdg Jan 27 '17 at 16:03
  • Looks nice, but definitely still lacks documentation. I e.g. didn't manage associating existing barebone repos with it. I'd like the WebUI, but want to push via the pre-existing setup via the git@ URL. I can do that with repositories created via Gogs/Gitea (which use the same barebones), but the installation doesn't notice those changes. Seems it keeps a record in its database, but I neither found a way to sync. I.e. the push succeeds, but the WebUI doesn't reflect it. Makes no sense to me. I must have missed something here. – Izzy Apr 25 '17 at 21:49
  • 2
    OK, managed it another way. Recommended reading: Installing Gitea on Debian (easy reading and following, can be applied to Gogs as well). Lengthy one: How to Host Your Own Private GitHub with Gogs. What I missed: 1) import your SSH key via the WebUI (don't add it yourself to .ssh/authorized_keys), 2) Create/initialize the repo via the WebUI (not manually via git init). Then it seems to work fine. Found no way yet to adopt an existing barebones repo, though. – Izzy Apr 26 '17 at 6:24
  • 2
    You've saved me several more hours of searching on how to get SSH working @Izzy. A year later, documentation is still a mess. – NetOperator Wibby Apr 24 '18 at 6:47
25

I would propose Tuleap

Tuleap 7 reports

  1. Web UI: currently under heavy lifting (major release due in a couple of weeks, you can have an early preview on demo site)
  2. git, subversion and even cvs are supported
  3. SSH and HTTPS access
  4. Group based access control, repo per repo (read, write, rewind). Can be LDAP or AD backed but not mandatory
  5. Code review and gating comes with Gerrit integation (only ALM to run with native upstream gerrit)
  6. Web based administration with project/repo paradigm. No dependency on central administrator
  7. Comprehensive tracking system. Can be as simple as needed but can also be used for CMM/ITIL/ISO compliance (on the same platform, without an extra tool or plan).
  8. Search is good for tickets but a major improvement is currently backing with the support of ElasticSearch.
  9. Web Fork (personal repo and cross-project repo)
  10. Runs on Linux (RHEL/Centos 6 is recommended for prod)

Plus (as it's a complete ALM, it's not limited to code management)

  • Integrated natively with Jenkins for continuous integration
  • Document management
  • Instant messaging (jabber/XMPP)
  • List, forum and news
  • Very active development (monthly release, handy upgrade process: 2 commands, 1 minute down time).
  • Already used by major industry big players (cannot disclose but easy to find on mailing lists...)

It's 100% Open Source (GPLv2) and you can get professional support from Enalean.

Full disclosure: I'm part of the dev team so, probably not 100% fair ;)

21

I'm using Phabricator, which is developed with Phabricator itself.

Phabricator home page

  1. Relatively good web UI: You can browse code, commits, diffs, search for tasks with specific parameters. Pretty much every app allows you to make a custom search on its data;
  2. Support for git and/or mercurial: There is support for Git, Mercurial, and Subversion;
  3. SSH shell (repositories must be accessible over ssh, instead of just http, even though at least git supports all operations over http relatively well): I can't say for SVN because I haven't tested it, but for Mercurial and Git you can configure each repository to be read-write or read-only for both HTTP and SSH separately;
  4. Permissions:

    • private/public repositories: Check;
    • read-only and full access: You can configure who can view the project and who can push to it in the same page:

    phabricator repo permissions

    • Same permission set for web UI and for SSH (when granting/modifying permissions, it should be reflected on both): See above;
    • preferably integration to LDAP (both users and groups for permissions): For users, you have it. For groups/permissions, I'm not so sure;
  5. Pull requests (aka. merge request): Yes, and you can also create them using the command line, which is really the preferred method;
  6. Administration tools: creating repositories, granting access: See the picture on item 4., you can allow anyone to create repositories if you want, or only allow specific users/groups to do that;
  7. Simple issue tracker: creating tickets, commenting, closing, tags/labels: It's there. You create tasks in Manifest, which allows you to categorize it with Projects (the "Phabricator equivalent" of tags), place it into workboards, and create custom fields for all your tracking purposes;
  8. Preferably search, including tickets, users, projects, filenames and inside source code: Almost every application allows you to perform a search on its data. Commits are searched as well, and for Mercurial and Git there's per-repository code search;
  9. Preferably forking from web UI: not present, although Phabricator isn't supposed to be used the same way as GitHub. You don't keep a separate repository to send changes upstream (see Differential and Arcanist);
  10. Preferably runs in Linux: Yes, it runs on Linux. Also, it is very easy to upgrade to new versions. The Phabricator project HEAD is almost always (specially if you use the stable branch) in a working state, so upgrading is mostly a matter of running git pull and any pending database migrations.
  • 1
    It also has a really nice kanban workboard for managing tasks. – user3791372 Feb 24 '17 at 23:52
19

I have been trying out gitstack for the last couple weeks. I haven't yet fully explored it (ah time is always so short). I'm going to use mainly screenshots from their features list since I'm on the wrong computer right now (and on the wrong network FWIW)

  1. Relatively good web UI: source code and commit browsing are a must: Reasonable - at least so far I haven't run into any problems. web commit view
  2. Support for git and/or mercurial: Only supports git.
  3. SSH shell (repositories must be accessible over ssh, instead of just http, even though at least git supports all operations over http relatively well): http only. Does have full git push pull etc. support (at least advertised I haven't yet tried those features).
  4. Permissions: It has multiple users which can have different permisions so I suppose you could have a user title 'public' and then different private users and give permissions on the repos to those users in a way to make that. However, AFAIK doesn't support one-click private/public switching for example. Supports LDAP as well.
  5. Pull requests (aka. merge request): Yes EDIT: Sorry read that wrong; No it does not AFAIK support pull reqs.
  6. Administration tools: creating repositories, granting access: Yes
  7. Simple issue tracker: creating tickets, commenting, closing, tags/labels: Unfortunately not.
  8. Preferably search, including tickets, users, projects, filenames and inside source code: I think only on commit messages - not on my gitstack machine/network so can't confirm right now.
  9. Preferably forking from web UI: Don't think so - haven't tried but don't recall any such option.
  10. Preferably runs in Linux: Windows only

GitStack is opensource and the sourcecode is on github. Released under GPL as noted on their features page - all features currently although in the future they may add new features to the paid versions and not the free version but as of the November 2013 release that has not happened yet.

In regards to pricing:

  • Free: All features, no support (well "community" support), maximum 2 user accounts.
  • 5 user: $150, email support.
  • 10 user: $300 it is also free for 1 or 2 users; $150/year for 5 users or $300 for 10 users - for more users contact them.
  • Enterprise: email, phone, and remote support, price: contact them.
14

UPDATE 2015: Gitorious will be merged into GitLab, so see the GitLab answer.

Gitorious is a Git hosting and collaboration software that you can install yourself.

It is open source, and you can try it at gitorious.org

Gitorious UI

  1. Relatively good web UI: source code and commit browsing, creating and managing projects and repositories.
  2. Support for git
  3. SSH shell: yes
  4. Permissions: yes
  5. Pull requests: yes
  6. Administration tools: yes
  7. Simple issue tracker: no, but can integrate with Trac
  8. Search: yes
  9. Forking from web UI: yes
  10. Runs on Linux: yes
  • 2
    Have you used (self-installed) gitorious? Do you have any experiences with it? How well the track integration is working? You don't know about 3) and 4)? Please read this meta post. – Olli Feb 13 '14 at 9:16
  • The best thing is that user groups are global, so you can re-use them across projects - as opposed to github, where you have to create new groups for every organization. – cweiske Nov 21 '14 at 12:42
4

RhodeCode Enterprise 3 (https://rhodecode.com) meets 9 out of 10 of your requirements:

  1. Relatively good web UI: YES
  2. Support for git and/or mercurial: YES, supports even both plus Subversion
  3. SSH shell: YES, possible with plugin
  4. Permissions: YES, full enterprise-grade permission system with permission delegation, permission groups, inheritance, LDAP/AD support, etc.
  5. Pull requests: YES, including server-side merges and own, flexible workflows
  6. Administration tools: YES
  7. Simple issue tracker: NO, but easy integration with all issue trackers
  8. Preferably search: YES, complete search over everything
  9. Preferably forking from web UI: YES
  10. Preferably runs in Linux: YES, runs even under Windows

RhodeCode Enterprise is free for 10 users, NGOs and EDUs. It is written in Python, used in production at 10,000+ organizations and was hardened and tuned by these organizations over more than 3 years.

Disclaimer: I am a RhodeCode co-founder.

2

Update: It seems that RhodeCode is NOT actually closed source, it's got a community edition (open source) and some Features (enterprise) are closed source. Given that, I'm not sure how active the Kallithea fork would remain.

Kallithea began as an open-source fork of RhodeCode, the fork was started because RhodeCode went closed Source. Kallithea is free.

It supports Git and Mercurial repositories. It has, not surprisingly all the same user interface as the 2013 edition of RhodeCode.

Main website:

https://kallithea-scm.org

2

As it's not yet listed in the question, nor in the previous answers, there's also Deveo that supports the requirements. There's a free tier we are launching for 5 users, after which the pricing is 36€/user/year.

  1. Relatively good web UI: source code and commit browsing are a must.

Deveo has one of the best UI/UX's there is

  1. Support for git and/or mercurial. Support for both is a plus.

Deveo supports both, in addition to Subversion (SVN)

  1. SSH shell (repositories must be accessible over ssh, instead of just http, even though at least git supports all operations over http relatively well)

Both SSH and HTTPS are supported.

  1. Permissions: at least
    • private/public repositories
    • read-only and full access
    • Same permission set for web UI and for SSH (when granting/modifying permissions, it should be reflected to both)
    • preferably integration to LDAP (both users and groups for permissions)

All of the above use cases are supported. In Deveo, repositories are grouped inside projects, which means you can have backend and frontend repositories in the same project. There's a fine-grained access control that can be utilized both at the project level and also on a repository level. The same permission scheme naturally applies to both repositories and Web UI. Deveo can be integrated to LDAP/AD and in addition, you can configure Deveo to authenticate against a SAML 2.0 based single sign-on service.

  1. Pull requests (aka. merge request)

Pull requests are supported at the moment within the same repository. You can set a number of approvals required before the changes can be merged, and even require a passing build for the branch before the merge can be conducted.

enter image description here

  1. Administration tools: creating repositories, granting access

Deveo supports multiple levels of access for creating repositories and granting access. The access control is role based which makes it simple to understand and use.

  1. Simple issue tracker: creating tickets, commenting, closing, tags/labels

Deveo has a built-in issue tracker that resembles Trello. You can create milestones, which act like trello boards, and drag&drop the issues from a state to another. There's possibility to comment on the issues, add attachments, assign people, label the issues and more.

enter image description here

  1. Preferably search, including tickets, users, projects, filenames and inside source code

You can search most of the content in Deveo.

  1. Preferably forking from web UI

Forking is supported from the UI.

  1. Preferably runs in Linux

All common Linux distributions are supported (Debian, CentOS, Ubuntu, RedHat)

I'm affiliated with Deveo

-3

This is a complement to Piotr Zierhoffer's GitLab answer.

I too have looked into solutions for this (over the last couple of years) and found GitLab to be the most suitable in terms of features, usability, and license. I was pleasantly surprised at how similar it is to GitHub. The answer posted above is superb.

What I'd like to add is that you don't necessarily need to install it from scratch or use the hosted service (or a third-party like GitHost). There are a few VPS and cloud hosting providers that have "one-click" setups for GitLab, and there are images and containers for Amazon Web Services and Docker.

For instance, I recently switched VPS hosting provider to DigitalOcean and was happy to find that they have a one-click "droplet" for GitLab (as well as tutorials for both one-click and manual installation). As for cloud hosting, Amazon EC2 is very affordable and I've seen plenty of tutorials and at least a couple of popular images for GitLab.

Again, apologies for making this a separate answer—I hope you don't mind. I really wanted to mention it, as it can be of value to people looking for the most cost-efficient way of running the software recommended in the accepted answer.

(If anyone is using any of these, it would be interesting to know how it worked out in terms of setup, maintenance, and performance.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.