Skip to content

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

StackBest forZnuny versionsInstaller URL
Erik-Donath/znuny-dockerZnuny 7.x, web installer workflow7.1+ (configurable at build)/znuny/installer.pl
juanluisbaptiste/docker-otrsMature all-in-one stack, backups built inZnuny 6.x LTSPre-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.

ComponentMinimumRecommended (staging / production)
CPU2 cores4+ cores
RAM4 GB8 GB or more
Disk20 GB free40 GB+ (SSD)
Docker20.10latest
Docker Composev2latest
Git2.17latest

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:

Terminal window
docker --version
docker compose version
Terminal window
cd /opt
sudo git clone https://github.com/Erik-Donath/znuny-docker.git /opt/znuny-docker
cd /opt/znuny-docker

Review docker-compose.yaml and Dockerfile before starting — especially passwords, ports, and the ZNUNY_VERSION build argument.

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.

Terminal window
sudo docker compose up --build -d

On first run, Docker downloads base images and builds the Znuny app image. This can take several minutes.

Check that both containers are healthy:

Terminal window
sudo docker compose ps
sudo docker compose logs -f znuny-app

Expected services:

ServiceRole
znuny-appApache + Znuny application, cron, daemon
dbMariaDB with Znuny-tuned settings

Open the installer in your browser:

http://<your-server-ip>:8080/znuny/installer.pl

Follow the installer and note:

  • Choose MariaDB as the database type.
  • Database host: db (the Compose service name — not localhost).
  • Database user / password: use the values from your docker-compose.yaml (MYSQL_USER, MYSQL_PASSWORD).
  • Root password: use MYSQL_ROOT_PASSWORD when 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.

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:

Terminal window
sudo docker compose exec znuny-app bash
bin/Cron.sh status
exit

If jobs are not running, check container logs and the official cron documentation.

Terminal window
sudo docker compose exec znuny-app bash
bin/znuny.Console.pl --help

The stack stores data in named volumes — not inside the container filesystem:

VolumeContents
znuny-varAttachments, cache, sessions, logs
znuny-configKernel/Config overrides
znuny-customCustom modules and extensions
db-dataMariaDB database files

Back up these volumes (or the database with mysqldump) before upgrades. See Znuny Docker operations.

Open the mapped host port (default 8080) or place a reverse proxy (Nginx, Traefik, Caddy) in front of the stack for HTTPS.

  1. Back up database volumes and znuny-var.
  2. Set the new ZNUNY_VERSION in docker-compose.yaml.
  3. Rebuild and restart:
Terminal window
sudo docker compose build znuny-app
sudo docker compose up -d
  1. Run the database upgrade inside the container:
Terminal window
sudo docker compose exec znuny-app bin/znuny.Console.pl Maint::Database::Upgrade
sudo docker compose exec znuny-app bin/znuny.Console.pl Maint::Cache::Delete

Follow official update instructions for your target version.

Installer cannot reach the database

  • Use hostname db, not 127.0.0.1 — inside the app container, localhost points to the app itself.
  • Wait until docker compose ps shows 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

Terminal window
sudo docker compose logs -f znuny-app
sudo docker compose logs -f db

Restart or stop

Terminal window
sudo docker compose restart
sudo docker compose down # keeps volumes
sudo docker compose down --volumes # deletes data — use with care

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.