Homelab: Self-Hosting GitLab
By Xin Lu profile image Xin Lu
1 min read

Homelab: Self-Hosting GitLab

I like having a Git server that is fully mine.

Not just for code, but for everything around it — credentials, tokens, half-baked experiments, throwaway repos, ugly commits. Yes, some of that is not best practice. But that’s exactly the point: it’s my server, my rules, my risk.

With today’s AI-heavy, fast-iteration “vibe coding”, I’m constantly pushing things that I don’t want to sanitize for public platforms. A private, free, always-available Git server in the home lab removes that mental friction completely.

Below is a minimal, out-of-box Docker Compose setup for GitLab CE. Persistent data lives in Docker volumes. No reverse proxy assumed.

services:
  gitlab:
    image: gitlab/gitlab-ce:18.8.0-ce.0
    container_name: gitlab
    restart: unless-stopped
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://git.example.com'
    ports:
      - '8001:80'   # GitLab Web UI
      - '1022:22'   # Git over SSH
      # - '1443:443' # HTTPS (optional)
    volumes:
      - gitlab_config:/etc/gitlab
      - gitlab_logs:/var/log/gitlab
      - gitlab_data:/var/opt/gitlab

volumes:
  gitlab_config:
  gitlab_logs:
  gitlab_data:

Once it’s up, it stays quiet and boring — exactly what a Git server should be.

By Xin Lu profile image Xin Lu
Updated on
Docker HomeLab