2 min read

It's getting to the point where I have more server resources than I know what to do with. Because of this, I have been looking for more and more services I can self-host. My recent project has involved setting up a GitLab instance, which is an awesome way to get going with self hosted Git repositories.

GitLab is a fantastic completely open source alternative to something like GitHub. Although many base features are shared between the two platforms, GitLab does contain some additional functionality and customization. One of these additional features is the fact that GitLab can be self-hosted with their CE (Free) or EE releases.

Some of the supported installation methods

Getting started was very straightforward with their Omnibus package by following their OS specific guide found here. Once installed, you will spend most of your time configuring the installation settings inside the gitlab.rb file located in the /etc/gitlab folder. The file is well documented with the configuration options and it is very easy to get going. It should be noted that after you modify that file, you will want to run #gitlab-ctl reconfigure to apply your changes.

And that's it! Sort of...  If you are planning on running your GitLab instance behind a reverse proxy that also handles SSL, there are a few settings you are going to want to pay attention to:

Property Value Notes
external_url 'https://gitlab.mydomain.com' GitLab to only accept URLs starting with https://
nginx['listen_port'] 80 Make sure the GitLab Nginx server listens on port 80 exclusively
nginx['listen_https'] false Prevent the GitLab Nginx server from listening to https requests
pages_external_url "https://gitlab.mydomain.com" Specify the URL that repository-specific pages should be accessed through
pages_nginx['listen_port'] 80 Set the GitLab Pages Nginx server to listen on port 80 exclusively
pages_nginx['listen_https'] false Prevent the GitLab Pages Nginx server from listening to https requests
registry_external_url 'https://gitlab.mydomain.com' Specify the URL that the Nginx Registry should be accessed through (Not sure if this is 100% necessary or not)
registry_nginx['listen_port'] 80 Set the Nginx Registry server to listen on port 80 exclusively (Not sure if this is 100% necessary or not)
registry_nginx['listen_https'] false Prevent the Nginx Registry server from listening to https requests

Once up and running, GitLab has many customization and configuration options that are well worth exploring.

From here on out, any projects or code I am working on will be hosted on both GitHub and GitLab. I may eventually move everything over to GitLab, but that is another project for another day.

Carson Seese

Carson Seese

Read more posts by this author.