How to Install Ubuntu Server and Zabbix on Raspberry Pi
Introduction:
The Raspberry Pi isn’t just a hobbyist gadget – it’s powerful enough to run servers, monitor networks, and support real IT operations. One of the best tools for monitoring infrastructure is Zabbix, an open-source monitoring solution used by enterprises worldwide.
Prerequisites:
Before starting the installation, make sure you have the following:
Hardware:
- Raspberry Pi 4 (2GB RAM minimum) or Raspberry Pi 5 (recommended)
- 16GB or larger microSD card (Class 10 or better)
- MicroSD card reader for your PC/laptop
- Power supply (official Raspberry Pi adapter recommended)
- HDMI cable + monitor (optional if using headless SSH setup)
- USB keyboard & mouse (optional if using headless setup)
- Internet connection (Ethernet preferred, Wi-Fi also works)
Software (on your PC/laptop):
- Raspberry Pi Imager to flash OS
- Ubuntu Server image (64-bit, preferably Ubuntu Server 24.04 LTS)
- SSH client (e.g., PuTTY on Windows or built-in
ssh
command on Linux/macOS)
Part 1: Install Ubuntu Server on Raspberry Pi:
Requirements:
- Raspberry Pi 4 or Pi 5 (2GB+ RAM recommended)
- 16GB+ microSD card
- Card reader for flashing the OS
- Power supply
- Ethernet cable or Wi-Fi
- A laptop/PC (Windows, macOS, or Linux)
Step 1: Download Ubuntu Server:
This is the lightweight OS that will power your Raspberry Pi as a server.
- Visit Ubuntu Raspberry Pi Downloads.
- Download Ubuntu Server 24.04 LTS (64-bit).
Step 2: Flash the OS to microSD Card:
This process installs Ubuntu Server onto your SD card so the Pi can boot from it.
- Install Raspberry Pi Imager.
- Open Imager → Choose OS →
Other general-purpose OS → Ubuntu → Ubuntu Server 24.04 LTS (64-bit)
. - Select your microSD card under Choose Storage.
- Click Write.
Step 3: Boot the Raspberry Pi:
The Raspberry Pi will automatically boot into Ubuntu Server for the first time.
- Insert the microSD card into the Pi.
- Connect monitor, keyboard, and network.
- Power on the Pi – it will boot into Ubuntu Server.
Step 4: First Login:
On first login, Ubuntu forces you to set a new password for security.
- Default username: ubuntu
- Default password: ubuntu
- You’ll be asked to change the password after first login.
Step 5: Update System:
This ensures you have the latest security patches and updated software before installing Zabbix.
sudo apt update && sudo apt upgrade -y
At this point, your Raspberry Pi is running Ubuntu Server.
Part 2: Install Zabbix on Ubuntu Server (Raspberry Pi)
Step 1: Install Required Packages;
These are necessary tools to download and manage the Zabbix repository.
sudo apt install -y wget gnupg2 software-properties-common
Step 2: Add Zabbix Repository:
This registers the official Zabbix repository so you can install the latest version.
wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-2+ubuntu24.04_all.deb
sudo dpkg -i zabbix-release_7.0-2+ubuntu24.04_all.deb
sudo apt update
Step 3: Install Zabbix Server, Frontend, and Agent:
This installs the Zabbix components along with MySQL, which is required for storing monitoring data.
sudo apt install -y zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent mysql-server
Step 4: Configure Database:
This creates a database and user account where Zabbix will store all monitoring data.
1.Secure MySQL:
sudo mysql_secure_installation
2.Create Zabbix database:
sudo mysql -uroot -p
CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'StrongPassword';
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';
FLUSH PRIVILEGES;
EXIT;
3.Import initial schema:
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p zabbix
Step 5: Configure Zabbix Server:
This tells Zabbix how to connect to the database you created.
Edit the Zabbix server config:
sudo nano /etc/zabbix/zabbix_server.conf
Set the database password:
DBPassword=StrongPassword
Step 6: Start and Enable Services:
This starts Zabbix services and ensures they run automatically after reboot.
sudo systemctl restart zabbix-server zabbix-agent apache2 mysql
sudo systemctl enable zabbix-server zabbix-agent apache2 mysql
Step 7: Access Zabbix Frontend:
Complete the web setup wizard using your database details.
- Open your browser →
http://<RaspberryPi-IP>/zabbix
- Follow the web installer wizard:
- Database → use
zabbix
/StrongPassword
- Default login →
Admin
/zabbix
- Database → use
Zabbix running on Raspberry Pi with Ubuntu Server!
Conclusion:
By installing Ubuntu Server and Zabbix on your Raspberry Pi, you’ve turned a tiny device into a powerful monitoring solution. You can now monitor your websites, servers, IoT devices, and applications in real time – all from a Pi!