GuidesBusiness and monitoringMonitoring with Zabbix

Monitor your servers with Zabbix and rootless Docker

Zabbix 7.0 LTS on Debian 13 in rootless Docker under a user of its own behind Caddy, watching the server itself and your other servers through agents that send their data encrypted.

Tested on Docker steps follow the tested rootless Docker base guide on Debian 13 with Docker Engine 29.10.1, Compose 5.8.1 and rootlesskit 3.3.0; the app version and app-specific behaviour are from the tested Podman guide on a Melonslab server. Not re-tested end to end under Docker. Updated November 28, 2026

Recommended server for this guide

SSD RAID 1 · ECC DDR4 · 10 Gbit

VC-P Alloy · 2 vCPU · 8 GB Memory · 60 GB Storage

Month to month, no lock-in 7-day money-back guarantee

€8.99/mo

Deploy now

Quick install on a fresh VM

This command sets up a rootless container engine and a directory for this service. Podman is the default; add --engine docker to the command to use Docker instead.

curl -fsSL https://www.melonslab.com/install/rootless.sh | bash -s -- --app zabbix-docker --manifest zabbix --sha256 b54868e3d63511503998c36f5f3334c25329001b4e5b0eb75b9e2dfe3806a617
View the script

SHA-256: 97785be3e3e91393181a4a7caeab5f4b52803bf52e960dd488945cb38c6473a2

Run this guide on Melonslab

We ran every step below on our own server. For this workload we recommend VC-P Alloy at €8.99/mo. Order it, pick Debian 13, and follow the guide.

  1. 1. Order the server. Use the button below to order the recommended plan. Choose Debian 13 when the installer asks for an operating system.
  2. 2. Add IPv4 if needed. Add it on the order form when the guide publishes a service on the internet. It is a paid add-on, not included in the plan.
  3. 3. Connect over SSH. Log in as root with the address and credentials from your order, then run the commands below.
  4. 4. Follow the verified steps. Every command in this guide was run on a Melonslab server before it was published.
Deploy now
On this page

What you will set up

Zabbix collects figures from your servers, such as CPU, memory, disk space and network traffic, draws graphs of them, and opens a problem when something goes wrong, such as a full disk or a server that stops answering.

Here the Zabbix server, its web interface and its PostgreSQL database run in a Compose project under a user of its own called monitoring, 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. Each server you watch runs the Zabbix agent, which sends its figures to Zabbix. The agent on another server sends them encrypted with a key you create, which is called PSK.

The app-specific results below were recorded in the Podman test on a Melonslab server with Debian 13:

  • Zabbix 7.0.31 set up its database by itself, and its web interface logged each visitor's real address.
  • The agent on the server collected its CPU, memory and disk figures. When it was stopped, Zabbix opened the problem Zabbix agent is not available after three minutes, and closed it within a minute of the agent starting again.
  • An agent on a Debian 13 machine at another address sent its figures encrypted with PSK.
  • Everything came back by itself after a reboot.

In the Podman test, the pod used about 115 MB of memory while watching two servers.

Before you start

You need:

The examples use zabbix.example.com for Zabbix, 203.0.113.10 for your server's IPv4 address, which ip -brief address show eth0 shows, and 198.51.100.30 for another server you want to watch. Replace them throughout.

This guide uses Zabbix 7.0, the current long-term support release, with full support until June 2027 and security fixes until June 2029.

1. Create the user

As root:

useradd -m -s /bin/bash -U monitoring
loginctl enable-linger monitoring

Do not add the user to the docker group. The daemon is rootless and belongs to this user. The user is not called zabbix, because the agent in step 7 creates a system user with that name.

2. Create the database password

As monitoring:

umask 077
mkdir -p /home/monitoring/zabbix/data/db
openssl rand -hex 24 | tr -d '\n' > /home/monitoring/zabbix/secrets.env
sed -i '1s/^/POSTGRES_PASSWORD=/' /home/monitoring/zabbix/secrets.env
chmod 600 /home/monitoring/zabbix/secrets.env

Only monitoring can read the file.

3. Describe the Compose services

As monitoring, create the Compose file:

cat > /home/monitoring/zabbix/compose.yaml <<'YAML'
services:
  db:
    image: docker.io/library/postgres:16-alpine
    env_file:
      - ./secrets.env
    environment:
      POSTGRES_USER: zabbix
      POSTGRES_DB: zabbix
    volumes:
      - ./data/db:/var/lib/postgresql/data
    restart: always
  server:
    image: docker.io/zabbix/zabbix-server-pgsql:alpine-7.0-latest
    depends_on:
      - db
    env_file:
      - ./secrets.env
    environment:
      DB_SERVER_HOST: db
      POSTGRES_USER: zabbix
      POSTGRES_DB: zabbix
    extra_hosts:
      - "host.docker.internal:host-gateway"
    ports:
      # Agents send their data here
      - "10051:10051"
    restart: always
  web:
    image: docker.io/zabbix/zabbix-web-nginx-pgsql:alpine-7.0-latest
    depends_on:
      - server
    env_file:
      - ./secrets.env
    environment:
      DB_SERVER_HOST: db
      POSTGRES_USER: zabbix
      POSTGRES_DB: zabbix
      ZBX_SERVER_HOST: server
      PHP_TZ: Europe/Stockholm
      # Caddy's connections arrive from the server's own IPv4 address in the Podman test.
      WEB_REAL_IP_FROM: 203.0.113.10
      WEB_REAL_IP_HEADER: X-Forwarded-For
    ports:
      # The web interface, reached through Caddy only
      - "127.0.0.1:8094:8080"
    restart: always
YAML
chown -R monitoring:monitoring /home/monitoring/zabbix

db, server and web are Compose service names, so the containers reach each other by name. The alpine-7.0-latest tag follows every release of Zabbix 7.0, and PHP_TZ sets the time zone the web interface shows. host.docker.internal lets the server container reach the agent on the server itself; that address was not re-tested under Docker.

Start it:

uid=$(id -u monitoring)
runuser -u monitoring -- env HOME=/home/monitoring XDG_RUNTIME_DIR=/run/user/$uid \
  DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
  bash -lc "cd /home/monitoring/zabbix && docker compose pull && docker compose up -d && docker compose logs -f server"

On the first start, the server creates Zabbix's tables in the database, which takes a minute. When the log shows server #0 started, press Ctrl+C.

5. Put Caddy in front

As root, add this block to the end of /home/caddy/Caddyfile:

zabbix.example.com {
    reverse_proxy 127.0.0.1:8094
}

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"

6. Log in and change the password

Open https://zabbix.example.com, and log in as Admin with the password zabbix. Change it at once:

  • Open User settings, then Profile, and choose Change password.
  • Enter zabbix as Current password, and your new password under Password and Password (once again).
  • Choose Update, and OK when Zabbix says that you will be logged out of all active sessions.

Then log in again with the new password.

7. Watch the server itself

As root, install the Zabbix agent from Zabbix's own repository:

cd /tmp
wget https://repo.zabbix.com/zabbix/7.0/debian/pool/main/z/zabbix-release/zabbix-release_latest_7.0+debian13_all.deb
dpkg -i zabbix-release_latest_7.0+debian13_all.deb
apt update
apt install -y zabbix-agent2

The agent already sends to 127.0.0.1 and calls itself Zabbix server, the host Zabbix created for itself. Zabbix also connects to the agent to ask for figures. Allow the address the connection arrives from; with the tested Podman setup that was the server's own IPv4 address, and under Docker it may be the host gateway shown in the agent's log, so check there if the connection is rejected:

sed -i 's/^Server=127.0.0.1$/Server=203.0.113.10/' /etc/zabbix/zabbix_agent2.conf
systemctl restart zabbix-agent2

Then, in Zabbix:

  • Open Data collection, then Hosts, and choose Zabbix server.
  • Under Interfaces, enter host.docker.internal as the DNS name, and set Connect to to DNS.
  • Choose Update.

Inside the container, host.docker.internal leads to the server outside it, where the agent runs. Within a minute, the red ZBX in the host list turns green, and Monitoring, Latest data shows the server's figures.

8. Watch another server

On the Zabbix server, as root, let the other server send to Zabbix:

ufw allow from 198.51.100.30 to any port 10051 proto tcp

On the other server, as root, install the agent as in step 7. For a system other than Debian 13, pick yours on Zabbix's download page. Then name it, point it at Zabbix, and create its key:

sed -i -e 's/^ServerActive=.*/ServerActive=zabbix.example.com/' -e 's/^Hostname=.*/Hostname=web1/' /etc/zabbix/zabbix_agent2.conf
openssl rand -hex 32 > /etc/zabbix/zabbix_agent2.psk
chown zabbix: /etc/zabbix/zabbix_agent2.psk
chmod 600 /etc/zabbix/zabbix_agent2.psk
printf 'TLSConnect=psk\nTLSPSKIdentity=web1\nTLSPSKFile=/etc/zabbix/zabbix_agent2.psk\n' >> /etc/zabbix/zabbix_agent2.conf
systemctl restart zabbix-agent2
cat /etc/zabbix/zabbix_agent2.psk

This agent only sends, so nothing on the other server needs to be opened. In Zabbix:

  • Open Data collection, then Hosts, and choose Create host.
  • Enter web1 as the Host name, the same as Hostname on the agent.
  • Under Templates, type Linux by Zabbix agent active, and pick it. Under Host groups, pick Linux servers.
  • Open the Encryption tab. Under Connections from host, untick No encryption and tick PSK. Enter web1 as the PSK identity, and the key that cat printed as the PSK.
  • Choose Add.

Within a couple of minutes, the new host's figures show under Monitoring, Latest data. From now on, Zabbix refuses data for web1 that is not encrypted with its key.

9. See the problems

Dashboards shows current problems, and Monitoring, Problems lists them all, with when each started and ended. The templates come with sensible limits, such as for disk space and memory. To get problems by email, set up Alerts, Media types, and add your address to your user under User settings, Profile, Media, as Zabbix's documentation describes.

10. Keep it up to date

Add the weekly docker-update.service and docker-update.timer from the rootless Docker guide, with WorkingDirectory=/home/monitoring/zabbix, then enable the timer as monitoring. The service pulls new images and recreates the containers. That keeps Zabbix on the newest 7.0 release and PostgreSQL on the newest 16. The agents come from Zabbix's repository, so run apt upgrade on each server for them: the unattended upgrades from the security guide install only Debian's own security updates. When a newer long-term support release of Zabbix comes out, read its upgrade notes before you change the tags.

11. Back up

As monitoring:

mkdir -p /home/monitoring/backup
uid=$(id -u monitoring)
runuser -u monitoring -- env HOME=/home/monitoring XDG_RUNTIME_DIR=/run/user/$uid \
  DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
  bash -lc "cd /home/monitoring/zabbix && docker compose exec -T db pg_dump -U zabbix -Fc zabbix" > /home/monitoring/backup/zabbix-db.dump

The database holds the hosts, templates, users and all the figures collected. Copy /home/monitoring/backup to another machine.

Troubleshooting

The agent's log, /var/log/zabbix/zabbix_agent2.log, says connection from "203.0.113.10" rejected. The Server= line from step 7 still names only 127.0.0.1. Add the address shown in the log.

The server's ZBX stays red. Check the interface from step 7: host.docker.internal, connected to DNS, port 10050.

Another server's agent log says connection of type "unencrypted" is not allowed. The TLS lines from step 8 are missing from the agent's configuration.

Another server's agent log says ssl/tls alert handshake failure. Zabbix does not know that agent yet, or its PSK identity or key differs from the one in step 8. Check that the host name in Zabbix is exactly the agent's Hostname.

Compose says permission denied. Run it as monitoring from /home/monitoring/zabbix, with DOCKER_HOST pointing at the user's socket.

Run it on your own server

SSD RAID 1 · ECC DDR4 · 10 Gbit

VC-P Alloy

€8.99/mo

vCPU
2
Memory
8 GB
Storage
60 GB
Transfer
10 TB
Performance
SSD · RAID 1
  • Full root access
  • Native /64 IPv6
  • RAID-protected storage
  • Malmö, Sweden
  • Month to month, no lock-in
  • 7-day money-back guarantee
All guides