Back to blog
Blog

Deploy Zammad Helpdesk On a VPS With Email Piping

Deploy Zammad helpdesk on a VPS with Docker Compose, HTTPS, email piping, backups, and safe updates for small teams.

By Anurag Singh
Updated on Nov 20, 2026
Category: Blog
Share article
Deploy Zammad Helpdesk On a VPS With Email Piping

Email support fails in familiar ways. Someone forgets to CC a teammate. A customer reply lands in the wrong thread. A “quick question” turns into a two-week saga with no clear history.

Zammad fixes this by turning email into tickets. You can track, assign, tag, and audit those tickets.

This post shows how to deploy Zammad helpdesk on a VPS like any other production service. You’ll use Docker Compose, a reverse proxy with HTTPS, email piping on your domain, backups you can restore, and updates that won’t wreck your weekend.

Why Zammad is worth self-hosting (and who it fits)

Zammad is an open-source helpdesk and ticketing system for teams that live in email but need structure. It fits agencies, SaaS support inboxes, internal IT, and ops teams with “small but constant” request volume.

It’s not aiming to be a CRM. It’s a helpdesk that stays usable when the queue gets busy.

License: Zammad is open source under AGPL-3.0. If you modify it and run it as a network service, the license obligations apply. If you run it unmodified for your own organization, it’s usually straightforward.

  • Best for: small teams (2–50) that want email-to-ticket, internal notes, templates, roles, and basic automation.
  • Not ideal for: teams needing enterprise contact-center features, deep voice/chat routing, or complex multi-brand governance.

Deploy Zammad helpdesk vs Zendesk/Freshdesk

If you’re replacing Zendesk or Freshdesk, it’s often for one of two reasons. Per-agent pricing keeps climbing. Or the tool dictates your workflow (and holds your data).

Self-hosting Zammad changes those trade-offs.

  • Control: You own the database, attachments, and ticket history on your server and in your backups.
  • Cost model: Your costs look like infrastructure: VPS + storage + mail reputation work, not agent tiers.
  • Complexity: You take responsibility for uptime, updates, and email deliverability. It’s manageable, but it’s on you.

The sweet spot is a team that can run a small VPS reliably and prefers predictable monthly costs.

If you don’t want to deal with DNS, SSL, or mail settings, choose managed hosting or a fully hosted helpdesk instead.

Infrastructure planning: VPS sizing, DNS, and ports

Zammad includes multiple moving parts (Rails app, search, cache, database). You can start small, but don’t starve it.

Most “Zammad feels slow” reports trace back to a tiny server that swaps under load.

Practical resource requirements

  • Small team (light volume): 2 vCPU, 4 GB RAM, 40+ GB NVMe storage.
  • Growing team (steady volume + attachments): 4 vCPU, 8 GB RAM, 80+ GB NVMe storage.
  • Heavier usage: consider 4–8 vCPU and 16 GB RAM, and move attachments to a dedicated volume.

On a clean Ubuntu or Debian VPS, CPU is often fine. Memory is usually the constraint.

Also plan storage for attachments. They grow faster than most teams expect.

If you want a server sized for growth without overthinking it, start on a HostMyCode VPS. If you’d rather not handle patching, monitoring, and emergency triage yourself, managed VPS hosting is the calmer route.

DNS and firewall checklist

  • A record: support.yourdomain.com → your VPS IP
  • Open ports: 80/tcp and 443/tcp to the reverse proxy
  • SSH: lock down 22/tcp (IP allowlist or at least key-only auth)

If you already host other apps on the VPS, put everything behind a reverse proxy. Route by hostname.

Don’t expose Zammad directly without TLS.

Deploy Zammad helpdesk with Docker Compose (clean layout)

Zammad ships Docker images and supports a Compose-based deployment. Keep the Compose project in one directory.

Use named volumes for persistent data. Store secrets in an env file, and back that file up.

Assumptions below:

  • Ubuntu 24.04 LTS or Debian 12 on your VPS
  • Docker Engine + Docker Compose plugin installed
  • You will publish Zammad behind a reverse proxy (recommended)

Directory structure

sudo mkdir -p /opt/zammad
cd /opt/zammad
sudo mkdir -p backups

Example docker-compose.yml

This Compose file uses Postgres, Redis, and Elasticsearch/OpenSearch-style search. Zammad relies on these services for fast ticket lookup.

Zammad’s official docs and images can change. Treat this as a starting point.

Before production, verify environment keys against upstream.

services:
  zammad-postgresql:
    image: postgres:16
    restart: unless-stopped
    environment:
      POSTGRES_USER: zammad
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: zammad_production
    volumes:
      - zammad_db:/var/lib/postgresql/data

  zammad-redis:
    image: redis:7
    restart: unless-stopped
    volumes:
      - zammad_redis:/data

  zammad-elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:8
    restart: unless-stopped
    environment:
      - discovery.type=single-node
      - xpack.security.enabled=false
      - ES_JAVA_OPTS=-Xms1g -Xmx1g
    volumes:
      - zammad_es:/usr/share/elasticsearch/data

  zammad:
    image: zammad/zammad-docker-compose:zammad-latest
    restart: unless-stopped
    depends_on:
      - zammad-postgresql
      - zammad-redis
      - zammad-elasticsearch
    environment:
      ZAMMAD_RAILS_LOG_TO_STDOUT: "true"
      ZAMMAD_SAFE_MODE: "0"
      POSTGRESQL_HOST: zammad-postgresql
      POSTGRESQL_USER: zammad
      POSTGRESQL_PASS: ${POSTGRES_PASSWORD}
      POSTGRESQL_DB: zammad_production
      REDIS_URL: redis://zammad-redis:6379
      ELASTICSEARCH_URL: http://zammad-elasticsearch:9200
      # Set this to your public helpdesk URL
      ZAMMAD_HOSTNAME: support.yourdomain.com
      ZAMMAD_HTTP_TYPE: https
    volumes:
      - zammad_data:/opt/zammad
    expose:
      - "3000"

volumes:
  zammad_db:
  zammad_redis:
  zammad_es:
  zammad_data:

Secrets file and first start

sudo tee /opt/zammad/.env >/dev/null <<'EOF'
POSTGRES_PASSWORD=use-a-long-random-password-here
EOF

cd /opt/zammad
sudo docker compose up -d
sudo docker compose ps

If containers restart repeatedly, check logs first. Then check for memory pressure:

sudo docker compose logs -f --tail=200
free -h
sudo dmesg -T | tail -n 50

Elasticsearch is usually the first component to fail on a 2 GB VPS. If you see OOM kills, add RAM before you spend time “tuning.”

Reverse proxy with HTTPS (Nginx example)

You want TLS, HTTP/2, reasonable timeouts, and a clear place to enforce security headers.

Running Nginx on the host is simple and predictable. It also works well when you host more than one service.

Install Nginx and Certbot:

sudo apt update
sudo apt install -y nginx certbot python3-certbot-nginx

Nginx server block

Create /etc/nginx/sites-available/support.yourdomain.com:

server {
  listen 80;
  server_name support.yourdomain.com;

  location /.well-known/acme-challenge/ {
    root /var/www/html;
  }

  location / {
    return 301 https://$host$request_uri;
  }
}

server {
  listen 443 ssl http2;
  server_name support.yourdomain.com;

  ssl_certificate /etc/letsencrypt/live/support.yourdomain.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/support.yourdomain.com/privkey.pem;

  client_max_body_size 50m;

  location / {
    proxy_pass http://127.0.0.1:3000;
    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_read_timeout 300;
  }
}

Then enable it:

sudo ln -s /etc/nginx/sites-available/support.yourdomain.com /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx

Issue the certificate

sudo certbot --nginx -d support.yourdomain.com

Common gotcha: the Compose service above only exposes port 3000 inside Docker.

For Nginx to proxy to 127.0.0.1:3000, you must publish that port to the host. Add this to the zammad service:

    ports:
      - "127.0.0.1:3000:3000"

Then restart:

cd /opt/zammad
sudo docker compose up -d

If you want a deeper reverse-proxy pattern library, the Nginx approach is similar to what we use in this reverse proxy + SSL walkthrough (the backend differs, the mechanics don’t).

Email piping: turning inbound mail into tickets on your domain

Email intake is the point of a helpdesk. Zammad can ingest mail via IMAP polling, POP3, or piping.

Piping works well when you control the mail server. It also works if you have delivery-rule control and can run a command on receipt.

What email piping does: your mail system receives email for support@yourdomain.com, then hands the raw message to Zammad. Zammad parses headers, keeps threading intact, and creates or updates tickets.

Two workable architectures

  • Mail server on the same VPS (or another VPS): best control; easiest to implement true piping. If you already self-host mail, this fits naturally.
  • Hosted mailbox + IMAP fetch: usually simpler if you don’t want mail-server operations. It’s not “piping,” but it’s reliable for many small teams.

This post focuses on piping because that’s the goal for operators who want direct delivery.

If you’re planning to run your own mail stack, see how a domain-based setup works in practice in our Mailcow deployment post. Even if you don’t pick Mailcow, the DNS and deliverability basics still apply.

Inbound routing basics (MX + aliases)

  • Point your domain’s MX records to the mail server that will receive support mail.
  • Create an alias or mailbox, for example support@yourdomain.com.
  • Ensure your mail server can deliver that address to a pipe command.

If you don’t control MX and can’t create piping rules, use IMAP ingestion instead.

You still get tickets. Delivery just happens on a polling schedule.

How piping looks on a typical Linux mail server

On a Postfix-based host, piping is often implemented with an alias that runs a command.

The exact wiring depends on whether Zammad runs on the same host as the MTA.

Case A: mail server and Zammad on the same machine (simplest): deliver to a local command that calls Zammad’s “receive mail” entrypoint inside the container.

Example idea (adjust for your environment): create a dedicated local user (e.g. zammad-mail), then in /etc/aliases:

support: "|/usr/local/bin/zammad-mailpipe"

Create /usr/local/bin/zammad-mailpipe:

#!/bin/sh
# Reads raw email from stdin and passes into the Zammad container
/usr/bin/docker exec -i zammad-zammad-1 bash -lc "bundle exec rails r 'Channel::EmailParser.process(STDIN.read)'" 

Then:

sudo chmod 0755 /usr/local/bin/zammad-mailpipe
sudo newaliases

Important: The exact command to feed email into Zammad can vary by image and packaging.

Before you rely on this in production, confirm the supported mailpipe entrypoint in Zammad’s current Docker documentation.

Use the example as the model: “MTA pipes to a script; the script passes stdin into Zammad using a supported method.”

Case B: mail server is separate from Zammad (common in practice): the mail server pipes to an SSH command that forwards stdin to the Zammad host.

This keeps your helpdesk VPS isolated and avoids running a full mail stack on it. You’ll still need a supported mailpipe command on the Zammad side.

Outbound email: SMTP that won’t hurt your domain reputation

Inbound creates tickets. Outbound is how your team replies, sends notifications, and closes loops.

Use authenticated SMTP with a correctly configured domain:

  • SPF record that authorizes your sending host/provider
  • DKIM signing enabled
  • DMARC policy that matches how you send

Zammad can send mail via SMTP. Configure it in the admin UI (Channel / Email).

Use TLS and avoid “open relay” shortcuts. If your replies land in spam, the helpdesk UI can’t save the conversation.

Backups that matter: database + attachments + config

A helpdesk backup isn’t just a database dump. Attachments and config matter just as much.

Plan for three backup targets:

  • Postgres dump: tickets, users, settings
  • Zammad data volume: attachments and file storage inside zammad_data
  • Compose + env files: docker-compose.yml, .env, and any Nginx configs

Simple nightly backup script

Create /opt/zammad/backups/backup-zammad.sh:

#!/usr/bin/env bash
set -euo pipefail

TS=$(date +%F-%H%M)
DEST=/opt/zammad/backups/$TS
mkdir -p "$DEST"

cd /opt/zammad

# Database
sudo docker compose exec -T zammad-postgresql pg_dump -U zammad zammad_production \
  | gzip > "$DEST/zammad_db.sql.gz"

# Zammad data volume (attachments, etc.)
sudo docker run --rm \
  -v zammad_zammad_data:/data:ro \
  -v "$DEST":/backup \
  alpine sh -c "cd /data && tar -czf /backup/zammad_data.tar.gz ."

# Config snapshot
cp -a /opt/zammad/docker-compose.yml "$DEST/" || true
cp -a /opt/zammad/.env "$DEST/" || true

# Basic retention: keep 14 days
find /opt/zammad/backups -maxdepth 1 -type d -mtime +14 -name "20*" -exec rm -rf {} \;

Make it executable and run it once:

sudo chmod 0750 /opt/zammad/backups/backup-zammad.sh
sudo /opt/zammad/backups/backup-zammad.sh
ls -lah /opt/zammad/backups

Then schedule it with cron (as root) at 02:15:

sudo crontab -e
15 2 * * * /opt/zammad/backups/backup-zammad.sh >> /var/log/zammad-backup.log 2>&1

Restore testing: do it early, not after an incident.

Bring up a second Compose project on a throwaway VPS. Confirm you can restore both the DB and the data volume.

If you need a quick way to diagnose storage pressure before backups start failing, use this disk-space triage guide.

Safe updates: how to avoid breaking support on a weekday

Helpdesk downtime is loud. It blocks customer communication.

Your update process should be predictable and boring.

A practical update runbook

  1. Back up first (DB + data volume).
  2. Check free disk: images and volumes need headroom.
  3. Pull images and restart during a controlled window.
  4. Verify: login, create ticket, reply, search, attachments.

Commands

cd /opt/zammad
sudo /opt/zammad/backups/backup-zammad.sh
sudo docker compose pull
sudo docker compose up -d
sudo docker compose logs -f --tail=150

If you’re tempted by automated image updates, wait until backup and restore are routine.

Watchtower can be fine for low-risk services, but a helpdesk deserves a maintenance window. If you still want the option, read our Watchtower guide and start with monitor-only mode.

Operational notes: hardening, monitoring, and mail deliverability

Zammad is only half the job. The rest is keeping the VPS healthy and keeping your email trusted.

  • Protect admin endpoints: use strong admin passwords, enable 2FA if available in your setup, and consider IP restrictions for admin access.
  • Brute-force protection: if you terminate HTTPS on Nginx, you can apply Fail2ban rules to Nginx logs. The approach is similar to this Fail2ban + Nginx setup.
  • Monitor basics: CPU steal, memory, disk, and container restarts. A helpdesk that starts swapping will feel broken long before it’s truly “down.”
  • Email reputation: set SPF/DKIM/DMARC properly and send from aligned domains. A misaligned From: domain becomes a daily deliverability penalty.

If you’re moving off a hosted helpdesk and want predictable monthly costs, run Zammad on a VPS you control. Start with a HostMyCode VPS for a clean Docker deployment, or choose managed VPS hosting if you’d rather offload patching and server monitoring.

FAQ

Do I need a dedicated mail server to use email piping?

No, but you do need control over message delivery rules. True piping usually means you control the receiving MTA (Postfix/Exim) or a provider feature that can POST/pipe mail to a command. If you can’t do that, use IMAP ingestion instead.

Can I run Zammad on the same VPS as my website?

Yes, as long as the VPS has enough RAM and you put Zammad behind a reverse proxy on its own subdomain. Watch disk growth from attachments, and don’t starve the search container.

What should I back up first if I’m short on storage?

Start with the Postgres dump (it’s small and critical), then add the Zammad data volume. Without the data volume you’ll lose attachments, which customers will notice immediately.

What’s the safest way to update Zammad in production?

Back up, pull images, restart, then run a short functional check (login, ticket create, reply, search). Avoid unattended auto-updates until you’ve tested restores and you know how long updates typically take on your VPS.

Summary: self-hosted support that behaves like infrastructure

Zammad can replace Zendesk/Freshdesk if you want ownership of your helpdesk data, control over workflows, and infrastructure-style costs.

Run it on a VPS with Docker Compose. Put it behind Nginx with HTTPS.

Connect inbound mail using piping where you control delivery. Treat backups and updates as scheduled maintenance.

If you’re ready to put it on stable infrastructure, a HostMyCode VPS is a straightforward base for a production helpdesk, and managed VPS hosting is there when you’d rather focus on customers than kernel updates.