Self‑hosted GitLab stack (CE) packaged with Docker Compose for fast local or medium‑scale deployments.
- What the project does
- Why this is useful
- Quick start
- Key files
- Where to get help
- Maintainers & contributing
Gitlab‑ce Dockerized provides a minimal, reproducible Docker Compose stack that runs:
- GitLab (official Docker image)
- PostgreSQL (database)
- Redis (cache and job queue)
It wires these services together using a named Docker network and mounts persistent volumes so data survives container restarts.
- Start a full GitLab instance locally in minutes for development, testing, or small self‑hosted usage.
- All configuration is controlled via environment variables for easy customization.
- Uses official images (GitLab, Postgres, Redis) with persistent volumes for safety.
- Designed to be simple and opinionated so it’s easy to adapt to your environment.
- Docker Engine (20.x+)
- Docker Compose (v1.27+ or Compose v2)
- Basic knowledge of Docker and port configuration
- A Docker network named
gitlab_network(the compose file expects this; instructions below create it)
- Clone the repository
git clone https://github.com/amintoorchi/Gitlab-ce-dockerized.git
cd Gitlab-ce-dockerized- Copy the example environment file and edit it
cp .env.example .env
# Edit .env and fill in DB_PASSWORD, GITLAB_ROOT_PASSWORD, HOST_NAME, SSH_PORT, GUI_PORT, BASE_VOLUMES_PATH, EXTERNAL_URL, etc.See .env.example for all available variables and guidance.
This project expects an external Docker network called gitlab_network. Create it if missing:
docker network create gitlab_networkStart the stack:
docker-compose up -d- Web UI: http://<HOST_NAME>:<GUI_PORT> (or use EXTERNAL_URL)
- SSH: <HOST_NAME> on port <SSH_PORT> (mapped to container SSH 22)
The Compose configuration maps ports, mounts persistent volumes and sets the GitLab Omnibus config via environment. Example excerpt:
services:
gitlab:
image: gitlab/gitlab-ee:latest
container_name: gitlab
hostname: ${HOST_NAME}
restart: unless-stopped
shm_size: "${SHM_SIZE}"
ports:
- "${SSH_PORT}:22"
- "${GUI_PORT}:80"
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url '${EXTERNAL_URL}'
gitlab_rails['db_password'] = '${DB_PASSWORD}'
gitlab_rails['initial_root_password'] = "${GITLAB_ROOT_PASSWORD}"You can view the full Compose file at docker-compose.yml.
- Pull new images and restart:
docker-compose pull
docker-compose up -d- Stop and remove containers:
docker-compose downVolumes remain on disk (under the path you set with BASE_VOLUMES_PATH) unless explicitly removed.
docker-compose.yml— main Compose stack (GitLab, Postgres, Redis).env.example— example environment variables (copy to.envand edit)
Both files are in the repository root and are the primary configuration surface for the stack.
- Official GitLab Docker docs: https://docs.gitlab.com/ee/install/docker.html
- Open an issue in this repository for bugs, feature requests, or questions: https://github.com/amintoorchi/Gitlab-ce-dockerized/issues
- Check container logs for troubleshooting:
- GitLab:
docker logs -f gitlab - Postgres:
docker logs -f gitlab-db - Redis:
docker logs -f gitlab-redis
- GitLab:
- Maintained by: amintoorchi (GitHub: @amintoorchi)
- Contributions welcome — please open issues or PRs.
- If you have project-specific contribution rules, add a
CONTRIBUTING.mdfile. In the meantime, use GitHub Issues to discuss changes.
- Use strong, unique passwords in
.envand protect this file (do not commit secrets). - For production use, consider:
- Using GitLab Enterprise or an externally managed database per GitLab recommendations.
- Adding backups for PostgreSQL and
/var/opt/gitlabdata. - Placing GitLab behind a reverse proxy (Nginx, Traefik) and enabling HTTPS / LetsEncrypt.
If you want, I can:
- Open a pull request that replaces the current minimal README with this expanded version, or
- Commit the README directly to the repository (I will need repo write access).