Create GitLab Environment For Testing.


I want to prepare a minimal, reconstructable and disposable GitLab environment for checking operation and data migration. It does not foresee that it will be used by other users in actual work.


In official documentation there is description how setup GitLab on Docker

It not will be a production operation, it is just a local verification test and data migration, so http://localhost:8081. I think that Docker Desktop for is often used in the verification environment, docker-compose.yml. In this case, docker-compose can be used from the beginning, so it is easier than specifying options .


  • Create directory
root@vagrant:/home/vagrant# mkdir -p /opt/gitlab
  • Specify the path of the volume to be persisted
root@vagrant:/home/vagrant# export GITLAB_HOME=/opt/gitlab
  • Run docker compose
root@vagrant:/home/vagrant# docker-compose up -d

After that, wait for a while, check the startup in the log, access with a browser and change the administrator password. We can find this in easy way.

root@vagrant:/home/vagrant# docker ps
35024e1396aa gitlab/gitlab-ce:latest "/assets/wrapper" 10 minutes ago Up 10 minutes (healthy) 22/tcp, 80/tcp, 443/tcp,>8081/tcp, :::8080->8081/tcp vagrant_web_1
root@vagrant:/home/vagrant# docker exec -it vagrant_web_1 grep 'Password:' /etc/gitlab/initial_root_password

Now we can open URL http://HOST-IP:8080/ and change password, default login is root.

 by the author.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store