AlmaLinuxRHEL Based

How To Install Zabbix on AlmaLinux 10

Install Zabbix on AlmaLinux 10

Zabbix stands as one of the most powerful open-source monitoring solutions available today, offering comprehensive network monitoring, server monitoring, and application performance monitoring capabilities. When paired with AlmaLinux 10, a stable and secure enterprise-grade Linux distribution, it creates an ideal monitoring infrastructure for organizations of all sizes.

AlmaLinux 10 provides exceptional compatibility with enterprise monitoring tools, making it the perfect choice for hosting Zabbix installations. This robust combination delivers enterprise-level stability, long-term support, and seamless integration capabilities that monitoring professionals demand.

This comprehensive guide will walk you through the complete installation process of Zabbix on AlmaLinux 10. You’ll learn how to set up the entire monitoring stack from scratch, including database configuration, web server setup, and essential security hardening measures. By following these detailed instructions, you’ll have a fully functional Zabbix monitoring system capable of handling both small-scale and enterprise-level monitoring requirements.

Whether you’re a system administrator looking to implement centralized monitoring or an IT professional seeking to enhance your infrastructure visibility, this guide provides everything needed for a successful deployment. The installation process covers all critical components while maintaining security best practices throughout.

Prerequisites and System Requirements

Hardware Requirements

Before beginning the Zabbix installation on AlmaLinux 10, ensure your system meets the minimum hardware specifications. For basic monitoring environments, allocate at least 2GB of RAM, though 4GB provides better performance for growing infrastructures. The CPU requirements are modest—a dual-core processor handles most small to medium deployments effectively.

Storage considerations are crucial for long-term monitoring data retention. Plan for at least 20GB of available disk space for the initial installation, with additional space allocated based on your monitoring scope and data retention policies. Production environments benefit significantly from faster storage solutions like SSDs, particularly for database operations.

For enterprise deployments monitoring hundreds of hosts, consider 8GB of RAM or more, along with dedicated storage for database files. Network monitoring scenarios require additional bandwidth considerations, especially when collecting SNMP data from numerous devices.

Software Prerequisites

AlmaLinux 10 must be freshly installed and updated to the latest package versions before proceeding with Zabbix installation. Root access or sudo privileges are essential for installing packages and configuring system services throughout this process.

Stable network connectivity is mandatory for downloading packages from official repositories and maintaining communication between monitoring components. DNS resolution should be properly configured, as Zabbix relies on hostname resolution for many monitoring functions.

Ensure your AlmaLinux 10 system has access to standard repositories. Some installations may require additional repository configurations, particularly in restricted network environments or air-gapped systems.

Pre-installation Checklist

Verify system updates are current by running package manager updates. Check that SELinux is properly configured—while it can remain enabled, proper policies must be in place for Zabbix components to function correctly.

Confirm firewall settings allow necessary traffic flows. Document current system configurations before making changes, enabling quick rollback if issues arise during installation.

Network connectivity to external repositories should be tested, ensuring package downloads won’t fail during critical installation phases. Time synchronization is also important for accurate monitoring data collection.

System Preparation

Updating the System

Begin by updating your AlmaLinux 10 system to ensure all packages are current and security patches are applied. This step is crucial for maintaining system integrity and compatibility with Zabbix components.

sudo dnf update -y

The update process may take several minutes depending on your system’s current state and available updates. After completion, consider rebooting if kernel updates were installed, though this isn’t always necessary for application-level updates.

System updates provide the foundation for a stable Zabbix installation. Updated packages often include security fixes and compatibility improvements that benefit monitoring applications.

Installing Essential Packages

Several utility packages prove invaluable during Zabbix installation and ongoing administration. Install these essential tools before proceeding with the main installation.

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

The EPEL repository provides additional packages that may be required for certain Zabbix features or third-party integrations:

sudo dnf install -y epel-release
sudo dnf update -y

These packages provide command-line tools for troubleshooting network issues, editing configuration files, and managing system processes. Having them available prevents interruptions during the installation process.

Configuring SELinux

SELinux provides enhanced security but requires proper configuration for Zabbix components. While you can set SELinux to permissive mode during installation, the recommended approach involves configuring appropriate policies.

Check current SELinux status:

sestatus

If running in enforcing mode, temporarily set to permissive for installation:

sudo setenforce 0
sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config

After successful Zabbix installation, you can re-enable SELinux with proper policies. This approach balances security with installation simplicity.

Database Installation and Configuration

Installing MySQL/MariaDB

Zabbix supports multiple database backends, but MariaDB offers excellent performance and compatibility with AlmaLinux 10. The choice between MySQL and MariaDB often depends on existing infrastructure and organizational preferences.

Install MariaDB server and client packages:

sudo dnf install -y mariadb-server mariadb

Enable and start the MariaDB service:

sudo systemctl enable mariadb
sudo systemctl start mariadb

Verify the service is running correctly:

sudo systemctl status mariadb

MariaDB provides robust performance for Zabbix deployments while maintaining compatibility with MySQL-based applications and tools.

Securing Database Installation

Database security is paramount for monitoring infrastructure. The MariaDB security script addresses common security concerns and establishes proper access controls.

Run the security script:

sudo mysql_secure_installation

Follow the interactive prompts to:

  • Set a strong root password
  • Remove anonymous users
  • Disable remote root login
  • Remove test databases
  • Reload privilege tables

Choose a complex root password combining uppercase letters, lowercase letters, numbers, and special characters. This password will be required for database administrative tasks.

Document the root password securely, as you’ll need it for Zabbix database setup and ongoing maintenance operations.

Creating Zabbix Database

Zabbix requires a dedicated database with specific configuration parameters. Create the database and user account with appropriate permissions.

Connect to MariaDB as root:

sudo mysql -u root -p

Execute the following SQL commands:

CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'StrongPasswordHere';
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';
SET GLOBAL log_bin_trust_function_creators = 1;
FLUSH PRIVILEGES;
EXIT;

The UTF8MB4 character set ensures proper handling of international characters and emojis in monitoring data. The log_bin_trust_function_creators setting allows Zabbix to create necessary database functions during schema import.

Replace ‘StrongPasswordHere’ with a complex password different from the root password. Document this password as it’s required for Zabbix server configuration.

Zabbix Repository Setup and Package Installation

Adding Zabbix Repository

Official Zabbix repositories provide the most current and stable packages for AlmaLinux 10. Adding these repositories ensures access to latest features and security updates.

Download and install the Zabbix repository package:

sudo rpm -Uvh https://repo.zabbix.com/zabbix/7.4/alma/10/x86_64/zabbix-release-7.4-1.el10.noarch.rpm

Clean the package cache to ensure fresh repository data:

sudo dnf clean all
sudo dnf makecache

Verify the repository is properly configured:

sudo dnf repolist | grep zabbix

The official repository provides GPG-signed packages, ensuring package integrity and authenticity. This approach is more secure than downloading individual packages from third-party sources.

Repository configuration enables automatic updates through standard package management tools, simplifying long-term maintenance.

Installing Zabbix Components

Zabbix consists of multiple components that work together to provide comprehensive monitoring capabilities. Install the core components required for a standard deployment.

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

This command installs:

  • Zabbix server with MySQL support
  • Web interface with MySQL backend
  • Apache configuration files
  • Database schema scripts
  • SELinux policies
  • Zabbix agent for local monitoring

Package installation may take several minutes as dependencies are resolved and downloaded. The installer handles dependency management automatically.

PHP Module Configuration

Zabbix web interface requires specific PHP modules and configuration settings. AlmaLinux 10 includes PHP 8.0+ by default, which is compatible with current Zabbix versions.

Verify PHP installation and version:

php --version

Install additional PHP modules if not already present:

sudo dnf install -y php-mysqlnd php-bcmath php-mbstring php-gd php-xml php-ldap

These modules provide database connectivity, mathematical functions, string handling, graphics support, XML processing, and LDAP authentication capabilities.

Zabbix Server Configuration

Database Schema Import

Zabbix requires initial database schema and data import before the server can start. This process creates all necessary tables, indexes, and initial configuration data.

Locate the schema files:

ls /usr/share/zabbix-sql-scripts/mysql/

Import the database schema:

sudo mysql -u zabbix -p zabbix < /usr/share/zabbix-sql-scripts/mysql/server.sql.gz

Enter the zabbix database user password when prompted. The import process may take several minutes depending on system performance.

If you encounter permissions issues, verify the zabbix database user has appropriate privileges and the database exists with correct character set settings.

Server Configuration File

The Zabbix server configuration file contains critical settings for database connectivity, logging, and operational parameters. Proper configuration ensures optimal performance and reliability.

Edit the main configuration file:

sudo vim /etc/zabbix/zabbix_server.conf

Configure essential parameters:

DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=StrongPasswordHere

Additional recommended settings:

LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=10
DebugLevel=3
PidFile=/run/zabbix/zabbix_server.pid
SocketDir=/var/lib/zabbix

Replace ‘StrongPasswordHere’ with the actual database password created earlier. These settings configure basic connectivity and logging behavior.

Advanced configurations can include timeout settings, cache sizes, and performance tuning parameters based on your monitoring requirements.

Agent Configuration

The Zabbix agent enables monitoring of the server hosting the Zabbix installation. Configure the agent for local system monitoring.

Edit the agent configuration:

sudo vim /etc/zabbix/zabbix_agent2.conf

Essential agent settings:

Server=127.0.0.1
ServerActive=127.0.0.1
Hostname=zabbix-server

The Server parameter specifies which Zabbix servers can request data from this agent. ServerActive enables active checks, allowing the agent to initiate connections to the server.

Choose a meaningful hostname that identifies this system in your monitoring environment. This hostname will appear in the Zabbix web interface.

Web Server Setup and PHP Configuration

Apache Configuration

Zabbix web interface requires a properly configured web server. Apache HTTP Server provides excellent compatibility and performance for Zabbix installations.

Install Apache if not already present:

sudo dnf install -y httpd

Enable and start Apache:

sudo systemctl enable httpd
sudo systemctl start httpd

The Zabbix Apache configuration file is automatically installed with the web interface package. Verify the configuration:

sudo cat /etc/httpd/conf.d/zabbix.conf

This file contains virtual host settings, PHP configurations, and directory permissions specific to Zabbix requirements.

PHP-FPM Configuration

Modern web applications benefit from PHP-FPM for improved performance and resource management. Configure PHP settings to support Zabbix requirements.

Edit PHP configuration for Zabbix:

sudo nano /etc/php.ini

Essential PHP settings:

max_execution_time = 300
max_input_time = 300
memory_limit = 128M
post_max_size = 16M
upload_max_filesize = 2M
date.timezone = America/New_York

Replace the timezone with your local timezone. These settings ensure PHP can handle Zabbix operations without timeout issues.

Restart Apache to apply changes:

sudo systemctl restart httpd

SSL/TLS Setup

HTTPS encryption protects monitoring data and authentication credentials. While optional for testing, SSL/TLS is essential for production deployments.

Generate a self-signed certificate for testing:

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/zabbix.key -out /etc/ssl/certs/zabbix.crt

For production environments, obtain certificates from trusted certificate authorities or use Let’s Encrypt for automated certificate management.

Configure Apache for HTTPS by modifying the Zabbix virtual host configuration to include SSL directives and certificate paths.

Service Management and Startup

Starting Core Services

Zabbix operation requires multiple services running in coordination. Start services in the correct order to ensure proper initialization.

Start Zabbix server:

sudo systemctl start zabbix-server

Enable automatic startup:

sudo systemctl enable zabbix-server

Start Zabbix agent:

sudo systemctl start zabbix-agent2
sudo systemctl enable zabbix-agent2

Restart Apache to load Zabbix web interface:

sudo systemctl restart httpd

Troubleshooting Service Issues

Service startup problems often indicate configuration errors or missing dependencies. Check service status to identify issues.

Check Zabbix server status:

sudo systemctl status zabbix-server

Review log files for detailed error messages:

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

Common issues include database connectivity problems, file permission errors, or SELinux policy violations. Log files provide specific error messages to guide troubleshooting efforts.

If services fail to start, verify configuration file syntax and ensure all required packages are installed correctly.

Firewall Configuration

Required Ports

Network monitoring requires specific ports to be accessible for communication between Zabbix components and monitored systems.

Open HTTP port for web interface access:

sudo firewall-cmd --permanent --add-service=http

Open HTTPS port if using SSL:

sudo firewall-cmd --permanent --add-service=https

Open Zabbix agent port for monitoring communication:

sudo firewall-cmd --permanent --add-port=10050/tcp

Firewall Commands

Configure firewall rules to allow necessary traffic while maintaining security. The permanent flag ensures rules persist across reboots.

If your Zabbix server will monitor remote systems, open the server port:

sudo firewall-cmd --permanent --add-port=10051/tcp

Reload firewall configuration to apply changes:

sudo firewall-cmd --reload

Verify active firewall rules:

sudo firewall-cmd --list-all

Document firewall changes for future reference and troubleshooting. Consider restricting access to specific networks in production environments.

Web Interface Setup and Initial Configuration

Accessing the Web Interface

The Zabbix web interface provides the primary management console for your monitoring infrastructure. Access the installation wizard through your web browser.

Navigate to: http://your-server-ip/zabbix

The setup wizard guides you through initial configuration steps, including database connectivity verification and administrative account creation.

Install Zabbix on AlmaLinux 10

Follow the wizard prompts carefully, as incorrect settings can require manual database cleanup to correct.

Administrative Account Setup

Zabbix includes a default administrative account for initial access. Change default credentials immediately to maintain security.

Default login credentials:

  • Username: Admin
  • Password: zabbix

After successful login, navigate to Administration > Users to modify the default account. Set a strong password and consider changing the username for additional security.

Create additional user accounts with appropriate permissions based on your organizational needs. Zabbix supports role-based access control for fine-grained permission management.

Basic Configuration

Configure essential monitoring parameters through the web interface. Start with basic templates and gradually expand monitoring capabilities.

Navigate to Configuration > Templates to explore available monitoring templates. These templates provide pre-configured monitoring scenarios for common systems and applications.

Set up notification methods under Administration > Media types. Email notifications provide essential alerting capabilities for monitoring administrators.

Configure global settings under Administration > General to customize timezone, working time, and other operational parameters.

Post-Installation Optimization

Performance Tuning

Optimize Zabbix performance for your specific monitoring requirements and system capacity. Database tuning often provides the most significant performance improvements.

Configure MariaDB for Zabbix workloads:

sudo vim /etc/mysql/mariadb.conf.d/99-zabbix.cnf

Add performance tuning parameters:

[mysqld]
innodb_buffer_pool_size = 1G
innodb_log_file_size = 128M
innodb_log_buffer_size = 32M
max_connections = 200

Adjust buffer pool size based on available RAM. Generally, allocate 70-80% of available memory to the buffer pool for dedicated database servers.

Security Hardening

Implement security measures to protect your monitoring infrastructure from unauthorized access and potential threats.

Re-enable SELinux with proper policies:

sudo setenforce 1
sudo sed -i 's/^SELINUX=.*/SELINUX=enforcing/' /etc/selinux/config

Configure network access restrictions through firewall rules limiting connections to specific IP ranges or networks.

Implement regular password policies and consider integrating with existing authentication systems like LDAP or Active Directory for centralized user management.

Regular security updates ensure protection against known vulnerabilities. Subscribe to Zabbix security announcements for timely update notifications.

Verification and Testing

System Health Checks

Verify all Zabbix components are functioning correctly before adding monitoring targets. Systematic testing prevents issues in production monitoring scenarios.

Check service status:

sudo systemctl status zabbix-server zabbix-agent2 httpd mariadb

All services should show active (running) status. If any service shows failed or inactive status, investigate using log files and service-specific troubleshooting steps.

Test database connectivity:

sudo mysql -u zabbix -p zabbix -e "SELECT COUNT(*) FROM hosts;"

This query should return a count of configured hosts without errors.

Basic Monitoring Setup

Add the local server as the first monitoring target to verify agent communication and data collection.

In the web interface, navigate to Configuration > Hosts and click Create host. Configure:

  • Host name: Zabbix server
  • Groups: Linux servers
  • Agent interfaces: 127.0.0.1:10050

Link appropriate templates such as “Linux by Zabbix agent” for comprehensive system monitoring.

Enable the host and wait several minutes for initial data collection. Navigate to Monitoring > Hosts to verify data collection is functioning correctly.

Troubleshooting Common Issues

Database Connection Problems

Database connectivity issues are among the most common installation problems. Symptoms include server startup failures and web interface database errors.

Verify database credentials in configuration files match the created database user and password. Common issues include typos in passwords or incorrect database names.

Test database connectivity manually:

sudo mysql -u zabbix -p zabbix

If connection fails, verify the database user exists and has appropriate privileges on the zabbix database.

Check MariaDB error logs for detailed error messages:

sudo journalctl -u mariadb -f

Web Interface Issues

Web interface problems often stem from PHP configuration or file permission issues. Check Apache error logs for specific error messages.

sudo tail -f /var/log/httpd/error_log

Common issues include insufficient PHP memory limits, missing PHP modules, or incorrect file permissions on Zabbix web interface files.

Verify PHP configuration meets Zabbix requirements by accessing the PHP info page or checking the Zabbix web interface system requirements section.

Service Startup Problems

Service startup failures usually indicate configuration errors or dependency issues. SELinux policies can prevent proper service operation even when configuration appears correct.

Check SELinux audit logs for policy violations:

sudo sealert -a /var/log/audit/audit.log

Port conflicts can prevent services from binding to required network ports. Use netstat or ss commands to identify port usage conflicts.

Maintenance and Updates

Regular Maintenance Tasks

Establish regular maintenance procedures to ensure optimal Zabbix performance and reliability. Database maintenance is particularly important for long-term stability.

Configure database maintenance through Zabbix housekeeping settings in Administration > General > Housekeeping. Set appropriate retention periods for different data types based on your requirements.

Monitor database growth and plan storage capacity accordingly. Large monitoring environments may require database optimization and archiving strategies.

Log rotation prevents log files from consuming excessive disk space. Configure logrotate for Zabbix log files:

sudo vim /etc/logrotate.d/zabbix

Update Procedures

Keep Zabbix updated to benefit from security fixes and feature improvements. Test updates in development environments before applying to production systems.

Check for available updates:

sudo dnf check-update zabbix-server-mysql

Create database backups before major updates:

sudo mysqldump -u root -p zabbix > zabbix-backup-$(date +%Y%m%d).sql

Follow official Zabbix update procedures, which may include database schema updates and configuration file modifications.

Subscribe to Zabbix announcement mailing lists to stay informed about security updates and new releases.

Congratulations! You have successfully installed Zabbix. Thanks for using this tutorial for installing the Zabbix open-source monitoring software on your AlmaLinux OS 10 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