How to Set Up Zabbix Monitoring from Scratch
Complete guide to installing and configuring Zabbix for network and server monitoring. Covers installation, adding hosts, creating triggers, and setting up alerting.
How to Set Up Zabbix Monitoring from Scratch
Zabbix is one of the most popular open-source monitoring solutions used by IT teams worldwide. In this tutorial, you'll learn how to install Zabbix, add your first hosts, and set up alerts.
Prerequisites
- A Linux server (Ubuntu 22.04 or later recommended)
- Root or sudo access
- Basic command line knowledge
Step 1: Install Zabbix Repository
First, download and install the Zabbix repository package:
wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb
sudo dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb
sudo apt updateStep 2: Install Zabbix Server and Frontend
sudo apt install zabbix-server-pgsql zabbix-frontend-php php8.1-pgsql zabbix-nginx-conf zabbix-sql-scripts zabbix-agentStep 3: Configure the Database
Create a PostgreSQL database for Zabbix:
sudo -u postgres createuser --pwprompt zabbix
sudo -u postgres createdb -O zabbix zabbixImport the initial schema:
zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbixStep 4: Configure Zabbix Server
Edit the Zabbix server configuration:
sudo nano /etc/zabbix/zabbix_server.confSet the database password:
DBPassword=your_password_hereStep 5: Start Zabbix
sudo systemctl restart zabbix-server zabbix-agent nginx php8.1-fpm
sudo systemctl enable zabbix-server zabbix-agent nginx php8.1-fpmStep 6: Access the Web Interface
Open your browser and navigate to http://your-server-ip/zabbix. Follow the setup wizard:
- Check prerequisites — all should be green
- Enter your database credentials
- Set the server name
- Default login: Admin / zabbix
Step 7: Add Your First Host
- Go to Configuration > Hosts > Create Host
- Enter the hostname and IP address
- Link a template (e.g., "Linux by Zabbix agent")
- Click Add
Step 8: Set Up Email Alerts
- Go to Administration > Media Types
- Configure your email settings (SMTP server, port, credentials)
- Go to your user profile and add the email as a media
- Create an action under Configuration > Actions to trigger on problems
Conclusion
You now have a working Zabbix installation monitoring your first host. From here you can add more hosts, create custom dashboards, and fine-tune your alerting. Check out the Zabbix documentation for advanced features like auto-discovery and API integration.