How to install phpipam IP address management application on Ubuntu Server 24
phpipam is an open-source web IP address management application (IPAM). Its goal is to provide light, modern and useful IP address management. It is php-based application with MySQL database backend, using jQuery libraries, ajax and HTML5/CSS3 features. For more information and technical documentation visit https://phpipam.net/
Prerequisites
Before you begin, ensure you have:
- An Ubuntu Server 2024 installation.
- Sudo privileges to execute administrative commands.
- A static IP address configured on your server for consistent network visibility.
Step 1: Update Software Repositories
# apt update
Step 2: Install Available Software Updates
# apt upgrade -y
Step 3: Install Prerequisites
# apt install curl wget zip git -y
Step 4: Install Apache HTTPD and MySQL
# apt install apache2 mariadb-server mariadb-client -y
Step 5: Install PHP Components
# apt install php php-curl php-common php-gmp php-mbstring php-gd php-xml php-mysql php-ldap php-pear -y
Step 6: Configure the MySQL Database and Secure Your Database
Run the security script to set root password and secure your MySQL installation:
# mysql_secure_installation
Step 7: Login to the MySQL Database as the Root User
# mysql -u root -p
Step 8: Create a Database for phpIPAM
Execute the following SQL commands to create a new database and user for phpIPAM:
SQL
> CREATE DATABASE ipam_db;
> GRANT ALL PRIVILEGES ON ipam_db.* TO 'ipam_user'@'localhost' IDENTIFIED BY 'ipam_pass';
> FLUSH PRIVILEGES;
> EXIT;
Exit to the terminal.
Note: Replace ipam_db, ipam_user, and ipam_password with your preferred database name, username, and password.
Step 9: Download phpIPAM Source Code from GitHub
# git clone https://github.com/phpipam/phpipam.git /var/www/html/phpipam
Note: If the download stops with error fatal: fetch-pack: invalid index-pack output, try the following solutions: (Skip this if the download process finished successfully)
Increase the Git Buffer Size
# git config --global http.postBuffer 157286400
Clone Using HTTP/1.1
# git config --global http.version HTTP/1.1
Clone in Parts
# git clone --depth 1 https://github.com/phpipam/phpipam.git /var/www/html/phpipam
# cd /var/www/html/phpipam
# git fetch --unshallow
Step 10: Navigate to the Directory and Checkout the Latest Release
# cd /var/www/html/phpipam
# git checkout $(git tag --sort=v:refname | tail -n1)
Step 11: Set the Owner of the phpIPAM Directory
# chown -R www-data:www-data /var/www/html/phpipam
Step 12: Copy Sample Config File
# cp /var/www/html/phpipam/config.dist.php /var/www/html/phpipam/config.php
Step 13: Edit Config.php and Change the Values
# nano /var/www/html/phpipam/config.php
Inside the config.php file, update the database connection details:
PHP
$db['host'] = '127.0.0.1'; $db['user'] = 'ipam_user'; $db['pass'] = 'ipam_pass'; $db['name'] = 'ipam_db'; $db['port'] = 3306;
Bellow the database connection, add the following line.
define('BASE', "/phpipam/");
Note: The values for user, pass, and name must be the same as those set during the database configuration.
Step 14: Enable mod_rewrite
# a2enmod rewrite
Step 15: Restart the Apache Service
# systemctl restart apache2
Step 16: Complete the Installation via Web Browser
- Navigate to http://<phpipam_IP_or_FQDN>/phpipam in your web browser.
- Click on New phpIPAM installation.
- Uncheck the Create new database and Set permission to tables.
- Proceed with Automatic Database Installation using the ipam_db credentials set earlier.
- Configure the admin login password and finish the installation.
Note: If you want to make server automatically discover nodes after configuration in defined subnets, add the lines bellow to /etc/crontab using nano or any text editor, then run the command to reload crontab service.
*/10 * * * * root /usr/bin/php /var/www/html/phpipam/functions/scripts/pingCheck.php */10 * * * * root /usr/bin/php /var/www/html/phpipam/functions/scripts/discoveryCheck.php */10 * * * * root /usr/bin/php /var/www/html/phpipam/functions/scripts/resolveIPaddresses.php
Save the file and exit. Run the bellow command to reload cron service
# service cron reload
Note: 10 represents minutes and you can change it to your custom value.



My brother suggested I might like this blog. He was totally right. This post actually made my day. You can not imagine simply how much time I had spent for this info! Thanks!