How to Install Observium on Ubuntu 24.04: A Detailed Step-by-Step Guide
In the world of server management, knowledge is power. Simply knowing your website is "online" is no longer enough. To run a truly professional operation, you need deep insights into the health and performance of your infrastructure. What is your server's CPU load during peak traffic? How much disk space is your application actually using over time? Is your office router experiencing packet loss? Answering these questions moves you from a reactive state (fixing things when they break) to a proactive one (preventing problems before they happen).
Observium is one of the most popular and powerful network monitoring platforms available. While incredibly capable, its installation process can be intimidating for beginners. This guide is here to change that. We will walk you through every command and configuration file needed to install the Observium Community Edition on your ENGINYRING Virtual Server running Ubuntu 24.04. Think of your VPS not just as a machine to host a website, but as a central, 24/7 watchtower that keeps an eye on your entire digital ecosystem. Whether you've just completed your migration to a VPS or are looking to audit your existing setup, this guide will provide the actionable steps you need to build a digital fortress.
What is Observium and Why Should You Use It?
Observium is a network monitoring and management platform that primarily uses the Simple Network Management Protocol (SNMP) to collect data from a vast range of devices. It's designed to be as automated as possible, with a powerful auto-discovery feature that can find and add new devices on your network without manual intervention. Its key features include:
Key Features of the Community Edition
- Extensive Device Support: Observium natively supports thousands of devices. This includes not just Linux and Windows servers, but networking gear from vendors like Cisco, Juniper, and Ubiquiti, as well as printers, power supplies, and storage devices.
- Performance Graphing: It excels at historical data visualization. Observium automatically collects and stores metrics over time, presenting them in clean, easy-to-read graphs. This allows you to track everything from bandwidth usage on a specific network port to the CPU temperature of your main server.
- Auto-Discovery: You can configure Observium to periodically scan your network. When it finds a new device that responds to SNMP, it can automatically add it and begin collecting data based on the device type it identifies.
- Intuitive Web Interface: Despite the complexity of the data it collects, Observium’s web dashboard is remarkably user-friendly, making it easy to navigate and find the information you need.
Understanding the Core Technology: SNMP
For a beginner, SNMP can seem complex, but the basic concept is simple. An "SNMP agent" runs on the device you want to monitor (like your VPS). This agent collects data and stores it in a structured way. The Observium server (the "SNMP manager") then sends a request to the agent using a password called a "community string." If the community string is correct, the agent sends back the requested data. This is how Observium polls your devices for information every few minutes. In this tutorial, we will install the agent on the same VPS that hosts Observium, making it our first monitored device.
Running Observium on a VPS Hosting plan is an ideal setup. A VPS provides the stable, always-on, and network-central environment needed for a monitoring system to function effectively, allowing it to reliably check on your devices 24/7, regardless of where they are located.
Prerequisites
Before we begin, please ensure you have the following:
- An ENGINYRING VPS: This tutorial is specifically for a server running a fresh installation of Ubuntu 24.04 LTS. For a smooth experience with Observium, a server with at least 2GB of RAM and 2 CPU cores is recommended.
- Sudo User: You should be logged in as a non-root user with `sudo` privileges. This is a fundamental security best practice.
- (Optional) Domain Name: While you can access Observium via your server's IP address, it is more professional and secure to use a domain or subdomain (e.g., `status.yourdomain.com`). You can register one on our domain registration page and point it to your VPS's IP address.
Step 1: Preparing Your System Environment
Our first and most extensive step is to install all the necessary software components that Observium relies on. This is a multi-stage process involving updating the OS, installing the core LAMP stack (Linux, Apache, MariaDB, PHP), and adding numerous required utilities and PHP extensions.
Update Your Server
First, we must ensure our server is completely up to date. This command contacts Ubuntu's software repositories to get the latest list of available packages (`apt update`) and then upgrades all installed packages on your system to their newest versions (`apt upgrade`).
sudo apt update && sudo apt upgrade -y
Install Apache, MariaDB, PHP, and Core Utilities
Next, we will install the main software packages. This single command is long, but it efficiently installs several groups of software:
- Core Web Stack: `apache2` (the webserver), `mariadb-server` and `mariadb-client` (the database).
- SNMP Tools: `snmpd` and `snmp` are the agent and tools for the data collection protocol.
- Network Diagnostics: `fping`, `mtr-tiny`, and `whois` are used by Observium to perform advanced network checks.
- Data and Image Graphing: `rrdtool`, `graphviz`, and `imagemagick` are critical libraries used to generate the performance graphs you see in the dashboard.
- Other Dependencies: `python3-pymysql`, `python3-pip`, `subversion`, and `ipmitool` are other required helper packages.
sudo apt install -y apache2 mariadb-server mariadb-client python3-pymysql snmpd snmp fping python3-pip rrdtool subversion whois mtr-tiny ipmitool graphviz imagemagick
Install Required PHP Extensions
Observium is a PHP-based application and it requires a specific set of PHP modules to be enabled to function correctly. Missing even one of these can lead to errors. The following command installs all the necessary extensions for PHP 8.3, which is the default version in Ubuntu 24.04.
sudo apt install -y php8.3-cli php8.3-common php8.3-curl php8.3-fpm php8.3-gd php8.3-gmp php8.3-json php8.3-mbstring php8.3-mysql php8.3-opcache php8.3-readline php8.3-snmp php8.3-xml php8.3-zip php8.3-pear
Step 2: Configuring the MariaDB Database
With the software installed, we now need to create a secure and dedicated database where Observium will store all the monitoring data it collects.
Secure the MariaDB Installation
A default MariaDB installation is not secure. Ubuntu provides a helpful script to lock it down. Run the script and follow the prompts.
sudo mysql_secure_installation
The script will ask you a series of questions. For a new installation, you will first set a root password for the database. Choose a strong, unique password. For all subsequent questions (remove anonymous users, disallow root login remotely, remove test database), it is highly recommended to answer 'Y' (yes) to establish a secure baseline for your database server.
Create the Observium Database and User
Now, we will log in to the MariaDB command-line interface as the root user to create our database and a special user account that Observium will use to access it.
sudo mysql -u root -p
Enter the root password you just set. Once at the `MariaDB [(none)]>` prompt, you will execute four SQL commands. Be sure to replace `your_strong_password` with a strong, unique password you create for the Observium database user.
CREATE DATABASE observium DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'observium'@'localhost' IDENTIFIED BY 'your_strong_password';
GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Let's break down what these commands do: `CREATE DATABASE` creates the database itself, named `observium`. `CREATE USER` creates a user named `observium` that can only connect from `localhost` (the server itself), which is an important security measure. `GRANT ALL PRIVILEGES` gives this new user full control over the `observium` database only. `FLUSH PRIVILEGES` reloads the permissions to make them active, and `EXIT` closes the connection.
Step 3: Downloading and Configuring Observium
It's time to download the Observium application files and configure them to connect to our newly prepared database.
First, we create the standard directory for Observium, `/opt/observium`, and navigate into the parent `/opt` directory, which is the conventional location for optional, third-party software in Linux.
sudo mkdir /opt/observium
cd /opt
Next, we download the latest compressed file for the Community Edition and extract its contents.
sudo wget http://www.observium.org/observium-community-latest.tar.gz
sudo tar zxvf observium-community-latest.tar.gz
Now, we navigate into the new directory and copy the default configuration file (`config.php.default`) to create our own active configuration (`config.php`).
cd /opt/observium
sudo cp config.php.default config.php
This is a critical step. Open the new `config.php` file with a text editor to add your database credentials.
sudo nano config.php
Find the database configuration section and update the `db_user`, `db_pass`, and `db_name` with the exact details you created in the MariaDB step.
// Database config --- This is the only setting you should need to change for a basic install
$config['db_host'] = 'localhost';
$config['db_user'] = 'observium';
$config['db_pass'] = 'your_strong_password';
$config['db_name'] = 'observium';
Save and close the file by pressing `CTRL+X`, then `Y` to confirm, and `ENTER`.
Step 4: Running the Initial Setup and Adding Your First Device
With the application configured, we need to run a setup script. This PHP script will connect to the database and build all the necessary tables (the database schema) that Observium needs to store data.
sudo php discovery.php -u
Observium needs directories to store its logs and RRD data (the time-series data files for graphs). Let's create these and assign ownership to the web server user, `www-data`.
sudo mkdir logs rrd
sudo chown www-data:www-data logs rrd
Now, let's configure the server itself to be monitored. We'll edit the SNMP agent's configuration file. First, we'll back up the original.
sudo cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.org
sudo nano /etc/snmp/snmpd.conf
Delete the entire contents of the file and replace them with this single line. This sets a "community string," which acts like a read-only password for SNMP. Replace `your_snmp_community` with a private, secret string you create.
rocommunity your_snmp_community
Save the file and restart the SNMP service for the change to take effect.
sudo systemctl restart snmpd
With the agent configured, we can now tell Observium to add `localhost` as a device to monitor, using the community string you just set.
sudo php add_device.php localhost your_snmp_community v2c
Finally, let's run a discovery and poll for all known devices. This will query the server via SNMP and populate the database with its initial performance data.
sudo php discovery.php -h all
sudo php poller.php -h all
Step 5: Configuring the Apache Web Server
The backend is now running. The next crucial step is to configure Apache to serve the Observium web interface. This is done by creating a "Virtual Host" file, which is a dedicated configuration for our Observium site.
sudo nano /etc/apache2/sites-available/observium.conf
Paste the following configuration block into this new file. If you are using a domain name, change `your_domain.com` to your actual domain. If you're using an IP address for now, you can remove the `ServerName` line.
<VirtualHost *:80>
ServerName your_domain.com
DocumentRoot /opt/observium/html/
AllowEncodedSlashes NoDecode
<Directory "/opt/observium/html/">
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews
</Directory>
</VirtualHost>
This file tells Apache that requests for your domain should be served from the `/opt/observium/html/` directory and sets the necessary permissions. This configuration is designed for functionality and compatibility. Once your Observium instance is running, you may want to explore further performance tuning. You can learn about advanced optimization in our guide, How We Turbocharged Apache2.
Now, we use some helper scripts to enable this new site configuration, enable the `rewrite` module (which Observium needs for clean URLs), and disable the default Apache welcome page.
sudo a2ensite observium.conf
sudo a2enmod rewrite
sudo a2dissite 000-default.conf
To apply all these changes, we must restart the Apache service.
sudo systemctl restart apache2
Step 6: Setting Up the Cron Jobs
For Observium to be useful, it needs to collect data continuously. We automate this task by setting up cron jobs, which are scheduled tasks that run automatically in the background.
sudo nano /etc/cron.d/observium
Paste the following two lines into this file. This tells the cron daemon to run the poller scripts every 5 minutes to gather data, and to run the auto-discovery script every 6 hours to check for new devices. The `>> /dev/null 2>&1` part simply discards the output of these commands to prevent your server from sending you unnecessary emails.
33 */6 * * * root /opt/observium/discovery.php -h all >> /dev/null 2>&1
*/5 * * * * root /opt/observium/poller-wrapper.py >> /dev/null 2>&1
Save and close the file. The cron service will automatically detect and schedule these new jobs.
Step 7: First Login and Troubleshooting
Congratulations, the command-line work is complete! Open your web browser and navigate to your server's IP address or the domain name you configured. You should be greeted by the Observium login page.
The default credentials are: Username: `observium` and Password: `observium`. Your very first action upon logging in should be to change this default password via the "My Profile" settings.
Troubleshooting Common Issues
- Error 500 or White Page: This often indicates a permissions issue. Ensure the `logs` and `rrd` directories in `/opt/observium` are owned by `www-data` with `sudo chown -R www-data:www-data /opt/observium/logs /opt/observium/rrd`.
- Database Connection Error: Carefully re-check the credentials in `/opt/observium/config.php` to ensure they match exactly what you set in Step 2.
- Device Added but No Graphs Appear: This is almost always an SNMP issue. Verify that the community string in Observium matches the one in `/etc/snmp/snmpd.conf` and that your firewall is not blocking UDP port 161.
After logging in, you should see your `localhost` device on the dashboard. It may take 10-15 minutes for the first detailed graphs to appear as the cron jobs run and collect data. Your powerful new monitoring system is officially online.
Conclusion: Taking Control of Your Infrastructure
While this tutorial involves many steps, the result is an enterprise-grade monitoring platform that you control completely, running on your own virtual server. You now have the power to monitor, graph, and analyze the performance of your entire network. This is a fundamental step in moving from being a passive user of web hosting to being a proactive administrator of your own infrastructure.
This level of control is the core benefit of VPS hosting. For businesses and users who find this process too complex or time-consuming, ENGINYRING also offers managed solutions. Our cPanel and DirectAdmin services allow you to focus on your business while our experts handle the technical configurations. Whatever your choice, we provide the robust platform you need to succeed. For any questions about our infrastructure, please don't hesitate to contact our team.
Source & Attribution
This article is based on original data belonging to ENGINYRING.COM blog. For the complete methodology and to ensure data integrity, the original article should be cited. The canonical source is available at: How to Install Observium on Ubuntu 24.04: A Detailed Step-by-Step Guide.