Follow
Ubuntu Linux

How to Install Zabbix with Apache on Ubuntu 24.04

Richard
Written by
Richard
Feb 14, 2025 Updated Mar 20, 2026 4 min read
How to Install Zabbix with Apache on Ubuntu 24.04
How to Install Zabbix with Apache on Ubuntu 24.04

You can install Zabbix with Apache on Ubuntu 24.04 to create a powerful, open-source network monitoring system.

Zabbix is a widely-used application for real-time monitoring of IT infrastructure, including servers, network devices, and applications. Apache, a popular web server, will host the Zabbix web interface, allowing you to view and manage your monitoring data through a browser.

This guide focuses on installing Zabbix server and agent components on Ubuntu 24.04, a recent Long Term Support (LTS) release, and configuring Apache to serve the user-friendly web frontend.

⚡ Quick Answer

Install Zabbix server, PHP, and Apache packages using `sudo apt install zabbix-server-pgsql zabbix-frontend-php php8.3-pgsql zabbix-apache-conf zabbix-sql-scripts zabbix-agent`. Then, configure the Zabbix server file `/etc/zabbix/zabbix_server.conf` with your database details. Finally, restart services with `sudo systemctl restart zabbix-server zabbix-agent apache2`.

Install PostgreSQL server

Zabbix relies on databases to store its information, and it supports SQL databases like MySQL and PostgreSQL.

For this guide, we’ll use the PostgreSQL database with Zabbix.

Run the command below to install PostgreSQL.

🐧Bash / Shell
sudo apt update
sudo apt install postgresql postgresql-contrib

After installation, enable PostgreSQL services to start automatically and check their status with the command below.

🐧Bash / Shell
sudo systemctl is-enabled postgresql
sudo systemctl status postgresql

For more details on installing and using PostgreSQL on Ubuntu, check out this post.

How to install PostgreSQL on Ubuntu

Install Zabbix packages

With Apache support, you need to install some required packages for Zabbix on Ubuntu.

First, download and install the Zabbix repository for Ubuntu by running the command below.

💻Code
wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest+ubuntu24.04_all.deb

Then, run this command to install the Zabbix repository.

🐧Bash / Shell
sudo dpkg -i zabbix-release_latest+ubuntu24.04_all.deb

After adding the new repository, you’ll need to refresh your package index. Run the command below.

🐧Bash / Shell
sudo apt update

Once the Zabbix repository is installed on Ubuntu, use the command below to install the necessary packages from it.

🐧Bash / Shell
sudo apt install zabbix-server-pgsql zabbix-frontend-php php8.3-pgsql zabbix-apache-conf zabbix-sql-scripts zabbix-agent

This command will install the following packages:

  • Zabbix with PostgreSQL database support
  • Zabbix web application or frontend
  • PHP and modules, including the ‘pgsql’ module for the PostgreSQL driver
  • Apache and configuration for Zabbix
  • Zabbix SQL scripts
  • Zabbix agent for monitoring the Zabbix system

Configure Zabbix

Now that you have all the necessary Zabbix packages installed, you can configure the Zabbix environment.

First, let’s create a database and account for Zabbix to use.

Run the following two commands to create a new PostgreSQL user and database, which we’ll name ‘zabbix‘.

You’ll be prompted to create a password for the account.

🐧Bash / Shell
sudo -u postgres createuser --pwprompt zabbix
sudo -u postgres createdb -O zabbix zabbix

After creating the database and user, run the command below to import the database schema into the database you just created.

Confirm the password you created earlier.

💻Code
zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix

You should see a success message if everything went as expected.

Next, open the Zabbix configuration file at ‘/etc/zabbix/zabbix_server.conf’ using the command below.

🐧Bash / Shell
sudo nano /etc/zabbix/zabbix_server.conf

Update the ‘DBName‘, ‘DBUser‘, and ‘DBPassword‘ settings with your PostgreSQL database details.

💻Code
### Option: DBName
# Database Name
# Mandatory: yes
# Default:
# DBName=

DBName=zabbix

### Option: DBUser
#Database user.
# Mandatory: no
# Default:
# DBUser=

DBUser=zabbix

### Option: DBPassword
#Database password.
# Mandatory: no
# Default:
DBPassword=Type_DBuser_password

Save the file and exit the editor when you’re done.

Restart Zabbix services

PostgreSQL and Apache are now configured and ready. However, you must restart the Zabbix services.

Run the commands below to restart the services.

🐧Bash / Shell
sudo systemctl restart zabbix-server zabbix-agent apache2
sudo systemctl enable zabbix-server zabbix-agent apache2

You can check the status after restarting the services with the command below.

🐧Bash / Shell
sudo systemctl status zabbix-server zabbix-agent apache2

Access Zabbix

The Zabbix services should now be configured and running. Open your browser and navigate to your server’s hostname to access the installation wizard.

http://localhost/zabbix

Select your preferred installation language and proceed.

Zabbix installation wizard interface during setup on Ubuntu 24.04 server
Zabbix installation wizard interface during setup on Ubuntu 24.04 server

Configure the database

Zabbix installation wizard database
Zabbix installation wizard database

Enter your server name and continue.

Zabbix installation wizard system name
Zabbix installation wizard system name

Zabbix should now be installed and ready for use.

Enter the default credentials below to sign in.

  • Username: Admin
  • Password zabbix
Zabbix installation wizard complete
Zabbix installation wizard complete

That should do it!

Conclusion:

To wrap up, installing Zabbix with Apache on Ubuntu 24.04 is a solid way to get a powerful monitoring solution up and running. Here’s what we covered:

  • Open-source Solution: Zabbix is a robust, open-source tool for monitoring network services, servers, and hardware.
  • Compatibility: Installing Zabbix on Ubuntu with Apache ensures compatibility and stability in your server environment.
  • Database Support: The installation process involves setting up PostgreSQL as the database backend for Zabbix.
  • Package Installation: Essential Zabbix packages and dependencies, such as the Zabbix server, frontend, and agent, are easily installed via the repository.
  • Configuration Simplicity: Configuring the application is straightforward, including creating a PostgreSQL user and database.
  • Access to Monitoring: Once setup is complete, you can access the Zabbix web interface through your browser, allowing easy monitoring and management.
  • Default Credentials: Users can log in using default credentials, enabling quick access after installation.

By following the steps in this guide, you can effectively monitor your systems with Zabbix on Ubuntu.

Where is the Zabbix config file in Ubuntu?

A: Open the configuration file located at /etc/zabbix/zabbix_agentd. conf and update the Server, ServerActive, and Hostname parameters according to your monitoring setup.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

📚 Related Tutorials

How to Install GNOME Desktop on Ubuntu 24.04
Ubuntu Linux How to Install GNOME Desktop on Ubuntu 24.04
How to Install KDE Desktop on Ubuntu 24.04
Ubuntu Linux How to Install KDE Desktop on Ubuntu 24.04
How to Start, Stop, and Restart Services in Windows 11
Windows How to Start, Stop, and Restart Services in Windows 11

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *