Install the {php}IPAM project on Ubuntu 18.04
Why I love this project and why any network engineer should use it!
According to its website: phpIPAM is an open-source web IP address management application (IPAM). It allows to manage VLANs, Subnets, devices, etc. in a single pane of glass. What I especially love about it is the ability to deny overlapping of subnets in your network.
What drove me into using it is the fact that users in my previous place of work used an Excel sheet to record any new subnets and VLANs. And you know how users are, they tend to forget to update that sheet. True that phpIPAM needs to be updated as well, but everyone like new toys ;-)
I was able to install the project on Ubuntu 18.04, it didn’t play as I wanted on a higher version.
Install Apache2 webserver + PHP prerequisites:
- Run the following command (The “-y” is to confirm all the prompts that might pop):
sudo apt-get install apache2 php libapache2-mod-php php-cli php-pdo php-mbstring php-gmp php-ldap php-simplexml php7.2-xml php-json php-net-socket php7.2-common openssl php-curl php7.2-gd php7.2-mysql php-pear -y
2. At this point you can verify if the default apache server is up and running by browsing to http://local.server.ip
3. Create folders and allow permissions (Ubuntu mandates that all websites will be deployed under public_html folder):
sudo mkdir /var/www/public_html
sudo mkdir /var/www/public_html/phpipam
sudo chown -R $USER:$USER /var/www/public_html/phpipam
sudo chmod -R 755 /var/www/public_html/phpipam
4. Using your favorites editor, create an Apache configuration file under /etc/apache2/sites-available/
with the name phpipam.conf with the following:
<VirtualHost *:80>
ServerAdmin your.name@yourcomapny.com
DocumentRoot "/var/www/public_html/phpipam"
ServerName phpipam.yourcompany.com
<Directory "/var/www/public_html/phpipam">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog "/var/log/phpipam-error_log"
CustomLog "/var/log/phpipam-access_log" combined
</VirtualHost>
Install MySQL DB:
- Run the following to install MySQL:
sudo apt install mysql-server -y
2. Login to mysql’s CLI:
sudo mysql
3. Change the master root password (replace very_strong_password with your own password):
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'very_strong_password';mysql> FLUSH PRIVILEGES;
4. Sign out from mysql and relogin with:
mysql -u root -p
type the new pass from the previous section.
5. In mysql’s prompt create a new DB and username to access it:
create database phpipam;
CREATE USER 'phpipam'@'%' IDENTIFIED BY 'StrongPass123!';
GRANT ALL PRIVILEGES ON *.* TO 'phpipam'@'%' WITH GRANT OPTION;
Install and configure the project:
- Clone the git to the directory created earlier:
sudo git clone --recursive https://github.com/phpipam/phpipam.git /var/www/public_html/phpipam
2. Create the configuration file (copy from source):
sudo cp /var/www/public_html/phpipam/config.dist.php /var/www/public_html/phpipam/config.php
Edit it:
sudo nano /var/www/public_html/phpipam/config.php
If you haven’t changed the username from section no. 5 under MySQL, leave all as is except for the password, should be like this:
v$db['host'] = "localhost";
$db['user'] = "phpipam";
$db['pass'] = "StrongPass123!";
$db['name'] = "phpipam";
Save and exit.
3. Import the SQL schema (once prompted, type the password from mysql, section no. 3)
mysql -u root -p phpipam < db/SCHEMA.sql
4. Copy the configuration file from sites-available to sites-enabled:
sudo ln -s /etc/apache2/sites-available/phpipam.conf /etc/apache2/sites-enabled/phpipam.conf
5. Enable rewrite mode for Apache:
sudo a2enmod rewrite
6. Restart Apache2 service:
sudo service apache2 restart
7. Your done! you can now login to phpIPAM with user ‘Admin’ and password ‘ipamadmin’

What’s next:
- Customize the dashboard, maybe upload your company’s logo
- Set SMTP server
- Set LDAP authentication
- Change the listening interface from HTTP to HTTPS