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.
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.
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.
sudo systemctl is-enabled postgresql
sudo systemctl status postgresql
For more details on installing and using PostgreSQL on Ubuntu, check out this post.
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.
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.
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.
sudo apt update
Once the Zabbix repository is installed on Ubuntu, use the command below to install the necessary packages from it.
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.
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.
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.
sudo nano /etc/zabbix/zabbix_server.conf
Update the ‘DBName‘, ‘DBUser‘, and ‘DBPassword‘ settings with your PostgreSQL database details.
### 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.
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.
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.

Configure the database

Enter your server name and continue.

Zabbix should now be installed and ready for use.
Enter the default credentials below to sign in.
- Username: Admin
- Password zabbix

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?
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.
No comments yet — be the first to share your thoughts!