FedoraRHEL Based

How To Install Zabbix on Fedora 42

Install Zabbix on Fedora 42

Zabbix stands as one of the most powerful open-source monitoring solutions available today, offering comprehensive network infrastructure monitoring capabilities for enterprises and organizations of all sizes. This enterprise-class monitoring platform enables system administrators and DevOps engineers to track server performance, monitor virtual machines, and oversee network devices with unprecedented precision and reliability.

Fedora 42 provides an excellent foundation for hosting Zabbix server installations due to its cutting-edge package management system, robust security features, and strong community support. The combination of Fedora’s stability and Zabbix’s monitoring prowess creates a formidable infrastructure monitoring solution that can scale from small business environments to large enterprise deployments.

This comprehensive guide will walk you through the complete installation process of Zabbix on Fedora 42, covering everything from initial system preparation to advanced security configurations. Whether you’re a seasoned system administrator or a DevOps professional looking to implement robust monitoring solutions, this tutorial provides detailed instructions, troubleshooting tips, and best practices to ensure a successful deployment.

The installation process typically takes 45-60 minutes to complete, depending on your system specifications and network connectivity. By following this guide, you’ll establish a fully functional Zabbix monitoring environment capable of monitoring thousands of devices and collecting millions of metrics per hour.

Prerequisites and System Requirements

Before beginning the Zabbix installation on Fedora 42, ensure your system meets the essential hardware and software requirements for optimal performance. These specifications are based on official Zabbix documentation and real-world deployment experiences.

Hardware Requirements:

  • RAM: Minimum 2GB, strongly recommended 4GB or more for production environments
  • Disk Space: At least 20GB free space for system files and Zabbix data storage
  • CPU: Dual-core processor minimum, quad-core recommended for handling multiple monitored devices
  • Network Interface: Stable internet connection for package downloads and updates

Software Prerequisites:

  • Fresh installation of Fedora 42 (minimal or server edition preferred)
  • Root access or sudo privileges for system administration tasks
  • Basic understanding of Linux command-line operations and text editors
  • Familiarity with database management concepts and web server configuration

Network Configuration Requirements:

  • Static IP address configuration recommended for production deployments
  • DNS resolution properly configured for hostname lookup
  • Firewall access planning for ports 80/443 (web interface), 10050 (agent), and 10051 (server communication)

Security Considerations:

  • SELinux should be properly configured rather than disabled
  • Regular system backup procedures established before installation
  • Network segmentation planning for monitoring traffic isolation
  • User account management strategy for Zabbix frontend access

Clean Environment Recommendations:
Installing Zabbix on a fresh Fedora 42 system minimizes potential conflicts with existing services and ensures optimal performance. If installing on an existing system, verify that no conflicting web servers or database services are running that might interfere with the Zabbix installation process.

System Preparation and Updates

Proper system preparation forms the foundation of a successful Zabbix installation. Start by ensuring your Fedora 42 system has the latest security patches and package updates installed.

Update System Packages:

sudo dnf update -y
sudo dnf install -y wget curl vim net-tools

This command updates all installed packages to their latest versions, incorporating security patches and bug fixes that ensure compatibility with Zabbix components.

Configure Hostname and Network Settings:

sudo hostnamectl set-hostname zabbix-server.yourdomain.com
sudo systemctl restart systemd-hostnamed

Proper hostname configuration ensures Zabbix can correctly identify itself within your network infrastructure and facilitates SSL certificate generation if required.

SELinux Configuration:
Rather than disabling SELinux entirely, configure it properly to work with Zabbix:

sudo setsebool -P httpd_can_network_connect on
sudo setsebool -P zabbix_can_network on

These commands allow Apache and Zabbix to establish necessary network connections while maintaining system security.

Basic Firewall Preparation:

sudo systemctl enable firewalld
sudo systemctl start firewalld
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --reload

Configure essential firewall rules while keeping the system secure. Additional Zabbix-specific ports will be opened later in the installation process.

System Verification:

sudo systemctl status firewalld
free -h
df -h

Verify that all services are running correctly and sufficient system resources are available for Zabbix installation.

Installing LAMP Stack Components

Zabbix requires a complete LAMP (Linux, Apache, MySQL/MariaDB, PHP) stack to function properly. This section covers the installation and initial configuration of each component.

Apache Web Server Installation:

sudo dnf install -y httpd httpd-tools
sudo systemctl enable httpd
sudo systemctl start httpd

Apache serves as the web server for the Zabbix frontend interface, handling HTTP requests and serving PHP content to users accessing the monitoring dashboard.

MariaDB Database Installation:

sudo dnf install -y mariadb-server mariadb
sudo systemctl enable mariadb
sudo systemctl start mariadb

MariaDB provides the database backend for storing Zabbix configuration data, historical metrics, and monitoring information.

Database Security Configuration:

sudo mysql_secure_installation

Run the secure installation script to set root password, remove test databases, and implement basic security measures. Choose strong passwords and remove anonymous users when prompted.

PHP Installation with Required Extensions:

sudo dnf install -y php php-mysqlnd php-gd php-ldap php-bcmath php-mbstring php-xml php-json php-session php-ctype php-xmlreader php-xmlwriter php-simplexml

These PHP extensions are essential for Zabbix functionality, supporting database connectivity, image generation, LDAP authentication, and XML processing capabilities.

PHP Configuration for Zabbix:
Edit /etc/php.ini to optimize settings for Zabbix:

sudo sed -i 's/max_execution_time = 30/max_execution_time = 300/' /etc/php.ini
sudo sed -i 's/memory_limit = 128M/memory_limit = 256M/' /etc/php.ini
sudo sed -i 's/post_max_size = 8M/post_max_size = 16M/' /etc/php.ini
sudo sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 8M/' /etc/php.ini

Service Verification:

sudo systemctl status httpd mariadb
php -v

Confirm all LAMP components are installed correctly and running properly before proceeding with Zabbix installation.

Adding Zabbix Repository

Since Zabbix packages are not available in the default Fedora repositories, you must add the official Zabbix repository to access the latest stable versions.

Download and Install Zabbix Repository:

sudo rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rhel/8/x86_64/zabbix-release-latest.el8.noarch.rpm

This command downloads and installs the Zabbix repository configuration file, enabling access to official Zabbix packages optimized for RHEL-based distributions.

Update Package Cache:

sudo dnf clean all
sudo dnf update
sudo dnf repolist | grep zabbix

After adding the repository, refresh the package metadata to ensure the latest Zabbix packages are available for installation.

Repository Verification:

sudo dnf search zabbix-server

Verify that Zabbix packages are accessible and list available versions to confirm successful repository addition.

GPG Key Verification:
The Zabbix repository includes GPG signatures for package verification, ensuring package integrity and authenticity during installation. DNF automatically handles GPG key verification for added security.

Installing Zabbix Components

With the repository configured, install the core Zabbix components required for a fully functional monitoring server.

Install Core Zabbix Packages:

sudo dnf install -y zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent

This command installs:

  • zabbix-server-mysql: Core server component with MySQL/MariaDB support
  • zabbix-web-mysql: Web frontend interface with database integration
  • zabbix-apache-conf: Pre-configured Apache settings for Zabbix
  • zabbix-sql-scripts: Database schema and initial data scripts
  • zabbix-selinux-policy: SELinux policies for secure operation
  • zabbix-agent: Local monitoring agent for server self-monitoring

Install Additional Utilities:

sudo dnf install -y zabbix-get zabbix-sender

These utilities provide command-line tools for testing connectivity and sending custom metrics to the Zabbix server.

Package Installation Verification:

rpm -qa | grep zabbix
ls -la /etc/zabbix/

Confirm all Zabbix packages are installed correctly and configuration directories are created properly.

File Permission Verification:

sudo ls -la /usr/share/zabbix/
sudo ls -la /usr/sbin/zabbix_*

Verify that Zabbix files have appropriate permissions and are accessible to the system.

The installation process automatically creates the zabbix user account and group, establishes necessary directory structures, and configures basic file permissions for secure operation.

Database Setup and Configuration

Database configuration represents a critical phase in Zabbix installation, requiring careful attention to security, performance, and data integrity.

Access MariaDB and Create Database:

sudo mysql -u root -p

Once connected to MariaDB, execute the following SQL commands:

CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'SecureZabbixPassword123!';
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Use a strong, unique password for the Zabbix database user to enhance security. The UTF-8 character set ensures proper support for international characters in device names and descriptions.

Import Zabbix Database Schema:

zcat /usr/share/doc/zabbix-sql-scripts/mysql/create.sql.gz | mysql -uzabbix -p zabbix

This command decompresses and imports the complete Zabbix database schema, including tables for configuration data, historical metrics, events, and user management.

Database Performance Optimization:
Edit /etc/my.cnf.d/mariadb-server.cnf to optimize MariaDB for Zabbix:

[mysqld]
innodb_buffer_pool_size = 512M
innodb_log_file_size = 64M
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT
max_connections = 200
query_cache_size = 64M
query_cache_type = 1

These settings optimize database performance for Zabbix’s specific workload patterns, improving responsiveness for large-scale monitoring environments.

Database Security Hardening:

sudo mysql -u root -p -e "DELETE FROM mysql.user WHERE User='';"
sudo mysql -u root -p -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');"
sudo mysql -u root -p -e "DROP DATABASE IF EXISTS test;"
sudo mysql -u root -p -e "FLUSH PRIVILEGES;"

Remove default test databases and anonymous users to minimize security risks.

Database Backup Configuration:

sudo mkdir -p /opt/zabbix-backups
sudo chown mysql:mysql /opt/zabbix-backups

Establish a backup directory structure for regular database backups, essential for disaster recovery planning.

Connection Testing:

mysql -uzabbix -p zabbix -e "SHOW TABLES;" | head -10

Verify successful database creation and schema import by listing Zabbix tables.

Zabbix Server Configuration

The Zabbix server configuration file contains critical settings that determine how the monitoring server operates and connects to the database.

Edit Main Configuration File:

sudo cp /etc/zabbix/zabbix_server.conf /etc/zabbix/zabbix_server.conf.backup
sudo nano /etc/zabbix/zabbix_server.conf

Database Connection Parameters:
Locate and modify the following parameters in /etc/zabbix/zabbix_server.conf:

DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=SecureZabbixPassword123!

These settings establish the connection between Zabbix server and the MariaDB database created earlier.

Performance Optimization Settings:

StartPollers=30
StartTrappers=10
StartPingers=5
StartDiscoverers=3
CacheSize=128M
HistoryCacheSize=64M
HistoryIndexCacheSize=32M
TrendCacheSize=32M
Timeout=30

These parameters control the number of worker processes and memory allocation for different Zabbix functions, optimizing performance for medium-scale environments.

Logging Configuration:

LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=50
DebugLevel=3

Configure appropriate logging levels for troubleshooting and monitoring server operations.

Security and Network Settings:

ListenPort=10051
ListenIP=0.0.0.0
SourceIP=your-server-ip
AllowRoot=0

Configure network listening parameters and security restrictions for Zabbix server communication.

Configuration File Validation:

sudo zabbix_server -c /etc/zabbix/zabbix_server.conf -t

Test the configuration file syntax to identify any errors before starting services.

File Permissions:

sudo chown zabbix:zabbix /etc/zabbix/zabbix_server.conf
sudo chmod 640 /etc/zabbix/zabbix_server.conf

Set appropriate file permissions to protect sensitive configuration data while allowing Zabbix access.

Web Interface Installation and Setup

The Zabbix web interface provides the primary method for configuring monitoring settings, viewing data, and managing the monitoring environment.

PHP-FPM Configuration for Zabbix:

sudo nano /etc/php-fpm.d/zabbix.conf

Modify the timezone setting in the Zabbix PHP-FPM configuration:

php_value[date.timezone] = Asia/Jakarta
php_value[max_execution_time] = 300
php_value[memory_limit] = 256M
php_value[post_max_size] = 16M
php_value[upload_max_filesize] = 8M

Adjust the timezone to match your server location for accurate timestamp display throughout the Zabbix interface.

Apache Virtual Host Configuration:
The Zabbix Apache configuration file at /etc/httpd/conf.d/zabbix.conf contains pre-configured settings. Review and modify if necessary:

<VirtualHost *:80>
    DocumentRoot /usr/share/zabbix
    ServerName zabbix-server.yourdomain.com
    
    <Directory "/usr/share/zabbix">
        Options FollowSymLinks
        AllowOverride None
        Require all granted
    </Directory>
</VirtualHost>

Start Required Services:

sudo systemctl restart php-fpm httpd
sudo systemctl enable php-fpm

Ensure PHP-FPM and Apache are running with the updated configurations.

Web Installation Wizard:
Open your web browser and navigate to http://your-server-ip/zabbix to begin the web-based installation process.

Install Zabbix on Fedora 42

Installation Steps:

  1. Welcome Screen: Click “Next step” to proceed
  2. Prerequisites Check: Verify all requirements show “OK” status
  3. Database Configuration: Enter database details:
    • Database type: MySQL
    • Database host: localhost
    • Database port: 3306
    • Database name: zabbix
    • User: zabbix
    • Password: Your secure password
  4. Zabbix Server Details:
    • Host: localhost
    • Port: 10051
    • Name: Zabbix Server
  5. Pre-Installation Summary: Review settings and proceed
  6. Configuration File Download: Download zabbix.conf.php

Configuration File Installation:

sudo mkdir -p /usr/share/zabbix/conf
sudo mv ~/Downloads/zabbix.conf.php /usr/share/zabbix/conf/
sudo chown apache:apache /usr/share/zabbix/conf/zabbix.conf.php

Initial Login:
Access the Zabbix frontend using default credentials:

  • Username: Admin
  • Password: zabbix

Immediate Security Steps:

  1. Change the default administrator password immediately
  2. Create additional user accounts with appropriate permissions
  3. Configure basic notification settings for critical alerts

Security Configuration and Best Practices

Implementing robust security measures protects your Zabbix installation from unauthorized access and potential security threats.

Firewall Configuration:

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --permanent --add-port=10050/tcp
sudo firewall-cmd --permanent --add-port=10051/tcp
sudo firewall-cmd --reload

Open necessary ports while maintaining security by restricting access to only required services.

SSL/TLS Implementation:

sudo dnf install -y mod_ssl
sudo systemctl restart httpd

Install SSL module for Apache and configure HTTPS access for encrypted web interface communication.

Content Security Policy (CSP):
Add CSP headers to Apache configuration for enhanced web security:

Header always set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'"

This configuration protects against cross-site scripting (XSS) attacks and data injection attempts.

HTTP Strict Transport Security (HSTS):

Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"

Implement HSTS to prevent protocol downgrade attacks and ensure secure connections.

User Access Control:

  • Implement principle of least privilege for all user accounts
  • Create role-based user groups with specific permissions
  • Configure session timeout settings for enhanced security
  • Enable two-factor authentication where possible

System Hardening:

sudo systemctl disable unnecessary-service
sudo chmod 750 /etc/zabbix/
sudo chown -R zabbix:zabbix /var/log/zabbix/

Disable unnecessary services and implement proper file permissions throughout the Zabbix installation.

Regular Security Maintenance:

  • Schedule automatic security updates for critical components
  • Implement log monitoring and alerting for suspicious activities
  • Perform regular security audits and vulnerability assessments
  • Maintain current backups of configuration and database files

Starting and Enabling Services

Proper service management ensures Zabbix components start correctly and automatically restart after system reboots.

Service Startup Sequence:

sudo systemctl start mariadb
sudo systemctl start httpd
sudo systemctl start php-fpm
sudo systemctl start zabbix-server
sudo systemctl start zabbix-agent

Start services in the correct order to ensure database connectivity and proper initialization.

Enable Automatic Startup:

sudo systemctl enable mariadb httpd php-fpm zabbix-server zabbix-agent

Configure all services to start automatically during system boot, ensuring monitoring remains active after maintenance reboots.

Service Status Verification:

sudo systemctl status zabbix-server --no-pager
sudo systemctl status zabbix-agent --no-pager
sudo ss -tulpn | grep :10051

Verify that all services are running correctly and listening on appropriate ports.

Log File Monitoring:

sudo tail -f /var/log/zabbix/zabbix_server.log

Monitor server logs during initial startup to identify any configuration issues or connectivity problems.

Troubleshooting Common Issues

Understanding common installation problems and their solutions helps ensure a successful Zabbix deployment.

Database Connection Problems:
If Zabbix server fails to connect to the database:

mysql -uzabbix -p zabbix -e "SELECT 1;"
sudo systemctl status mariadb

Verify database connectivity and service status. Check /var/log/zabbix/zabbix_server.log for specific error messages.

Web Interface Access Issues:
For web interface problems:

sudo systemctl status httpd php-fpm
sudo tail /var/log/httpd/error_log

Common solutions include checking PHP extension installation, verifying file permissions, and ensuring Apache configuration is correct.

Service Startup Failures:

sudo journalctl -u zabbix-server -f
sudo zabbix_server -c /etc/zabbix/zabbix_server.conf -f

Run Zabbix server in foreground mode to identify configuration errors or missing dependencies.

Performance Optimization:
For slow performance:

  • Increase database cache sizes in MariaDB configuration
  • Adjust Zabbix server process counts based on monitored device quantity
  • Optimize PHP memory limits and execution times
  • Monitor system resource utilization and adjust accordingly

SELinux Context Issues:

sudo restorecon -R /usr/share/zabbix/
sudo setsebool -P httpd_can_network_connect on

Restore proper SELinux contexts and enable necessary boolean settings for Zabbix operation.

Congratulations! You have successfully installed Zabbix. Thanks for using this tutorial for installing the Zabbix open-source monitoring software on your Fedora 42 Linux system. For additional or useful information, we recommend you check the official Zabbix website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button