Enabling GitLab Container Registry (Omnibus Edition) – A Complete Guide

Enabling GitLab Container Registry (Omnibus Edition) – A Complete Guide

- 4 mins

📦 Introduction

This guide helps you enable and configure the GitLab Container Registry on a self-hosted GitLab Omnibus instance. It includes two deployment paths:

  1. Cloudflare Tunnel Setup – Secure tunneling with no SSL certs
  2. 🔐 NGINX with SSL Certificates – Classic public-facing deployment

⚙️ Prerequisites

Before you begin:

📘 Reference: Official GitLab Docs
https://docs.gitlab.com/administration/packages/container_registry/


Method 1: GitLab Registry via Cloudflare Tunnel (No SSL Certs Required)

✅ Best for home/self-hosted environments with dynamic IPs or blocked ports.

Step 1: Set Up Cloudflare Tunnel

  1. Create a Cloudflare Tunnel using cloudflared
  2. Define your public hostname like this:

gitlab-regis

This tells Cloudflare to expose the internal plain HTTP registry endpoint securely via HTTPS.

❗️Make sure Type is set to HTTP, not HTTPS, because the GitLab registry does not serve HTTPS directly in this setup.


Step 2: Configure GitLab

Edit /etc/gitlab/gitlab.rb:

gitlab_rails['gitlab_default_projects_features_container_registry'] = true
registry_external_url 'http://localhost:5050'  (or private ip of Gitlab server)
gitlab_rails['registry_enabled'] = true

gitlab-regis

Apply changes:

sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart

Step 3: Allow HTTP Login from Docker

Docker by default requires HTTPS for registries. Since we’re using HTTP (via Cloudflare tunnel), you must explicitly mark it as insecure.

Edit /etc/docker/daemon.json on the client machine:

{
  "insecure-registries": ["gitlab.registry.guneycansanli.com"]
}

gitlab-regis

Then restart Docker:

sudo systemctl restart docker

Step 4: Test Login

docker login gitlab.registry.guneycansanli.com

If successful, you should see:

Login Succeeded

gitlab-regis

Test from another VM :

gitlab-regis


Method 2: Traditional Registry with NGINX + SSL

🔐 Best for production/public GitLab deployments

Step 1: Set Up SSL Certificates

Ensure certs are placed here:

/etc/gitlab/ssl/gitlab.registry.guneycansanli.com.crt
/etc/gitlab/ssl/gitlab.registry.guneycansanli.com.key

Use Let’s Encrypt, ZeroSSL, or custom certs.


Step 2: Configure GitLab

Update /etc/gitlab/gitlab.rb:

registry_external_url 'https://gitlab.registry.guneycansanli.com'

gitlab_rails['registry_enabled'] = true
gitlab_rails['registry_host'] = 'gitlab.registry.guneycansanli.com'
gitlab_rails['registry_port'] = 5050

registry_nginx['enable'] = true
registry_nginx['listen_port'] = 5050
registry_nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.registry.guneycansanli.com.crt"
registry_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.registry.guneycansanli.com.key"

Reconfigure:

sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart

Step 3: Open Port 5050

sudo ufw allow 5050/tcp

Step 4: Test

curl -v https://gitlab.registry.guneycansanli.com/v2/
docker login gitlab.registry.guneycansanli.com

✅ Using the Registry

You can now push images like this:

docker tag myapp gitlab.registry.guneycansanli.com/group/project/myapp:latest
docker push gitlab.registry.guneycansanli.com/group/project/myapp:latest

You’ll see registry URLs in GitLab at:

Project → Packages & Registries → Container Registry

🐛 Debug Logs

To check the registry service:

sudo gitlab-ctl tail registry

🧠 Final Notes

gitlab-regis

gitlab-regis


🔗 Resources


Thanks for reading!

:+1: :+1: :+1: :+1: :+1: :+1:

— Guneycan Sanli

Guneycan Sanli

Guneycan Sanli

A person who like learning, music, travelling and sports.

comments powered by Disqus