Best way to install GitLab on OS X Server?

I’d love to get some input on my ideas on running GitLab alongside OS X Server on Yosemite. I would like to use GitLab together with Xcode server, and I am pretty sure that there are a lot of other iOS or Mac developers out there who would love to do this in a clean way. I researched quite a bit, but I think I need the help of people who understand the system a lot better.
I know there is an installation guide available but it is flawed and wrong in some places imho. (more on that later)

In general I think there are two ways to go about it:

  1. Install GitLab directly on the system
  2. Install GitLab in a virtual machine that is started when the computer boots

The main concerns are:

  • upgradability
  • backup
  • speed/efficiency
  • integration with other tools
  • restrictions that apply with each installation method

Solution 1

Installing directly within OS X seems to be the most efficient way, but I am concerned about how to upgrade the system/GitLab installation later on.
The unofficial installation guide uses mostly homebrew packages for the various components, but it uses them wrong, as the daemons only start when someone is logged into the system, and not at boot time as it would suggest. That could be overcome of course (by actually configuring them right).
Furthermore, the whole setting up users and then hiding them from the login interface is flawed imho. GitLab’s home directory should reside in /Library/GitLab and the users should only be shell/ssh users. I think the last thing could be accomplished something like this for users/groups:

User: dseditgroup -o edit -n /Local/Default -u localadmin -p -a username -t user
Group: dseditgroup -o edit -n /Local/Default -u localadmin -p -a groupname -t group

This should only add the users to have ssh access without log-in through the interface.

The other thing where I hit a snag was using rbenv of course. Not sure how to solve this yet, but I had it running correctly already in a Yosemite virtual machine once. The problem is, that the daemons need to use the right version of ruby and gems, and that can be a pain to set up (with my limited knowledge I admit)

Now concerning upgradabliity, I have no idea how the process works so far.

Solution 2

To me it seems that this would be the far easier solution. It would be possible I guess to set up an Ubuntu VM in VirtualBox or Parallels or VMware that completely houses GitLab. Installation could be done via official installers, and upgrading should be trivial iirc.
The downside would be, aside from an extra 4GB of Linux, that it probably takes quite a lot of resources to run the vm, and it just seems ‘unclean’ to me to run a separate OS just for one application. Of course, if I wanted to install as well, I could do it in the same vm I guess.
Not sure how backing up would work. I don’t want to back up the entire vm but only the data.

I’d be happy to hear if I am thinking in the right direction and if I missed anything (I am sure I did).

I don’t have a Mac, but have you seen this? It seems well maintained.

I have seen this. This is the article I am referring to above.
There are many things wrong with this article, hence my post in the first place.

Oh sorry, didn’t understand that. Perhaps you could contact the author of this installation or point them to this topic and have a discussion :wink:

Hi tkrajacic,
If is there something wrong in the Guide, I will look forward to see your PR at Github with improvements.

Best regards,

I am sorry if my criticism of the guide sounded ungrateful. That was totally not my intention.
The problem, why I didn’t go the PR route right away is that I am no expert on solving the problems either. I am not sure how to fix most of the shortcomings.
Take for example the database setup:

The database is started when a user is logged in via the UI. Sorry, but that is completely useless in a server setup.

If you put the .plist files in /Library/LaunchDaemons instead, the server process will actually start at boot time (maybe needs some modification), but then again, you don’t want the database daemon running as root. And homebrew is set up to be running any of its package as the user who installed it (/usr/local is owned by this user).
If you start chown-ing stuff in /usr/local, this is not going well I’d guess. After all, you still want to have a working homebrew installation for all users on that machine?
I can point out the problems, but I need some input from people who actually know stuff (not like me) to solve them.
Hence the post.

We need to have logged in user in server (for some reasons) so it is not problem for us.

To be honest the guide needs a lot of improvements. For example it should use webapp.plist syntax for set up and starting Gitlab.

I would like to help you but I dont know when I have time to do it.

You should write your ideas for improvements to the guide issues page ( maybe someone other will help you sooner.

Just in case anyone comes across this page with the same question in 2017 (I did not too long ago), I’ve recently installed GitLab 10.1 from source on a Mac Mini running High Sierra (10.13.0) and it seems to be working great.

Although the WebEntity guide is a great starting place, there’s a lot of information in it that’s out of date for current versions of Homebrew, GitLab, and macOS (which now ships with Ruby 2.3.3 so no fumbling with RVM required to install), so during the install process I kept a copy of their README and updated it with changes as I went through. I’ve also tried to make the unofficial Mac instructions closer to the official source install instructions. You can find my updated install guide here. If anyone encounters any issues with it, please make an issue on the GitHub page and I’ll try my best to help.

Also, there’s an actively maintained fork of the WebEntity guide for El Capitan (OS X 10.11) for GitLab CE 10.1 by another user if anyone wants to install on an older Mac server.

Hope this helps someone!


hello @a-hurst,
This is great installation guide thanks for sharing.
I want to know this guide is supported on macOs version 10.12.5?

Hi @dhrutimistry8, glad my updates to the guide were helpful to someone!

I don’t think the High Sierra guide will work on Sierra due to the older version of system Ruby, but the El Capitan guide linked should work. If you encounter any issues at any point you might want to consult the 10.13 guide as well to see if the instructions are any different, as I had to make some addition changes to get it installing that didn’t seem to be required for ElCap but might be for Sierra.

Best of luck!