Setting Up GitLab Docker Environment on Windows 10
GitLab Community Edition (CE) does not current offer a dedicated installer package for Windows. Hence, one of the most straightforward methods too deploy GitLab on a Windows system is through Docker. This guide aims to provide a comprehensive walk-through of the installation process, making it accessible even to those less familiar with Docker or GitLab.
Prerequisites
Before starting, ensure your system complies with the following requirements:
- Operating System: Windows 10 Pro, version 20H2, build 19042.631
- Software: Docker Desktop 3.1.0
- Tool Image: GitLab CE version 13.8.4
Step 1: Enable WSL 2
Windows Subsystem for Linux (WSL) must be enabled to support Docker. Follow these instructions to prepare your environment:
-
Enable Windows Subsystem for Linux: Open PowerShell with administrative privileges and execute the command:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestartRestart your system when prompted.
-
Enable Virtual Machine Feature: Run the following command from PowerShell:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestartRestart your computer to finalize these settings.
-
Install WSL Kernel Update Package: Download and install the latest Linux kernel update package.
-
Set WSL 2 as the Default Version: Execute:
wsl --set-default-version 2
Step 2: Install Docker Desktop
-
Downloda: Obtain the Docker Desktop installer executable from Docker's download page.
-
Install: Run the installer and follow the configuration instructions. Ensure "Install required Windows components for WSL 2" is selected.
-
Verify Installation: Open PowerShell and check Docker's installation using:
docker --version
Step 3: Setup GitLab Using Docker
-
Pull GitLab's Docker Image:
docker pull gitlab/gitlab-ce:13.8.4-ce.0Alternatively, if the version number is unnecessary, omit it for the latest image:
docker pull gitlab/gitlab-ce -
Create Data Volumes: Use the following commands:
docker volume create gitlab-data-vol docker volume create gitlab-log-vol docker volume create gitlab-config-vol -
Run GitLab Container: Execute:
docker run --detach ` --publish 443:443 --publish 80:80 --publish 22:22 ` --name gitlab ` --restart always ` --volume gitlab-config-vol:/etc/gitlab ` --volume gitlab-log-vol:/var/log/gitlab ` --volume gitlab-data-vol:/var/opt/gitlab ` gitlab/gitlab-ce:13.8.4-ce.0
* Ensure the above command is adapted if run on a terminal requiring different line continuation syntax.
- Verify Installation: Check the running container:
docker ps
Access GitLab
Once the container and necessary configurations are set, GitLab can be accessed via http://localhost from your browser. Additional configuration, such as defining the external URL or setting up SSL certificates, can be customized within the GitLab container itself.
For further customization and advanced features, refer to GitLab's official Docker documentation.