Goodbye Excel: How to Install phpIPAM for Professional IP Infrastructure Management

Network tutorial - IT technology blog
Network tutorial - IT technology blog

When Excel Files Become Data “Black Holes”

This scenario is likely familiar: 2 AM, the company’s ERP system suddenly crashes. After 30 minutes of investigation, you discover a new virtual machine has hijacked the Gateway IP. The reason? Someone on the team forgot to update the IP_Management_Final_v2.xlsx file. Such manual errors often lead to unnecessary downtime, wasting hours on troubleshooting.

If you are managing over 50 subnets or hundreds of devices, using spreadsheets is a major risk. That’s where phpIPAM comes in. It is a powerful open-source IP address management tool. It doesn’t just list IPs; it also supports VLAN and VRF management and integrates automated network scanning. Everything is displayed visually on a web interface instead of dry rows and columns.

Before importing data into the system, I often use toolcraft.app/en/tools/developer/ip-subnet-calculator for quick CIDR range calculations. This tool helps accurately determine the number of hosts and the broadcast range, preventing misconfigurations right from the initial planning stage.

Preparing the Installation Environment

For stable operation on a network of about 5,000 IPs, you only need a basic VPS (1 vCPU, 2GB RAM). I recommend using Ubuntu 24.04 LTS for long-term support. The system will run on a traditional LAMP stack.

Step 1: Install Component Packages

First, update the system and install Apache, MariaDB, and PHP modules. Note: phpIPAM requires php-gmp to handle IPv6 mathematical calculations.

sudo apt update && sudo apt upgrade -y
sudo apt install apache2 mariadb-server php php-curl php-gd php-intl php-pear php-imap php-mysql php-mbstring php-xml php-gmp php-json php-xmlrpc php-zip libapache2-mod-php git -y

Step 2: Set Up the Database

Never leave your database wide open. Secure MariaDB and create a dedicated user for the application.

sudo mysql_secure_installation

# Log in to MySQL
sudo mysql -u root -p

# Create database and grant privileges
CREATE DATABASE phpipam;
GRANT ALL PRIVILEGES ON phpipam.* TO 'phpipam_user'@'localhost' IDENTIFIED BY 'SuperHardPassword@123';
FLUSH PRIVILEGES;
EXIT;

Step 3: Download and Configure phpIPAM

Using Git to download the source code makes future version upgrades effortless. You just need to run git pull and you’re done.

cd /var/www/html
sudo git clone https://github.com/phpipam/phpipam.git .
sudo chown -R www-data:www-data /var/www/html

Next, create a configuration file from the template:

cp config.dist.php config.php
sudo nano config.php

Find the database declaration lines and fill in the information you created in Step 2. Be sure to double-check that the default port is 3306.

Complete via the Web Interface

Now, access your server’s IP through a browser. The installation interface will appear.

1. Automatic Database Initialization

Select “New phpipam installation”, then choose “Automatic database installation”. The system will automatically create the necessary data tables without you having to manually import SQL files.

2. Optimize Paths (Pretty Links)

To make URLs like /subnets/1/ work instead of complex query strings, you need to enable Apache’s Mod_Rewrite:

sudo a2enmod rewrite
sudo nano /etc/apache2/sites-available/000-default.conf

Insert the AllowOverride All configuration into the <Directory /var/www/html> block, then restart Apache with the command: sudo systemctl restart apache2.

Practical Operation: Automation and Monitoring

After logging in, the first thing you should do is create Sections (e.g., Core Network, Guest Wi-Fi). This helps categorize resources more clearly.

Automated Network Scanning with fping

This feature saves you from manual IP entry. The system will automatically scan the network range and report which IPs are online. Install fping:

sudo apt install fping -y

To have the system automatically update the status every 15 minutes, add the following lines to your crontab (sudo crontab -e):

*/15 * * * * /usr/bin/php /var/www/html/functions/scripts/pingCheck.php
*/15 * * * * /usr/bin/php /var/www/html/functions/scripts/discoveryCheck.php

Real-world Tips

When I imported over 1,000 records from Excel into phpIPAM, duplicate errors lit up in red. That’s when you realize how horribly inaccurate the old Excel file was. Don’t forget to enable Email Notifications. You will receive an immediate alert whenever an unknown device connects to the network or a critical server loses connection.

Deployment might take an afternoon. However, the value it brings is total peace of mind. You will always know exactly which device holds which IP, at any given time.

Share: