GitLab Installation on Windows using Docker
2 min readSep 4, 2023
Pre-requisites
- Docker Desktop Installed on Windows 10/11
- A folder(Gitlab) was created in the local(`C:\Users\AbdulBasha\OWN\Temporary\Omilia\Gitlab`)
Steps
- Export the `GITLAB_HOME` variable on Windows Powershell using the below command;
$GITLAB_HOME = "C:\Users\AbdulBasha\OWN\Temporary\Omilia\Gitlab"
- Run the below command to start the GitLab container
docker run --detach --hostname gitlab.example.com --publish 443:443 --publish 80:80 --publish 22:22 --name gitlab --restart always --volume $GITLAB_HOME/config:/etc/gitlab --volume $GITLAB_HOME/logs:/var/log/gitlab --volume $GITLAB_HOME/data:/var/opt/gitlab --shm-size 256m gitlab/gitlab-ee:latest
- Wait for 5–10mins
- Check if the docker container status
- Open localhost or 127.0.0.1 locally to get the GitLab page, as below
- Default username is
root
- The default password will be in the container, SSH into the docker container
docker exec it gitlab /bin/bash
and runcat /etc/gitlab/initial_root_password
to get its password
- Successfully installed and logged in
Changing Root Password
To Manually change the root password
Pass the Root Password in Docker
Pass the Root Password as a variable while starting the container, using the below command
docker run --detach --hostname gitlab.example.com --publish 443:443 --publish 80:80 --publish 22:22 --name gitlab --restart always --volume $GITLAB_HOME/config:/etc/gitlab --volume $GITLAB_HOME/logs:/var/log/gitlab --volume $GITLAB_HOME/data:/var/opt/gitlab --shm-size 256m -e GITLAB_ROOT_PASSWORD=Abdul@123 gitlab/gitlab-ee:latest