In this tutorial, we'll learn how to install phpIPAM Network Inventory on AlmaLinux 9 [2025 Guide].
Managing IP addresses manually can quickly become chaotic in modern networks. That's why many system administrators rely on phpIPAM, a powerful, open-source IP address management tool. It helps us organize, allocate, and track IP addresses efficiently. In this detailed guide, we’ll walk through how to install phpIPAM on an AlmaLinux 9 server to build a reliable and scalable network inventory system.
What is phpIPAM?
phpIPAM is a web-based application written in PHP, designed to help network administrators manage IP address spaces, VLANs, subnets, and more. It integrates neatly with modern infrastructure and supports automation, API access, and role-based access control. It's the go-to tool for network teams handling growing environments.
Step-by-Step Guide to Install phpIPAM on AlmaLinux 9
We’re using AlmaLinux 9 for this guide — a stable, RHEL-compatible OS that’s ideal for enterprise infrastructure. We’ll also install phpIPAM alongside Apache, MariaDB, and PHP (LAMP stack).
Prerequisites
Before we begin, let’s ensure our environment meets the following requirements:
- A AlmaLinux 9 installed dedicated server or KVM VPS.
- A non-root user with sudo privileges.
- Basic knowledge of using the terminal.
- A domain name pointing to server IP.
Step 1: Update the System
First, let’s ensure our system is up-to-date.
sudo dnf update -y
sudo dnf install epel-release -y
Step 2: Install Apache Web Server
We need a web server to serve the phpIPAM interface.
sudo dnf install httpd -y
sudo systemctl enable httpd
sudo systemctl start httpd
Allow HTTP and HTTPS traffic through the firewall:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
Step 3: Install PHP and Required Extensions
phpIPAM is built in PHP. Let’s install PHP 8.1 and all necessary modules:
sudo dnf module reset php -y
sudo dnf module enable php:8.1 -y
sudo dnf install php php-mysqlnd php-gd php-mbstring php-xml php-json php-cli php-ldap php-pdo php-intl php-pecl-zip php-gmp php-pear -y
Restart Apache after installing PHP:
sudo systemctl restart httpd
Step 4: Install and Configure MariaDB (MySQL)
phpIPAM uses a MySQL-compatible database. We'll use MariaDB:
sudo dnf install mariadb-server -y
sudo systemctl enable mariadb
sudo systemctl start mariadb
Secure the database:
sudo mysql_secure_installation
You’ll be prompted to set the root password and secure settings. Answer Y to all prompts.
Step 5: Create phpIPAM Database and User
Let’s create a database and a dedicated user for phpIPAM:
sudo mysql -u root -p
Inside the MySQL prompt:
CREATE DATABASE phpipam;
CREATE USER 'phpipamuser'@'localhost' IDENTIFIED BY 'StrongPasswordHere';
GRANT ALL PRIVILEGES ON phpipam.* TO 'phpipamuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Use a strong password and store it securely.
Step 6: Download and Configure phpIPAM
Now let’s fetch the latest phpIPAM release:
cd /var/www/html
sudo git clone https://github.com/phpipam/phpipam.git
sudo mv phpipam phpipam-app
cd phpipam-app
sudo cp config.dist.php config.php
Edit the configuration:
sudo nano config.php
Update the following variables to match your database:
$db['host'] = 'localhost';
$db['user'] = 'phpipamuser';
$db['pass'] = 'StrongPasswordHere';
$db['name'] = 'phpipam';
Save and exit (Ctrl + X, then Y and Enter).
Step 7: Set Permissions
Set the correct permissions for Apache to serve the app:
sudo chown -R apache:apache /var/www/html/phpipam-app
Step 8: Configure Apache Virtual Host
Create a virtual host configuration:
sudo nano /etc/httpd/conf.d/phpipam.conf
Paste the following config:
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/phpipam-app
ServerName phpipam.example.com
<Directory /var/www/html/phpipam-app/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/httpd/phpipam_error.log
CustomLog /var/log/httpd/phpipam_access.log combined
</VirtualHost>
Replace phpipam.example.com
with your domain name. Then restart Apache:
sudo systemctl restart httpd
Step 9: Enable HTTPS (Optional but Recommended)
Install Certbot and secure the site with SSL:
sudo dnf install certbot python3-certbot-apache -y
sudo certbot --apache -d phpipam.example.com
This will secure your domain with a Let’s Encrypt SSL certificate.
Step 10: Configure SELinux (Optional but Recommended)
If SELinux is enabled:
sudo chcon -t httpd_sys_rw_content_t -R /var/www/html/phpipam-app
Step 11: Access phpIPAM Web Installer
Now open your browser and go to:
https://phpipam.example.com
Follow the on-screen web installer steps:
- Enter DB credentials
- Initialize the schema
- Set admin password
- Log in to dashboard
Remember
In database step, fill database username and password and below that you will find Show advanced Option button, click on it and uncheck following options
- Drop exisitng database Drop existing database if it exists
- Create database Create new database
- Create permissions Set permissions to tables
Final Thoughts
Setting up phpIPAM on AlmaLinux gives us a robust platform to manage IP address allocations, track subnets, and gain insights into our network inventory. It’s ideal for growing businesses, enterprise networks, and even home labs.
By following this guide, we’ve:
- Built a secure LAMP stack
- Installed and configured phpIPAM
- Enabled database-backed IP tracking
- Laid the groundwork for a scalable IPAM system
Let’s make network chaos a thing of the past with powerful open-source tools like phpIPAM!