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.
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
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
The Zabbix installation scripts do not install the database server itself, so we must install it manually.
apt install mysql-server
It is best practice to secure the database immediately after installation. Run the security script and follow the prompts:
mysql_secure_installation
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;
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;
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).
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
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
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.
You can now log in with the default credentials: