How to Setup GitLab Server Self-managed using Docker/Podman Compose

AH
Ahmad Lukman Hakim

Dedicated Author of LUKMANLAB

# gitlab# docker

Goal

  • Setup GitLab Server on Ubuntu Server using Docker Compose / Podman Compose

How to

  • Create docker-compose.yml file:
vi docker-compose.yml
  • Copy this into that file:
version: '3.6'
services:
  gitlab:
    image: 'docker.io/gitlab/gitlab-ce:17.5.1-ce.0'
    container_name: gitlab
    restart: always
    hostname: 'gitlab.lukmanlab.com'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        # Add any other gitlab.rb configuration here, each on its own line
        external_url 'https://gitlab.lukmanlab.com'
    ports:
      - '8480:80'
      - '8443:443'
      - '8422:22'
    volumes:
      - './config:/etc/gitlab'
      - './logs:/var/log/gitlab'
      - './data:/var/opt/gitlab'
    shm_size: '256m'
  • Execute Docker Compose
docker-compose up -d

If you are using Podman, you can use podman-compose up -d