Introduction

GitLab Community Edition (CE) is a powerful open-source DevOps platform that provides version control, CI/CD capabilities, and collaboration features. This guide will walk you through installing GitLab CE using Docker on Debian 12, making it easy to manage your projects. This setup is ideal for those utilizing a Windows VPS UK for development and deployment.

Prerequisites

  • A server running Debian 12
  • Root or sudo access to the server
  • Docker installed on your system

Step 1: Update Your System

Before installing GitLab, ensure your system is updated:

sudo apt update && sudo apt upgrade -y

Step 2: Install Docker

If you haven't installed Docker yet, you can do so by running the following commands:

sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce -y

After installation, start and enable the Docker service:

sudo systemctl start docker
sudo systemctl enable docker

Step 3: Install Docker Compose

Next, install Docker Compose, which is required to run GitLab:

sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Verify the installation:

docker-compose --version

Step 4: Create a GitLab Docker Compose File

Create a directory for GitLab and navigate into it:

mkdir ~/gitlab
cd ~/gitlab

Create a docker-compose.yml file:

nano docker-compose.yml

Add the following configuration to the file:

version: '3.1'
services:
  gitlab:
    image: 'gitlab/gitlab-ce:latest'
    restart: always
    hostname: 'gitlab.example.com' # Replace with your domain or IP
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://gitlab.example.com' # Replace with your domain or IP
    ports:
      - '80:80'
      - '443:443'
      - '22:22'
    volumes:
      - './gitlab-config:/etc/gitlab'
      - './gitlab-logs:/var/log/gitlab'
      - './gitlab-data:/var/opt/gitlab'

Replace gitlab.example.com with your actual domain name or IP address.

Step 5: Start GitLab

Run the following command to start GitLab:

sudo docker-compose up -d

This command will download the necessary Docker images and start the GitLab service.

Step 6: Access GitLab

Once GitLab is running, you can access it by navigating to http://gitlab.example.com in your web browser. The initial setup will prompt you to set a password for the root user.

Step 7: Conclusion

You have successfully installed GitLab CE using Docker on Debian 12. This setup is perfect for managing your projects effectively, especially when utilizing a Windows VPS. For additional server hosting options, explore various VPS UK Windows solutions, including Windows Virtual Private Server Hosting and Windows VPS Hosting UK.

© 2024 GitLab Installation Tutorial. All rights reserved.

War diese Antwort hilfreich? 0 Benutzer fanden dies hilfreich (0 Stimmen)