GitLab

Build a self-hosted GitLab

Get Docker CE

Instructions for Ubuntu

Download docker-compose

Instructions

Create docker-compose.yml and replace {host_ip} to the actual IP address of the server.

version: "3.6" 
services:
  web:
    image: 'gitlab/gitlab-ce'
    container_name: 'gitlab'
    restart: always
    hostname: {host_ip}
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://{host_ip}:8081'
    networks:
      - gitlab-network
    ports:
      - '80:80'
      - '443:443'
      - '8081:8081'
      - '22:22'
    volumes:
      - '/srv/gitlab/config:/etc/gitlab'
      - '/srv/gitlab/logs:/var/log/gitlab'
      - '/srv/gitlab/data:/var/opt/gitlab'

networks:
  gitlab-network:
    name: gitlab-network

Start GitLab

Given username is "root".

References

Last updated

Was this helpful?