🟥 1. Add the Official Zabbix Repository (Ubuntu 24.04)
Ubuntu’s default repos do NOT include Agent2, so you must install the Zabbix repo first.
Run these commands:
wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-1+ubuntu24.04_all.deb sudo dpkg -i zabbix-release_7.0-1+ubuntu24.04_all.deb sudo apt update
This registers the Zabbix 7.0 repository with apt.
🟥 2. Install Zabbix Agent2 + All Plugins
Now install the agent:
sudo apt install zabbix-agent2 zabbix-agent2-plugin-*
This gives you:
- Agent2
- Docker plugin
- System plugins
- Hardware plugins
- Database plugins
- Everything you need
🟥 3. Configure the Agent
Open the config file:
bash
sudo nano /etc/zabbix/zabbix_agent2.conf
Set these exact values:
Code
Hostname="yourhost"
Server=zabbixserverIP
ServerActive=zabbixserverIP
Include=/etc/zabbix/zabbix_agent2.d/*.conf
Why these matter:
- Hostname must match the host you create in Zabbix
- Server is for passive checks
- ServerActive is for active checks
- Include loads plugin configs
🟥 4. (Optional) Enable Docker Monitoring
If you want Zabbix to monitor Docker containers on the Ubuntu host:
Add this:
Code
Plugins.Docker.Endpoint=unix:///var/run/docker.sock
This gives you container CPU, RAM, I/O, uptime, etc.
🟥 5. Restart and Enable the Agent
bash
sudo systemctl restart zabbix-agent2
sudo systemctl enable zabbix-agent2
You ONLY need to open 10050 on the AGENT HOST.
Run this:
Code
sudo ufw allow 10050/tcp
sudo ufw reload
That’s it.
🟥 6. Verify the Agent is Running
bash
systemctl status zabbix-agent2
You want:
Code
Active: active (running)
🟥 7. Test Agent Connectivity
bash
zabbix_agent2 -t agent.ping
Expected output:
Code
agent.ping [t|1]
If you see:
Code
cannot connect to [zabbixserverIP:10051]
Then your server isn’t reachable — but your config is correct.
🟥 8. Add the Host in Zabbix Frontend
Go to:
Configuration → Hosts → Create host
Set:
- Hostname: docker-host
- Agent interface: docker-host:10050
- Templates: Linux OS template
Save.
Within seconds, the agent will turn green.