(Last Updated On: June 16, 2018)

The objective of this guide is to help you Install and Configure phpIPAM on Ubuntu 18.04. phpIPAM is an open-source php-based web IP address management application (IPAM). Its goal is to provide light, modern and useful IP address management. phpIPAM uses MySQL database backend and jQuery libraries, Ajax and HTML5/CSS3 features.

phpIPAM has the following features:

  •  IPv4/IPv6 IP address management
  •  Section / Subnet management
  •  Automatic free space display for subnets
  •  Visual subnet display
  •  Automatic subnet scanning / IP status checks
  •  PowerDNS integration
  •  NAT support
  • VLAN management
  • VRF management
  • IPv4 / IPv6 calculator
  • IP database search
  • E-mail notifications
  • Custom fields support
  • Translations
  • Changelogs
  •  RACK management
  • Domain authentication (AD, LDAP, Radius)
  • Per-group section/subnet permissions
  • Device/device types management
  • RIPE subnets import
  • XLS / CVS subnets import
  • IP request module
  • Locations module

Install phpIPAM on Ubuntu 18.04

phpIPAM has a number of dependencies that we need to install before we can install and configure phpIPAM. These are:

  1. MySQL / MariaDB server
  2. php / php-fpm for nginx
  3. php modules
  4. Apache / nginx web server

Step 1: Install MariaDB  Server

Use the following guide to install MariaDB server on your Ubuntu 18.04 Install MariaDB 10.3 on Ubuntu 18.04 and CentOS 7

Once the database installation and setup is complete, create a database for phpipam user:

root@server-01:~# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 49
Server version: 10.3.7-MariaDB-1:10.3.7+maria~bionic-log mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database phpipam;
Query OK, 1 row affected (0.001 sec)

MariaDB [(none)]> grant all on phpipam.* to phpipam@localhost identified by 'strongpassword';
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> show grants for phpipam@localhost;
| Grants for phpipam@localhost |
| GRANT USAGE ON *.* TO 'phpipam'@'localhost' IDENTIFIED BY PASSWORD '*FAB0955B2CE7AE2DAFEE46C36501AFC6E65A445D' |
| GRANT ALL PRIVILEGES ON `phpipam`.* TO 'phpipam'@'localhost' |
2 rows in set (0.000 sec)

Step 2: Install php and required modules

Next phase is the installation of php and required modules. Run the following commands:

$ sudo apt-get -y install php7.2-mysql php7.2-curl \
php7.2-gd php7.2-intl php-pear php7.2-imap php-memcache  \
php7.2-pspell php7.2-recode  php7.2-tidy php7.2-xmlrpc \
php7.2-mbstring php-gettext php7.2-gmp php7.2-json  php7.2-xml

Install php-fpm package.

$ sudo apt-get install php-fpm
$ sudo systemctl status php7.2-fpm.service 
● php7.2-fpm.service - The PHP 7.2 FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php7.2-fpm.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2018-06-11 20:57:07 UTC; 36s ago
Docs: man:php-fpm7.2(8)
Main PID: 19135 (php-fpm7.2)
Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/sec"
Tasks: 3 (limit: 2362)
CGroup: /system.slice/php7.2-fpm.service
├─19135 php-fpm: master process (/etc/php/7.2/fpm/php-fpm.conf)
├─19151 php-fpm: pool www
└─19154 php-fpm: pool www

Jun 11 20:57:07 server-01 systemd[1]: Starting The PHP 7.2 FastCGI Process Manager...
Jun 11 20:57:07 server-01 systemd[1]: Started The PHP 7.2 FastCGI Process Manager.

Download and Install phpIPAM

We’ll download phpIPAM from github. Install git first:

$ sudo apt-get install git

Clone phpIPAM code from github

# git clone --recursive https://github.com/phpipam/phpipam.git /var/www/phpipam
Cloning into '/var/www/phpipam'...
remote: Counting objects: 17820, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 17820 (delta 2), reused 5 (delta 0), pack-reused 17804
Receiving objects: 100% (17820/17820), 12.77 MiB | 13.11 MiB/s, done.
Resolving deltas: 100% (12873/12873), done.
Submodule 'app/login/captcha' (https://github.com/dapphp/securimage.git) registered for path 'app/login/captcha'
Submodule 'functions/PHPMailer' (https://github.com/PHPMailer/PHPMailer.git) registered for path 'functions/PHPMailer'
Submodule 'functions/php-saml' (https://github.com/onelogin/php-saml.git) registered for path 'functions/php-saml'
Cloning into '/var/www/phpipam/app/login/captcha'...
remote: Counting objects: 1190, done.        
remote: Total 1190 (delta 0), reused 0 (delta 0), pack-reused 1190        
Receiving objects: 100% (1190/1190), 11.06 MiB | 13.12 MiB/s, done.
Resolving deltas: 100% (590/590), done.
Cloning into '/var/www/phpipam/functions/PHPMailer'...
remote: Counting objects: 6413, done.        
remote: Compressing objects: 100% (14/14), done.        
remote: Total 6413 (delta 4), reused 8 (delta 3), pack-reused 6396        
Receiving objects: 100% (6413/6413), 4.49 MiB | 8.12 MiB/s, done.
Resolving deltas: 100% (4204/4204), done.
Cloning into '/var/www/phpipam/functions/php-saml'...
remote: Counting objects: 4248, done.        
remote: Compressing objects: 100% (21/21), done.        
remote: Total 4248 (delta 9), reused 18 (delta 7), pack-reused 4220        
Receiving objects: 100% (4248/4248), 2.67 MiB | 6.31 MiB/s, done.
Resolving deltas: 100% (2463/2463), done.
Submodule path 'app/login/captcha': checked out '6db3038fd2ef00d4cfb57b866d2cc146c286359b'
Submodule path 'functions/PHPMailer': checked out 'f97b9cd3c2dcf348d110d17613a82614d1163ab5'
Submodule path 'functions/php-saml': checked out '97eb229922be90914797b512d578e791e8bba5b9'

Change to clone directory and checkout stable release branch:

#  cd /var/www/phpipam
#  git checkout -b 1.3 origin/1.3
Branch '1.3' set up to track remote branch '1.3' from 'origin'.
Switched to a new branch '1.3'

You can also download phpipam from official Sourceforge repository and extract it to your web server directory.

Configure phpIPAM

Change your working directory to /var/www/phpipam and copy config.dist.php to config.php, then edit it.

# cd /var/www/phpipam
# cp config.dist.php config.php

Edit the file to configure database credentials as added on Step 1:

* database connection details
$db['host'] = 'localhost';
$db['user'] = 'phpipam';
$db['pass'] = 'strongpassword';
$db['name'] = 'phpipam';
$db['port'] = 3306;

Install and Configure nginx

Install nginx using the command:

$ sudo apt-get install nginx

Configure nginx

# vim /etc/nginx/conf.d/phpipam.conf

Add content:

server {
    # root directory
    root   /var/www/;

    # phpipam
    location /phpipam/ {
        try_files $uri $uri/ /phpipam/index.php;
        index index.php;
    # phpipam - api
    location /phpipam/api/ {
        try_files $uri $uri/ /phpipam/api/index.php;

    # php-fpm
    location ~ \.php$ {
        fastcgi_pass   unix:/run/php/php7.2-fpm.sock;
        fastcgi_index  index.php;
        try_files      $uri $uri/ index.php = 404;
        include        fastcgi_params;

Change ownership of the /var/www/ directory to www-data user and group.

# chown -R www-data:www-data /var/www/

Install and Configure Apache web server

If you would like to use Apache web server, first install it using:

$ sudo apt-get install apache2
$ sudo a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
systemctl restart apache2

Install apache php module:

$ sudo apt-get install libapache2-mod-php php-curl php-xmlrpc php-intl php-gd

Add apache phpipam configuration:

 cat /etc/apache2/conf-enabled/phpipam.conf 
<VirtualHost *:80>
    ServerAdmin admin@phpipam.yourdomain.com
    DocumentRoot "/var/www/phpipam"
    ServerName phpipam.computingforgeeks.com
    ServerAlias www.phpipam.computingforgeeks.com
    <Directory "/var/www/phpipam">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    ErrorLog "/var/log/phpipam.yourdomain.com-error_log"
    CustomLog "/var/log/phpipam.yourdomain.com-access_log" combined

Restart apache server for changes to be made.

$ sudo systemctl restart apache2

Start the installation process by visiting http://domain.com, replace domain.com with your valid domain name.

Select “New phpipam installation

Then choose database installation method. If you had created a database for phpipam, you can select MySQL import instructions, else choose Automatic database installation.For automatic installation, you need to provide root password credentials.

On successful installation, you should get admin login page, log in with credentials set above.