Running Gitlab Community Edition Locally

GitLab is perhaps not as popular as GitHub, but several Open Source projects are hosted on the public cloud patform. It also has a "free" option, similar to GitHub.

However, I believe the true attraction of GitLab is the option to host it yourself. In this respect, there are also two option: a commercial version (Enterprise Edition), and a community edition.

Traditionally, setting up these kinds of services used to be a pain. However, container images and platforms like Docker, has really made the distribution and installation of these services a breeze.

I have prepared a Gist that demonstrates an approach to easily host GitLab on your local machine using Docker. To get up and running takes less than 10 minutes!

Personally I use these types of local Git repositories for development and testing of CI/CD pipelines - for example using Jenkins and Groovy scripts. It allows you to provision a local Git repository for experimentation without potentially breaking things. It is also ideal for the development and testing of GitOps pipelines, for example when you are trying out ArgoCD.

In the Gist, I demonstrate the use of local Docker volumes in order to persist data. When updating GitLab, you basically just delete the current Docker image and adjust the version to the latest. If you don't skip to many versions, the upgrade should happen fairly smoothly, but please consult the documentation for more detailed instructions and guidance.

I hope you can also find this approach useful!


git, gitlab