Installing Znuny with Docker Compose
Docker Compose is the fastest way to get a Znuny test system, demo, or staging environment running. Prefer the official znuny/znuny-docker project. Community stacks remain useful when you want a web installer, Znuny 6.x LTS extras, or PostgreSQL.
Related: Znuny Docker operations · Staging system · Official install docs
Choose a Docker stack
Section titled “Choose a Docker stack”| Stack | Best for | Znuny versions | First login |
|---|---|---|---|
| znuny/znuny-docker (official) | Split httpd + daemon + MariaDB | 7.3.x (build arg ZNUNY_VERSION) | Auto-install; admin password from .env |
| Erik-Donath/znuny-docker | Web installer workflow | 7.1+ | http://<host>:8080/znuny/installer.pl |
| juanluisbaptiste/docker-otrs | Built-in backups, SMTP relay | 6.x LTS | Pre-configured or /otrs/installer.pl |
This guide walks through znuny/znuny-docker. Compose reads docker-compose.yml or compose.yml — the official repo uses docker-compose.yml.
System requirements
Section titled “System requirements”| Component | Minimum | Recommended (staging) |
|---|---|---|
| CPU | 2 cores | 4+ cores |
| RAM | 4 GB | 8 GB or more (official defaults reserve ~5 GB across services) |
| Disk | 20 GB free | 40 GB+ (SSD) |
| Docker | 20.10 | latest |
| Docker Compose | v2 | latest |
| Git | 2.17 | latest |
Step 1: Install Docker, Docker Compose, and Git
Section titled “Step 1: Install Docker, Docker Compose, and Git”On Windows or macOS, install Docker Desktop.
docker --versiondocker compose versionStep 2: Clone the official project
Section titled “Step 2: Clone the official project”sudo git clone https://github.com/znuny/znuny-docker.git /opt/znuny-dockercd /opt/znuny-dockerReview docker-compose.yml, dockerfiles/, and .env.example before starting.
Step 3: Create .env
Section titled “Step 3: Create .env”cp .env.example .envSet all three required passwords (the compose file refuses to start without them):
ROOT_PASS=<secure_mariadb_root>DB_USER_PASS=<secure_znuny_db>ZNUNY_ADMIN_PASS=<secure_admin>Useful optional keys:
| Variable | Default | Purpose |
|---|---|---|
external_port | 80 | Host HTTP port |
DB_HOST | znuny-db | Database hostname inside the stack |
ZNUNY_IMAGE_TAG | latest | Tag when pulling pre-built images |
CONTAINER_REGISTRY | znuny | Use ghcr.io/znuny/znuny-docker to pull instead of build |
DEFAULT_INTERFACE | agent | Default UI: agent or customer |
Step 4: Start the stack
Section titled “Step 4: Start the stack”Build locally (downloads the Znuny tarball; default version in the Dockerfile is 7.3.1):
sudo docker compose up -d --buildOr pull official images:
CONTAINER_REGISTRY=ghcr.io/znuny/znuny-dockerZNUNY_IMAGE_TAG=stablesudo docker compose up -dPin a release at build time:
sudo docker compose build --build-arg ZNUNY_VERSION=7.3.1 znuny-basesudo docker compose up -d --buildZNUNY_VERSION also accepts nightly and lts-nightly.
Check health:
sudo docker compose pssudo docker compose logs -f znuny-httpd| Service | Container | Role |
|---|---|---|
znuny-httpd | znuny_httpd | Apache, first-boot install |
znuny-daemon | znuny_daemon | Background jobs |
znuny-db | znuny_db | MariaDB |
First boot can take several minutes (start_period on httpd is 300s).
Step 5: Open Znuny
Section titled “Step 5: Open Znuny”http://<your-server-ip>/znuny/If you changed external_port, use that port. Log in with the initial admin account and ZNUNY_ADMIN_PASS. There is no installer.pl step on the official stack.
HTTPS (Traefik) and external database
Section titled “HTTPS (Traefik) and external database”# TLS with Let's Encryptsudo docker compose -f docker-compose.yml -f docker-compose.traefik.yml up -d --buildSet ZNUNY_DOMAIN and ACME_EMAIL in .env.
# Existing MariaDB/MySQLsudo docker compose -f docker-compose.yml -f docker-compose.external-db.yml up -d --buildSet DB_HOST, DB_NAME, DB_USER, and DB_USER_PASS to the external server. ROOT_PASS remains required by the base file but is unused.
After installation
Section titled “After installation”Console commands
Section titled “Console commands”sudo docker exec -u znuny znuny_daemon /opt/znuny/bin/znuny.Console.pl Listsudo docker exec -u znuny znuny_daemon /opt/znuny/bin/znuny.Console.pl Maint::Cache::DeletePersisted data
Section titled “Persisted data”| Volume | Contents |
|---|---|
ZnunyApp | Application files |
ZnunyPersistent | Config.pm, version, restart triggers |
MariaDBVol | Database files |
Back up before upgrades — see Znuny Docker operations.
Firewall
Section titled “Firewall”Open external_port (default 80) or terminate TLS with Traefik / another reverse proxy.
Updating Znuny
Section titled “Updating Znuny”- Back up
MariaDBVol,ZnunyApp, andZnunyPersistent. - Read the official README — the upgrade process is still incomplete.
- Local build:
docker compose build --build-arg ZNUNY_VERSION=<new> znuny-basethendocker compose up -d --build. - Pre-built: set
ZNUNY_IMAGE_TAG, thendocker compose pull && docker compose up -d.
The httpd entrypoint compares /persistent/version and runs upgrade.sh when the image version differs.
Troubleshooting
Section titled “Troubleshooting”Containers exit because .env is incomplete
Compose requires ROOT_PASS, DB_USER_PASS, and ZNUNY_ADMIN_PASS.
Port 80 already in use
Set external_port=8080 (or another free port) in .env and recreate the stack.
Daemon not healthy
httpd must become healthy first (install/upgrade). Check docker compose logs znuny-httpd.
View logs / stop
sudo docker compose logs -f znuny-httpdsudo docker compose logs -f znuny-daemonsudo docker compose logs -f znuny-dbsudo docker compose down # keeps volumessudo docker compose down --volumes # deletes dataCommunity stacks (alternatives)
Section titled “Community stacks (alternatives)”Use these when the official stack does not fit.
Erik-Donath (web installer)
Section titled “Erik-Donath (web installer)”sudo git clone https://github.com/Erik-Donath/znuny-docker.git /opt/znuny-docker-communitycd /opt/znuny-docker-community# replace default passwords in docker-compose.yamlsudo docker compose up --build -dOpen http://<host>:8080/znuny/installer.pl. Database host is db, not localhost. Services are typically znuny-app and db.
juanluisbaptiste (6.x LTS)
Section titled “juanluisbaptiste (6.x LTS)”See juanluisbaptiste/docker-otrs for SMTP relay and automated backups.
Next steps
Section titled “Next steps”- Znuny Docker operations — console commands, packages, backups
- Staging system — safe test environment
- Znuny REST API
- Official installation docs — bare-metal installs
- znuny-docker README — architecture, env vars, CI
Frequently asked questions
Does Znuny ship an official Docker Compose stack?
Yes. Since 2026 Znuny publishes github.com/znuny/znuny-docker with docker-compose.yml and images on ghcr.io. The project still calls the stack experimental.
Do I need the web installer on the official stack?
No. install.sh configures the database from .env on first start. Use ZNUNY_ADMIN_PASS to log in. Community stacks such as Erik-Donath still use installer.pl and database host db.