Installing Znuny with Docker Compose
Docker Compose is the fastest way to get a Znuny test system, demo, or staging environment running. Unlike OTOBO, Znuny does not ship an official znuny-docker stack from the project maintainers — community-maintained compose projects fill that gap.
Related: Znuny Docker operations · Staging system · Official install docs
Choose a Docker stack
Section titled “Choose a Docker stack”| Stack | Best for | Znuny versions | Installer URL |
|---|---|---|---|
| Erik-Donath/znuny-docker | Znuny 7.x, web installer workflow | 7.1+ (configurable at build) | /znuny/installer.pl |
| juanluisbaptiste/docker-otrs | Mature all-in-one stack, backups built in | Znuny 6.x LTS | Pre-configured or /otrs/installer.pl |
This guide walks through Erik-Donath/znuny-docker because it matches the current Znuny 7.x installer path. For Znuny 6.x LTS with automated backups and SMTP relay, see the juanluisbaptiste project and Znuny Docker operations.
System requirements
Section titled “System requirements”| Component | Minimum | Recommended (staging / production) |
|---|---|---|
| CPU | 2 cores | 4+ cores |
| RAM | 4 GB | 8 GB or more |
| 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”Install Docker on your server. Distribution-specific steps:
On Windows or macOS, install Docker Desktop and run the commands below in a terminal.
Verify:
docker --versiondocker compose versionStep 2: Clone the compose project
Section titled “Step 2: Clone the compose project”cd /optsudo git clone https://github.com/Erik-Donath/znuny-docker.git /opt/znuny-dockercd /opt/znuny-dockerReview docker-compose.yaml and Dockerfile before starting — especially passwords, ports, and the ZNUNY_VERSION build argument.
Step 3: Configure database credentials
Section titled “Step 3: Configure database credentials”Edit docker-compose.yaml and replace all default passwords:
db: environment: MYSQL_ROOT_PASSWORD: <secure_root_password> MYSQL_PASSWORD: <secure_znuny_password>The compose file maps Znuny on port 8080 by default (8080:80). Change the host port if 8080 is already in use.
Step 4: Build and start the stack
Section titled “Step 4: Build and start the stack”sudo docker compose up --build -dOn first run, Docker downloads base images and builds the Znuny app image. This can take several minutes.
Check that both containers are healthy:
sudo docker compose pssudo docker compose logs -f znuny-appExpected services:
| Service | Role |
|---|---|
znuny-app | Apache + Znuny application, cron, daemon |
db | MariaDB with Znuny-tuned settings |
Step 5: Complete the web installer
Section titled “Step 5: Complete the web installer”Open the installer in your browser:
http://<your-server-ip>:8080/znuny/installer.plFollow the installer and note:
- Choose MariaDB as the database type.
- Database host:
db(the Compose service name — notlocalhost). - Database user / password: use the values from your
docker-compose.yaml(MYSQL_USER,MYSQL_PASSWORD). - Root password: use
MYSQL_ROOT_PASSWORDwhen the installer asks for the database administrator password.
When finished, log in to the agent interface. The default admin user is root@localhost; the installer shows the password at the end.
Step 6: Verify background jobs
Section titled “Step 6: Verify background jobs”Znuny needs cron and the daemon for mail fetch, escalations, and generic agents. The Erik-Donath image runs these inside znuny-app. Confirm they are active:
sudo docker compose exec znuny-app bashbin/Cron.sh statusexitIf jobs are not running, check container logs and the official cron documentation.
After installation
Section titled “After installation”Enter the app container
Section titled “Enter the app container”sudo docker compose exec znuny-app bashbin/znuny.Console.pl --helpPersisted data (volumes)
Section titled “Persisted data (volumes)”The stack stores data in named volumes — not inside the container filesystem:
| Volume | Contents |
|---|---|
znuny-var | Attachments, cache, sessions, logs |
znuny-config | Kernel/Config overrides |
znuny-custom | Custom modules and extensions |
db-data | MariaDB database files |
Back up these volumes (or the database with mysqldump) before upgrades. See Znuny Docker operations.
Firewall
Section titled “Firewall”Open the mapped host port (default 8080) or place a reverse proxy (Nginx, Traefik, Caddy) in front of the stack for HTTPS.
Updating Znuny
Section titled “Updating Znuny”- Back up database volumes and
znuny-var. - Set the new
ZNUNY_VERSIONindocker-compose.yaml. - Rebuild and restart:
sudo docker compose build znuny-appsudo docker compose up -d- Run the database upgrade inside the container:
sudo docker compose exec znuny-app bin/znuny.Console.pl Maint::Database::Upgradesudo docker compose exec znuny-app bin/znuny.Console.pl Maint::Cache::DeleteFollow official update instructions for your target version.
Troubleshooting
Section titled “Troubleshooting”Installer cannot reach the database
- Use hostname
db, not127.0.0.1— inside the app container,localhostpoints to the app itself. - Wait until
docker compose psshows the database as healthy.
Port 8080 already in use
Change the port mapping in docker-compose.yaml, e.g. "9080:80", then restart the stack.
Permission errors on volumes
Ensure Docker can write to named volumes. On Linux, avoid bind-mounting host directories owned by root unless permissions are adjusted.
View logs
sudo docker compose logs -f znuny-appsudo docker compose logs -f dbRestart or stop
sudo docker compose restartsudo docker compose down # keeps volumessudo docker compose down --volumes # deletes data — use with careNext steps
Section titled “Next steps”- Znuny Docker operations — console commands, packages, backups, production tips
- Staging system — safe test environment before production changes
- Znuny REST API — integrations from your container stack
- Official installation docs — bare-metal and RPM/source installs
Frequently asked questions
Does Znuny ship an official Docker Compose stack?
No. Unlike some forks, Znuny has no official maintainer compose project. Community stacks such as Erik-Donath/znuny-docker fill that gap for test, demo, and staging setups.
Which database host should I use in the web installer?
Use the Compose service name db, not localhost. Inside the app container, localhost points to the Znuny app itself, so MariaDB is reached via the db hostname.