Gitlab Docker Custom Ports does not start up

Hello,
I am trying to run latest gitlab docker image with custom ports for HTTP (60000) HTTPS(60001) and SSH(60002).
For this, I created the folder /srv/gitlabNB/ and started the instance like so:

 sudo docker run --detach \
 --hostname gitlab.testdomain.de \
 --publish 60000:60000 --publish 60001:60001 --publish 60002:60002 \
 --name gitlabNB \
 --restart always \
 --volume /srv/gitlabNB/config:/etc/gitlab \
 --volume /srv/gitlabNB/logs:/var/log/gitlab \
 --volume /srv/gitlabNB/data:/var/opt/gitlab \
 gitlab/gitlab-ce:latest

I let it configure itself and did following changes in /srv/gitlabNB/config/gitlab.rb

Set external_url "https://gitlab.testdomain.de:60000"
Set gitlab_rails['gitlab_shell_ssh_port'] = 60002
Set nginx['listen_port'] = 60000
UFW allows Ports 60000-60002 for TCP from anywhere
Ran gitlab-ctl reconfigure . Chef runs successfully
gitlab-ctl status results in:

run: alertmanager: (pid 310) 686s; run: log: (pid 308) 686s
run: gitaly: (pid 316) 686s; run: log: (pid 307) 686s
run: gitlab-exporter: (pid 325) 686s; run: log: (pid 322) 686s
run: gitlab-workhorse: (pid 312) 686s; run: log: (pid 309) 686s
run: grafana: (pid 321) 686s; run: log: (pid 306) 686s
run: logrotate: (pid 339) 686s; run: log: (pid 336) 686s
run: nginx: (pid 300) 686s; run: log: (pid 298) 686s
run: postgres-exporter: (pid 318) 686s; run: log: (pid 317) 686s
run: postgresql: (pid 299) 686s; run: log: (pid 297) 686s
run: prometheus: (pid 303) 686s; run: log: (pid 301) 686s
run: puma: (pid 315) 686s; run: log: (pid 314) 686s
run: redis: (pid 324) 686s; run: log: (pid 320) 686s
run: redis-exporter: (pid 313) 686s; run: log: (pid 305) 686s
run: sidekiq: (pid 304) 686s; run: log: (pid 302) 686s
run: sshd: (pid 30) 707s; run: log: (pid 29) 707s

So everything should be up and running, yet, when I try to access gitlab.testdomain.de:60001 or gitlab.testdomain.de:60000 Firefox prompts “Server not reachable”
In a previous run of gitlab-ctl reconfigure I got a bunch of the following errors, yet they dont seem to be in the last reconfigure run:

==> /var/log/gitlab/sidekiq/current <==
{"severity":"ERROR","time":"2022-01-28T13:00:17.933Z","message":"Error fetching job: Error connecting to Redis on /var/opt/gitlab/redis/redis.socket (Errno::ENOENT)"}

Did I miss something / did I do something wrong in my setup?
I’ve seen this forum post (Running gitlab-docker on custom ports - #2 by dcpc007) and tried to do what they did, yet it didnt work.

Thanks in advance

Hi, have you already solved the problem? If not, I will write you what I do.

1 Like

Hey, thank you for your reply.
I actually found my problem. It had nothing to do with gitlab, but with docker. Somehow I managed to not map the ports correctly, even tho I could have sworn that I ONLY used the docker command I described above.
TL;DR: docker ps to check if the ports are correctly mapped
I’ll mark the topic as solved. Currently working on getting letsencrypt validation with custom ports, but I think the easiest way here would be to use the certbot on host machine to generate the certificate.

indeed, it’s a problem with letsencrypt validation when you are using custom ports. What I thought (but never tried) is to install a web server (e.g. Apache), which would answer on port 80 - just for validation.

Thats also worth a try. Thank you for the hint, I’ll look into that.