Zabbix Server 5.0 Installation Tutorial for Ubuntu 20.04
Zabbix is an open-source monitoring and management solution that provides real-time visibility into the performance and health of IT infrastructure, networks, applications, and services. It enables organizations to monitor various aspects of their systems, including servers, network devices, databases, and more, by collecting and analyzing data on metrics such as CPU usage, memory, network traffic, and response times. Zabbix offers a centralized platform for proactive monitoring, alerting administrators of potential issues or anomalies, facilitating troubleshooting, and helping ensure the reliability and optimal performance of critical IT resources.
Pre-Requsities of Zabbix Installation
Before installing Zabbix, there are several prerequisites that you need to have in place to ensure a smooth installation and operation of the monitoring system. Here are the main prerequisites:
- Supported Operating System: Zabbix supports a variety of operating systems, including various Linux distributions, Windows, and others. Make sure to choose a supported operating system that fits your requirements.
- Hardware Requirements: The hardware requirements depend on the size of your environment and the number of monitored devices. Generally, you’ll need a server with sufficient CPU, RAM, and storage to handle the monitoring tasks.
- Database: Zabbix requires a relational database management system (RDBMS) to store configuration data, metrics, and other information. It supports databases like MySQL, PostgreSQL, Oracle, and SQLite. Ensure you have a compatible and properly configured database server.
- Web Server: Zabbix provides a web-based frontend for configuration and visualization. You’ll need a web server like Apache or Nginx to host the frontend.
- PHP: The Zabbix frontend is built using PHP, so you’ll need a compatible PHP version installed on your server.
- Database User and Schema: You need to create a dedicated user and schema in the database for Zabbix. The user should have appropriate permissions to create tables, modify data, and perform other necessary operations.
- Network Configuration: Ensure that the necessary network ports are open between Zabbix components (server, frontend, agents, proxies, etc.). The default port for the Zabbix server is 10051, and for the frontend, it’s typically 80 or 443.
- Time Synchronization: Accurate time synchronization across all components is crucial for correct data collection and correlation in Zabbix. Consider using NTP (Network Time Protocol) to ensure consistent time across your systems.
- Dependencies: Zabbix has dependencies on various libraries and packages. Make sure you have these dependencies installed before installing Zabbix.
- System Updates: Ensure your operating system is up to date with the latest patches and updates before installing Zabbix.
- Firewall and Security: Configure your firewall settings to allow the necessary traffic for Zabbix components to communicate. Also, follow best practices for securing your Zabbix installation, including using strong passwords, disabling unnecessary services, and regularly updating software.
- DNS Resolution: Make sure that DNS resolution is working correctly for all involved systems, as Zabbix components often rely on hostnames for communication.
- User Privileges: You’ll need administrative privileges to install software, configure the database, and make system-level changes.
Remember that these prerequisites may vary based on your specific setup and requirements. Always refer to the official Zabbix documentation for the most accurate and up-to-date information on prerequisites for your chosen Zabbix version and components.
apt install apache2 libapache2-mod-php
apt install mysql-server
apt install php php-mbstring php-gd php-xml php-bcmath php-ldap php-mysql
The MySQL root user’s password needs to be strong, so do that next. Run the command below and adhere to the instructions. You will obtain a password for the root account of the MySQL database server once you have finished the command listed below.
The PHP configuration variables are updated. For Apache, modify the PHP configuration file located at /etc/php/7.4/apache2/php.ini and change the timezone as necessary.
date.timezone = 'Asia/Kolkata'
Configure Zabbix Repository
dpkg -i zabbix-release_5.0-1+focal_all.deb
Installing Zabbix Server
Add Zabbix repository and install the Zabbix server and frontend packages:
apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-apache-conf
Create Zabbix Database and User
The Zabbix server’s database schema should then be created. Use the root account to log onto the MySQL server and issue the following commands to create a MySQL database and user.
$ mysql -u root -p
mysql> CREATE DATABASE zabbixdb character set utf8 collate utf8_bin;
mysql> CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON zabbixdb.* TO 'zabbix'@'localhost' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
Load the Zabbix default schema into the database after it has been created.
zcat create.sql.gz | mysql -u zabbix -p zabbixdb
Update Zabbix Configuration
Update the following database configurations by editing the Zabbix server configuration file /etc/zabbix/zabbix_server.conf in your preferred text editor. The Zabbix server will connect to the database using this.
$ vim /etc/zabbix/zabbix_server.conf
The Zabbix service should now be set to launch during system startup. Restart the service to apply any changes.
systemctl enable zabbix-server
systemctl restart zabbix-server
The Zabbix package also builds a connection to the Apache configuration directory and creates its own Apache configuration file, /etc/zabbix/apache.conf. Using the next command, let’s restart the Apache service.
systemctl restart apache2
Your system is now prepared for the installation of Zabbix. Simply complete the installation by visiting the Zabbix web installer.
Running Zabbix Web Installer
On the IP address or domain of your server, go to the /zabbix subdirectory URL to access the Zabbix online installer. As an illustration, host.tecadmin.net directs visitors to my Zabbix server. Now go to the following URL to visit Zabbix. Change the FQDN according to your setup.
And then follow the instructions as shown in the screenshots below.
Open your preferred web browser now and type http://your-server-ip/zabbix into the address bar. The next screen will bring you to the Zabbix web installation wizard:
Select the Next action button. Please view the following page:
Verify that the server has met all of the requirements. then select the button labeled “Next step.” Please view the following page:
Click the Next step button after entering the database credentials you created in the previous steps. Please view the following page:
Enter the information for your Zabbix server, then click the Next step button. Please view the following page:
Verify that all setup settings are accurate before selecting the Next step button. When the installation is successful, the following page ought to appear:
Select “Finish” from the menu. You will be taken to the Zabbix login screen, which is displayed below:
To log in, use the credentials listed below:
You will see the Zabbix dashboard as seen in the screenshot below after a successful login.
In conclusion, Zabbix Server 5.0 stands as a robust and versatile open-source monitoring solution that empowers organizations to effectively monitor their IT infrastructure, applications, and services. With its real-time visibility, automated alerts, and comprehensive reporting capabilities, Zabbix facilitates proactive management by detecting and addressing issues before they impact operations. The latest iteration, version 5.0, further enhances its capabilities with improved performance, enhanced security features, and a user-friendly interface. Whether for small-scale setups or complex enterprise environments, Zabbix Server 5.0 offers a powerful toolset for maintaining the health, performance, and reliability of critical IT resources.