Install gitlab on docker with systemd

1. Install docker

$ sudo apt-get install
$ sudo service docker start
# Add user into docker group to use docker command without sudo.
$ sudo adduser <username> docker

2. Pull gitlab community edition image

$ docker pull gitlab/gitlab-ce

3. Configure systemd service

Description=Gitlab in docker.

ExecStartPre=-/usr/bin/docker rm gitlab-ce
ExecStart=/usr/bin/docker run --rm \
          --name gitlab-ce \
          --volume /srv/gitlab/config:/etc/gitlab \
          --volume /srv/gitlab/logs:/var/log/gitlab \
          --volume /srv/gitlab/data:/var/opt/gitlab \
          --publish 80:80 --publish 2222:22 \
ExecStop=/usr/bin/docker stop gitlab-ce

$ sudo systemctl enable gitlab-docker


I'm a hacker, I want to improve life.

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.