Self-hosted GitLab Community Edition running in containers.
- Podman and Podman Compose installed
- Add
127.0.0.1 gitlab.localto your hosts file:- Windows:
C:\Windows\System32\drivers\etc\hosts - Linux/Mac:
/etc/hosts
- Windows:
# Start GitLab
podman compose up -d
# Watch startup logs (takes 3-5 minutes on first boot)
podman logs -f gitlabAccess GitLab at: https://gitlab.local:8443
Default login:
- Username:
root - Password: See
GITLAB_ROOT_PASSWORDin.env
| Variable | Description |
|---|---|
GITLAB_HOSTNAME |
Hostname for GitLab (must match hosts file) |
GITLAB_ROOT_PASSWORD |
Initial root password (first boot only) |
GITLAB_HTTP_PORT |
HTTP port mapping |
GITLAB_HTTPS_PORT |
HTTPS port mapping |
GITLAB_SSH_PORT |
SSH port for git operations |
TZ |
Timezone |
GITLAB_RUNNER_TOKEN |
Shared runner registration token |
Edit config/gitlab.rb to customize GitLab settings, then apply:
podman exec -it gitlab gitlab-ctl reconfigureOr restart the container:
podman compose restartpodman exec -it gitlab gitlab-rake "gitlab:password:reset[root]"Or via Rails console:
podman exec -it gitlab gitlab-rails console -e productionuser = User.find_by_username('root')
user.password = 'NewPassword123!'
user.password_confirmation = 'NewPassword123!'
user.save!
exit# Stop and remove containers + volumes
podman compose down -v
# Clean local directories
Remove-Item -Recurse -Force data\*, logs\*
Get-ChildItem config -Exclude gitlab.rb | Remove-Item -Recurse -Force
# Start fresh
podman compose up -dpodman exec -it gitlab gitlab-ctl status# Container logs
podman logs -f gitlab
# GitLab internal logs
podman exec -it gitlab gitlab-ctl tail| Service | Container Port | Host Port |
|---|---|---|
| HTTP | 80 | 8080 |
| HTTPS | 443 | 8443 |
| SSH | 22 | 2222 |
git clone ssh://git@gitlab.local:2222/username/repo.gitA GitLab Runner container is included for CI/CD pipelines.
The runner automatically registers with GitLab on startup using the GITLAB_RUNNER_TOKEN from .env. It will:
- Wait for GitLab to be available
- Register itself as a shared runner
- Start processing jobs
View registration progress:
podman logs -f gitlab-runnerIf you need to register manually or add additional runners:
podman exec -it gitlab-runner gitlab-runner register \
--url "https://gitlab.local:8443" \
--registration-token "YOUR_TOKEN" \
--executor "docker" \
--docker-image "alpine:latest" \
--tls-verify=false# Check runner status
podman exec -it gitlab-runner gitlab-runner status
# List registered runners
podman exec -it gitlab-runner gitlab-runner list
# Verify runner connection
podman exec -it gitlab-runner gitlab-runner verify
# View runner logs
podman logs -f gitlab-runnerpodman exec -it gitlab-runner gitlab-runner unregister --all-runners