Developer Cookies Blog

Setup Gitlab on Docker

Gitlab is a common wide-used DevOp platform. The platform contains source code management, CI/CD, security, and more features to deliver software rapidly. It pretty easy to run gitlab on-premise or somwhere in the cloud within a docker container. The following part of this text explains the setup.

Remarks: Probably you will need an encrypted website (see article: Generate and renew Let’s Encrypt Certificates for Apache with Certbot Docker container).

  1. Prerequisite: You need a fully running docker platform
  2. Pull Gitlab
    docker pull gitlab/gitlab-ce
  3. Configure and start docker container
    docker run --detach -p 127.0.0.1:4080:80 -p 127.0.0.1:4443:443 -p 127.0.0.1:4022:22 --restart always  -v /<somepath>/config:/etc/gitlab -v /<somepath>/logs:/var/log/gitlab -v /<somepath>/data:/var/opt/gitlab --hostname <some_hostname> --name gitlab-ce gitlab/gitlab-ce:latest
  4. Add ProxyPass into corresponding Apache virtual host configuration file
    ProxyPass / http://127.0.0.1:4080/ retry=0
    ProxyPassReverse / http://127.0.0.1:4080/
  5. Proceed with the webinterface of gitlab

Related Articles