← Back to Guides Homepage

How to Install Zabbix 7.0 LTS on Ubuntu 24.04

In this guide, you will learn how to install Zabbix 7.0 LTS (Long Term Support) on a fresh Ubuntu 24.04 system. We will cover the entire process, including setting up the database, configuring the Nginx web server, and finalizing the installation via the web interface.

Part 1: Downloading and Installing the Repository

First, navigate to the official Zabbix download page to identify the correct platform settings. For this installation, we are selecting:

Open your terminal and switch to root privileges using sudo -s. Run the following commands to install the repository and update your package list:

# Download the repository package
wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-1+ubuntu24.04_all.deb

# Install the repository
dpkg -i zabbix-release_7.0-1+ubuntu24.04_all.deb

# Update package information
apt update

Part 2: Installing Zabbix Components

Next, install the Zabbix server, frontend, Nginx configuration, SQL scripts, and the new Agent 2. This single command installs the MySQL parts, PHP frontend, and Nginx web server configuration.

apt install zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts zabbix-agent2

Part 3: Installing and Securing MySQL

The Zabbix installation scripts do not install the database server itself, so we must install it manually.

1. Install MySQL Server

apt install mysql-server

2. Secure the Installation

It is best practice to secure the database immediately after installation. Run the security script and follow the prompts:

mysql_secure_installation

Part 4: Creating the Zabbix Database

Now we need to create the database and user for Zabbix. Log in to the MySQL prompt (as root, no password is usually required if using sudo).

mysql

Execute the following SQL commands to create the database with the correct character set, create the user, and grant privileges. Replace 'password' with your desired password.

create database zabbix character set utf8mb4 collate utf8mb4_bin;
create user zabbix@localhost identified by 'password';
grant all privileges on zabbix.* to zabbix@localhost;
set global log_bin_trust_function_creators = 1;
quit;

Part 5: Importing the Initial Schema

We must now import the initial schema and data into the database. We use zcat to read the compressed SQL file and pipe it into the Zabbix database.

zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

Enter the password you created in the previous step when prompted. Once the import is complete, disable the trust function in MySQL:

mysql
set global log_bin_trust_function_creators = 0;
quit;

Part 6: Configuring Zabbix Server and Nginx

1. Configure Zabbix Server

Edit the Zabbix server configuration file to set the database password.

nano /etc/zabbix/zabbix_server.conf

Find the line # DBPassword=, uncomment it by removing the #, and enter your password.

DBPassword=password

Save and exit (Ctrl+S, Ctrl+X).

2. Configure Nginx

By default, Nginx has a "default" site enabled which may conflict with Zabbix. We will remove the default link and link the Zabbix configuration instead.

# Remove the default site link
rm /etc/nginx/sites-enabled/default

# Create a symlink for the Zabbix configuration
ln -s /etc/zabbix/nginx.conf /etc/nginx/sites-enabled/zabbix

Test the Nginx configuration to ensure there are no errors, then restart the service.

nginx -t
systemctl restart nginx

Part 7: Starting Services and Web Setup

Finally, restart all relevant Zabbix services and enable them to start automatically on boot.

systemctl restart zabbix-server zabbix-agent2 zabbix-nginx-conf php8.3-fpm
systemctl enable zabbix-server zabbix-agent2 zabbix-nginx-conf php8.3-fpm

Finalizing via Web GUI

Open your web browser and navigate to your server's IP address (e.g., http://localhost or your server IP). You will see the Zabbix welcome screen.

  1. Check of pre-requisites: Ensure all items are green/OK.
  2. Configure DB connection: Enter the database password you set earlier.
  3. Settings: Set a name for your server (e.g., "Zabbix Server 1") and select your Time Zone.
  4. Summary: Review your settings and click Finish.

You can now log in with the default credentials:

← Back to Guides Homepage