What you will set up
Zammad is a helpdesk: every email to your support address, such as support@example.com, becomes a ticket. Your team answers in the browser, the customer gets the answer as an ordinary email, and their reply lands in the same ticket. Tickets can be assigned, tagged, merged and searched, and Zammad keeps track of how fast you answer.
Zammad is developed by Zammad GmbH, a company in Berlin that also sells hosted Zammad and support, and the code belongs to the Zammad Foundation. It is open source under the AGPL 3.0 licence. In our captures of the server's traffic it made no update check and sent no usage data. Out of the box it uses two outside services run by Zammad: it sends the email address of each new customer to images.zammad.com to look for a profile picture, and the address of each login to geo.zammad.com to show where it came from. Step 8 switches both off. During setup, Zammad also asks geo.zammad.com where the server is, to suggest a calendar of public holidays, and from then on fetches those holidays from calendar.google.com once a day; step 8 covers that too.
Zammad is not a mail server. It fetches the mail sent to your support address from a mailbox at your email provider, over IMAP, and sends its replies through the same provider over SMTP, so your mail keeps going through the provider you already use.
Here Zammad runs as a Compose project of nine services under a user of its own called zammad, behind Caddy from the rootless Docker guide: The Docker setup follows that tested base; the app results below come from the tested Podman guide on a Melonslab server and were not re-measured under Docker. PostgreSQL for the data, Redis, Memcached, Elasticsearch for search, and Zammad's web server, background worker, websocket server and web front, with a setup job that runs before them. They are the containers of Zammad's official Docker Compose setup.
The app-specific results below were recorded in the Podman test on a fresh Melonslab VC-P Alloy (2 vCPU, 8 GB) with Debian 13:
- Zammad 7.2.1 started with PostgreSQL 17 and Elasticsearch 9.5.5, and the admin account was created through an SSH tunnel before Caddy was set up.
- An email to the support address became a ticket, with an automatic reply to the customer. An agent's answer arrived in the customer's mailbox, and the customer's reply landed in the same ticket.
- Zammad sent mail over SMTP with STARTTLS on port 587 and with TLS on port 465, both against test mail servers on the same server. A new-ticket notification and a password reset arrived.
- Search found tickets by a word in their text. The interface was shown in Swedish.
- Zammad logged each visitor's real address, over IPv4 and IPv6, and ignored a forged
X-Forwarded-Forheader. - With Zammad's two services switched off, a ticket from a new customer caused no outside lookups.
- Zammad was updated from 7.2.1 to 7.2.2 with
docker compose pull && docker compose up -d. It was restored from a backup into empty volumes, ran without Elasticsearch, and came back by itself after a reboot.
In the Podman test, the pod used about 2.5 GB of memory, 1.5 GB of it Elasticsearch, so it fits on 8 GB with room to spare. Elasticsearch is optional, but Zammad's documentation recommends it for search, and Zammad's reports need it. Without it, as in Troubleshooting, the pod used about 800 MB, and search still found tickets by words in their text.
Before you start
You need:
- a server set up as in the rootless Docker guide, with Caddy running;
- an A record and an AAAA record for
help.example.compointing at your server; - a mailbox for your support address at your email provider, with IMAP and SMTP access, and its server names and password. If the account has two-factor authentication, the provider usually gives you an app password for this.
The examples use help.example.com for Zammad, support@example.com for the support address, mail.example.com for your provider's mail server and 203.0.113.10 for your server's IPv4 address, which ip -brief address show eth0 shows. Replace them throughout.
1. Create the user
As root:
useradd -m -s /bin/bash -U zammad
loginctl enable-linger zammad
Do not add the user to the docker group. The daemon is rootless and belongs to this user.
Steps 2 and 3 run as zammad.
2. Create the secret
As zammad:
umask 077
mkdir -p /home/zammad/zammad/data/db /home/zammad/zammad/data/storage /home/zammad/zammad/data/search
openssl rand -hex 24 | tr -d '\n' > /home/zammad/zammad/secrets.env
sed -i '1s/^/POSTGRESQL_PASS=/' /home/zammad/zammad/secrets.env
chmod 600 /home/zammad/zammad/secrets.env
That makes the database password, in a file only zammad can read.
3. Define the Compose services
As zammad, create the shared settings file:
cat > /home/zammad/zammad/zammad.env <<'EOF'
ZAMMAD_FQDN=help.example.com
ZAMMAD_HTTP_TYPE=https
NGINX_SERVER_SCHEME=https
RAILS_TRUSTED_PROXIES=127.0.0.1,::1,203.0.113.10
TZ=Europe/Stockholm
POSTGRESQL_HOST=db
POSTGRESQL_DB_CREATE=false
REDIS_URL=redis://redis:6379
MEMCACHE_SERVERS=memcached:11211
ELASTICSEARCH_HOST=search
ZAMMAD_RAILSSERVER_HOST=railsserver
ZAMMAD_WEBSOCKET_HOST=websocket
EOF
ZAMMAD_FQDN and ZAMMAD_HTTP_TYPE give Zammad its public address, used in links and emails; they are read on the first start only. NGINX_SERVER_SCHEME=https tells Zammad that visitors use HTTPS, which Caddy takes care of. RAILS_TRUSTED_PROXIES lists the addresses Zammad trusts to tell it the visitor's real address; Caddy's connections arrive from the server's own IPv4 address in the tested Podman setup, but under Docker the address may differ, so check the logs and add the address if all visitors show the same one. The other host names are the Compose service names, which replace the 127.0.0.1 addresses of the shared pod network.
Create the Compose file:
cat > /home/zammad/zammad/compose.yaml <<'YAML'
services:
db:
image: docker.io/library/postgres:17-alpine
env_file:
- ./secrets.env
environment:
POSTGRES_USER: zammad
POSTGRES_DB: zammad_production
volumes:
- ./data/db:/var/lib/postgresql/data
restart: always
redis:
image: docker.io/library/redis:8-alpine
restart: always
memcached:
image: docker.io/library/memcached:1.6-alpine
command: memcached -m 256M
restart: always
search:
image: docker.io/library/elasticsearch:9.5.5
environment:
discovery.type: single-node
xpack.security.enabled: "false"
ingest.geoip.downloader.enabled: "false"
ES_JAVA_OPTS: -Xms1g -Xmx1g
volumes:
- ./data/search:/usr/share/elasticsearch/data
restart: always
init:
image: ghcr.io/zammad/zammad:7.2
command: zammad-init
depends_on:
- db
- redis
- memcached
- search
env_file:
- ./zammad.env
- ./secrets.env
volumes:
- ./data/storage:/opt/zammad/storage
railsserver: &zammad
image: ghcr.io/zammad/zammad:7.2
command: zammad-railsserver
depends_on:
init:
condition: service_completed_successfully
env_file:
- ./zammad.env
- ./secrets.env
volumes:
- ./data/storage:/opt/zammad/storage
restart: always
scheduler:
<<: *zammad
command: zammad-scheduler
websocket:
<<: *zammad
command: zammad-websocket
nginx:
<<: *zammad
command: zammad-nginx
ports:
# Only Caddy, on this server, can reach Zammad: the port is not open to the internet.
- "127.0.0.1:8147:8080"
YAML
chown -R zammad:zammad /home/zammad/zammad
The init service creates the database on the first start and updates it after each update; the four Zammad services wait for it to finish. ghcr.io/zammad/zammad:7.2 follows every patch release of Zammad 7.2. PostgreSQL stays on 17, Redis on 8, and Elasticsearch is pinned because it has no tag that follows a version line; step 10 explains how to move it. Elasticsearch gets 1 GB of memory for its data, as in Zammad's own setup, and runs as a single node without a password since only the Compose network can reach it.
Start it:
uid=$(id -u zammad)
runuser -u zammad -- env HOME=/home/zammad XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash -lc "cd /home/zammad/zammad && docker compose pull && docker compose up -d"
The first pull downloads about 3 GB of images, and the setup job then takes about five minutes. It is ready when this prints 200:
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8147/
docker compose ps -a shows init as Exited (0), which is right: it runs, then stops.
4. Create the admin account
Until Zammad is set up, whoever opens it first creates the admin account. That is why its port is on 127.0.0.1 only, and why you reach it through SSH for now. From your own computer:
ssh -L 8147:127.0.0.1:8147 root@203.0.113.10
Keep that session open, and open http://localhost:8147 in your browser. Zammad shows "This isn't the address Zammad is set up for", which is right, since it is set up for help.example.com; ignore it.
- Choose Set up a new system.
- Enter your name, email address and a password, and choose Create.
- Enter your organisation's name as Organization Name. System URL already says
https://help.example.com. Choose Next. - Under Email Notification, choose Skip, and under Connect Channels, Skip again. Step 6 sets up email.
Zammad opens its dashboard. It takes its time zone from your browser; you can check it under Settings > Branding > Timezone. Close the SSH session.
5. Put Caddy in front
As root, add this block to the end of /home/caddy/Caddyfile:
help.example.com {
reverse_proxy 127.0.0.1:8147
}
Restart Caddy:
uid=$(id -u caddy)
runuser -u caddy -- env HOME=/home/caddy XDG_RUNTIME_DIR=/run/user/$uid \
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus PATH=/usr/bin:/bin \
bash -lc "export DOCKER_HOST=unix:///run/user/$uid/docker.sock; cd /home/caddy/caddy && docker compose restart caddy"
Open https://help.example.com and log in with the account from step 4.
Zammad's settings are under the gear icon at the bottom left, in four sections: Manage, Channels, Settings and System. The steps below name the section first.
6. Email
Email is how tickets come in and answers go out. Zammad needs two things from your email provider: the support mailbox, which it reads over IMAP and sends answers from over SMTP, and an account to send its own notifications to your team, such as new tickets and password resets. Both can be the same account.
Zammad stores these passwords in its database, not in the Compose files: you enter them in its settings, and they are in your backups (step 9).
The support mailbox. Under Channels > Email, choose New under Email Accounts. Enter the name your customers will see as Organization & Department Name, such as Example Support, then the address, its password, and Users as Destination Group. Keep Destination group > Sending email address at Change to channel email address: the group then sends its answers and automatic replies from this address. Choose Connect. For well-known providers, Zammad finds the server settings by itself. If it cannot, it asks for them:
- Email Inbound: Type IMAP, your provider's Host, such as
mail.example.com, the full address as User, SSL/STARTTLS SSL and Port993. - Keep Messages on Server: with no, Zammad deletes each email from the mailbox once it is a ticket. Choose yes to keep it there; Zammad then marks it as read.
- Email Outbound: the same Host and User, and Port
587, which uses STARTTLS, or465, which uses TLS from the start.
Choose Continue. Zammad sends a test email to the mailbox and waits for it to come back before it saves the account, which takes up to a minute. After that, it fetches new mail about every 30 seconds.
Notifications. On the same page, under Email Notification, choose Edit next to Outbound, enter your provider's SMTP Host, User, Password and Port 587, and choose Continue. When you save, Zammad sends a test email to verify-external-smtp-sending@discard.zammad.org, an address of Zammad's that throws it away. Then, under the Settings tab, set Notification Sender to an address the account may send from, such as Example Helpdesk <support@example.com>, and Submit. Zammad's default, noreply@help.example.com, is not an address your provider sends for.
Signature. Every answer gets the signature under the Signatures tab, and the one Zammad ships with is an example, with an address in Miami. Open default, write your own, and Submit.
For Gmail and Microsoft 365, Google Email and Microsoft 365 Graph Email under Channels connect with the provider's own login instead of a password. We did not test them.
Without email set up:
- no tickets come in by email, and an answer to a ticket can only be an internal note;
- inviting a colleague under First Steps on the dashboard shows "Can't create user!" with an SMTP error, although the account is created;
- Forgot password? says the instructions were sent, but nothing arrives.
Tickets created in the browser, and logins with a password, keep working.
7. Agents and customers
Agents answer tickets. Add them under Manage > Users > New User: tick Agent under Roles, and full for the groups they work in under Group Permissions. Zammad sends them no email; set a Password for them, or let them use Forgot password? on the login page.
Customers are the people who write to you. Each new address that emails the support address gets a customer account by itself. By default, customers can also log in at https://help.example.com to see their tickets and open new ones: Register as a new customer on the login page lets anyone create an account, and Forgot password? lets anyone who has written to you set a password. If you only want tickets by email, set New User Accounts to no under Settings > Security > Base. The Two-factor Authentication tab next to it turns on two-factor logins.
To answer a ticket, open it from Overviews, choose the reply arrow under the customer's message, write, and choose Update. The lock icon makes it an internal note that only your team sees. The search box at the top finds tickets by any word in them.
8. and outside services
Zammad comes translated into Swedish. Each user picks Svenska under their avatar > Profile > Language. To make Swedish the default for everyone who has not picked a language, choose it under Settings > Branding > Locale, and Submit. The login page follows the language of the visitor's browser.
Zammad also creates a calendar of business hours and public holidays, which escalation times and SLAs count in. It asks Zammad's location service where the server is, and on ours it made a calendar called France, in Paris time with French holidays. Under Manage > Calendars, choose Edit, set Name to Sweden, Time Zone to Europe/Stockholm and Subscribe to public holidays in to Sweden, or your own country, and Submit. Zammad then fetches the holidays from calendar.google.com once a day. The Swedish list includes days you probably work, such as Valentine's Day and Walpurgis Night: untick them under Holidays.
Under Settings > System > Services, set Image Service and Geo IP Service to -, and Submit each:
- Image Service sends the email address of each new customer to
images.zammad.com, for a profile picture. In our capture, a ticket from a new address made the server look upimages.zammad.com; with the service off, it made no lookups at all. - Geo IP Service sends the IP address of each login to
geo.zammad.com, to show where it came from under System > Sessions.
Geo Location Service looks up street addresses you enter for users at OpenStreetMap. Geo Calendar Service is what asked geo.zammad.com where the server is during setup; Zammad does not use it after that. You can set both to - as well.
9. Back up
As zammad:
mkdir -p /home/zammad/backup
uid=$(id -u zammad)
runuser -u zammad -- env HOME=/home/zammad XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash -lc "cd /home/zammad/zammad && docker compose exec -T db pg_dump -U zammad zammad_production" > /home/zammad/backup/zammad-db.sql
tar czf /home/zammad/backup/zammad-storage.tgz -C /home/zammad/zammad data/storage
cp /home/zammad/zammad/zammad.env /home/zammad/zammad/secrets.env /home/zammad/backup/
The tickets, their attachments, users and settings, with the email passwords, are in the database. ./data/storage only holds attachments if you set Storage Method to Filesystem under Settings > System > Storage. The search index is not needed: Zammad builds it again from the database. The dump runs while Zammad keeps working. Copy /home/zammad/backup to another machine, for example with restic, and store it safely.
To restore into empty directories, as zammad, with the backup in /home/zammad/backup:
uid=$(id -u zammad)
runuser -u zammad -- env HOME=/home/zammad XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash -lc "cd /home/zammad/zammad && docker compose down"
rm -rf /home/zammad/zammad/data/db /home/zammad/zammad/data/storage /home/zammad/zammad/data/search
tar xzf /home/zammad/backup/zammad-storage.tgz -C /home/zammad/zammad
uid=$(id -u zammad)
runuser -u zammad -- env HOME=/home/zammad XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash -lc "cd /home/zammad/zammad && docker compose up -d db"
uid=$(id -u zammad)
runuser -u zammad -- env HOME=/home/zammad XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash -lc "cd /home/zammad/zammad && docker compose exec -T db psql -q -o /dev/null -U zammad zammad_production" < /home/zammad/backup/zammad-db.sql
uid=$(id -u zammad)
runuser -u zammad -- env HOME=/home/zammad XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash -lc "cd /home/zammad/zammad && docker compose up -d"
Starting only the database first loads the backup before the setup job runs. The setup job then finds an existing database and builds the search index again, and Zammad answers after about three minutes.
10. Update
Add the weekly docker-update.service and docker-update.timer from the rootless Docker guide, with WorkingDirectory=/home/zammad/zammad, then enable the timer as zammad. The service pulls new images and recreates the containers; the setup job updates the database before Zammad starts. To update now:
uid=$(id -u zammad)
runuser -u zammad -- env HOME=/home/zammad XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash -lc "cd /home/zammad/zammad && docker compose pull && docker compose up -d"
Zammad is unavailable for three or four minutes while it restarts. For a new minor version, such as 7.3, read its release notes, make a backup, and change the tag in /home/zammad/zammad/compose.yaml:
uid=$(id -u zammad)
runuser -u zammad -- env HOME=/home/zammad XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash -lc "cd /home/zammad/zammad && sed -i 's|zammad/zammad:7.2|zammad/zammad:7.3|' compose.yaml && docker compose up -d"
To move Elasticsearch to a newer version, change its tag to the one in Zammad's own Docker Compose file, then pull and restart. We tested the update within 7.2 only.
Troubleshooting
curl prints 000 or 502 long after the start. The setup job has not finished, or failed. docker compose logs init shows how far it got. On the first start it takes several minutes.
Login fails with "CSRF token verification failed". NGINX_SERVER_SCHEME=https is missing from /home/zammad/zammad/zammad.env. Add it, then restart with docker compose restart.
Zammad logs every visitor with the server's own address. RAILS_TRUSTED_PROXIES is missing the address Caddy's connections arrive from. Fix it in zammad.env, and restart. The log is docker compose logs railsserver.
No mail is fetched. Channels > Email shows the error of the last fetch next to the account. Check the password, and that IMAP is turned on for the mailbox at your provider.
Customers get no automatic reply. docker compose logs scheduler says "no email address is set for group 'Users'". Under Manage > Groups, open Users, choose the support address as Sending Email Address, and Submit.
Running without Elasticsearch. On a server with 4 GB, leave it out. As zammad:
uid=$(id -u zammad)
runuser -u zammad -- env HOME=/home/zammad XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash -lc "cd /home/zammad/zammad && docker compose stop nginx railsserver scheduler websocket init && docker compose rm -f search"
echo ELASTICSEARCH_ENABLED=false >> /home/zammad/zammad/zammad.env
uid=$(id -u zammad)
runuser -u zammad -- env HOME=/home/zammad XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash -lc "cd /home/zammad/zammad && docker compose up -d"
Edit compose.yaml to remove the search service and the search entry in init's depends_on as well. Zammad then searches its database instead. Removing ./data/search frees the disk space of the old index, and the restore in step 9 then leaves it out.
Compose says permission denied. Run it as zammad from /home/zammad/zammad, with DOCKER_HOST pointing at the user's socket.