TECHNICAL GUIDE

Use this guide as an implementation reference. Validate commands, policies and version-specific behaviour in a lab before applying changes to production systems.

1. Plan the monitoring stack

Zabbix is an infrastructure monitoring platform built around a server, database, web frontend and agents/proxies. This guide uses Zabbix 7.4 packages on Ubuntu 24.04 (Noble), MySQL and Nginx. Zabbix 8.0 may be the current major release by the time you deploy; choose the intended branch deliberately and keep repository, server, frontend and agent versions aligned.

For larger environments, use a dedicated database, tune retention and history, and deploy proxies near remote networks. Never expose the database port to the internet.

2. Update Ubuntu and add the official Zabbix repository

sudo apt update && sudo apt full-upgrade -y\nsudo apt install -y wget ca-certificates gnupg\ncd /tmp\nwget https://repo.zabbix.com/zabbix/7.4/release/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest_7.4+ubuntu24.04_all.deb\nsudo dpkg -i zabbix-release_latest_7.4+ubuntu24.04_all.deb\nsudo apt update

Use the repository package that matches your Ubuntu release and selected Zabbix branch. Confirm the package name and current release URL on the official Zabbix download page before running it.

3. Install Zabbix server, frontend, agent and database

sudo apt install -y mysql-server nginx php-fpm php-mysql \\\n  zabbix-server-mysql zabbix-frontend-php \\\n  zabbix-nginx-conf zabbix-sql-scripts zabbix-agent2

Package dependencies may select a specific PHP-FPM version on your Ubuntu release. Check the installed socket path before configuring Nginx.

4. Create the Zabbix database

sudo mysql

At the MySQL prompt, create the database with the character set required by the Zabbix release and a dedicated user.

CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;\nCREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'REPLACE_WITH_STRONG_PASSWORD';\nGRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';\nSET GLOBAL log_bin_trust_function_creators = 1;\nEXIT;

Import the schema using the compressed SQL file shipped by the Zabbix SQL scripts package. The exact path may vary slightly by package version; locate it with dpkg -L zabbix-sql-scripts.

zcat /usr/share/zabbix/sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

After import, set log_bin_trust_function_creators back to 0 if required by your MySQL configuration.

5. Configure the Zabbix server

sudo nano /etc/zabbix/zabbix_server.conf

Set the database name, user and password:

DBName=zabbix\nDBUser=zabbix\nDBPassword=REPLACE_WITH_STRONG_PASSWORD

Protect the configuration file and ensure the Zabbix service account can read it. Avoid placing secrets in shell command history.

6. Configure Nginx and PHP-FPM

Open the Zabbix Nginx configuration supplied by the package, commonly under /etc/zabbix/nginx.conf. Set the intended server name and listen port, then ensure the PHP-FPM socket matches the installed PHP version. Disable the default Nginx site if it conflicts.

sudo nginx -t\nsudo systemctl enable --now mysql nginx php8.3-fpm\nsudo systemctl restart zabbix-server zabbix-agent2\nsudo systemctl status zabbix-server

If your host uses a different PHP-FPM service name, substitute the actual version. Keep the web frontend accessible only through the intended management network until HTTPS is enabled.

7. Complete the web installer

Browse to the configured Zabbix frontend hostname or local test URL. Complete the wizard with database host localhost, database zabbix, user zabbix and the password you created. Set the Zabbix server name and finish the setup. Change the default administrator password immediately and create named administrator accounts.

8. Add a host and validate monitoring

Install the Zabbix agent on the server or a test endpoint, configure its server/active server addresses and hostname, then add the host in the frontend using a suitable Linux template. Verify latest data, availability and trigger events.

sudo systemctl enable --now zabbix-agent2\nsudo systemctl status zabbix-agent2\nsudo journalctl -u zabbix-server -n 60 --no-pager\nsudo journalctl -u zabbix-agent2 -n 60 --no-pager

Use the Zabbix server's own logs and frontend monitoring pages to diagnose database, poller and agent connectivity problems.

9. Secure and tune the deployment

  • Allow TCP 10051 only from approved proxies/agents; TCP 10050 only where passive checks are used.
  • Restrict the web frontend to administrators and enforce HTTPS.
  • Set database backups, housekeeping and retention according to capacity.
  • Use SNMPv3 where supported and protect SNMP credentials.
  • Monitor Zabbix internal processes, queue size, database growth and disk space.
  • Back up database, configuration, scripts, certificates and custom templates.

Official references

Conclusion

A working Zabbix dashboard is only the start. Secure the frontend, tune database retention, protect agent communication and validate alerts with real test events before relying on monitoring for operations.

Found this useful?