Below is a complete guide on how to install latest stable phpipam version on Ubuntu Server 26.04 LTS, using nginx as webserver. For this guide completely fresh Ubuntu Server 26.04 LTS server is used with no installed packages. Please follow guide below to install latest phpIPAM version Ubuntu.
I used the following assumptions to prepare this guide:
- Ubuntu installation base is "Ubuntu Server (minimized)"
- No software is installed on server
- Database and apache server will run on same machine
- phpipam will run in server root directory (will be accessible via http://ip_address/), no vhosts to simplify setup
- Only bare minimum configuration will be done
Here are steps required for installation:
Following assumptions were made to prepare this guide:
- Install required applications
- Configure php-fpm FastCGI process manager
- Configure nginx webserver
- Configure MySQL/MariaDB database
- Install phpipam codebase and create initial configuration
- Install phpipam database
Let's go !
1.) Install required applications
First install all applications and services required for phpipam:
sudo apt install cron net-tools inetutils-ping fping git mariadb-server mariadb-client nginx php-fpm php-gmp php-common php-mbstring php-gd php-curl php-dom php-pear php-pdo-mysql
2.) Configure php-fpm FastCGI process manager
Edit file /etc/php/8.5/fpm/pool.d/www.conf, configure below options - they are mainly used to log possible php errors:
access.log = log/$pool.access.log catch_workers_output = yes php_flag[display_errors] = on php_admin_value[error_log] = /var/log/fpm-php.www.log php_admin_flag[log_errors] = on
Also, edit /etc/php/8.5/fpm/php.ini and /etc/php/8.5/cli/php.ini to set timezone - bith files, one for web and other for correct calculation of lastSeen times on cronjob scanning.
date.timezone = Europe/Ljubljana display_errors = On display_startup_errors = On
Now restart php-fpm service systemctl restart php8.5-fpm.
3.) Configure nginx webserver
Main nginx configuration file for defaul site is /etc/nginx/sites-enabled/default. As mentioned at beginning for configuration simplicity we will not use vhosts, we will load phpipam on main instance. Lets edit relevant parts of configuration:
# phpipam webapp
location / {
index index.php;
try_files $uri $uri/ /index.php;
}
# phpipam api
location /api {
index index.php;
try_files $uri $uri/ /api/index.php;
}
# pass PHP scripts to FastCGI server
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.5-fpm.sock;
}
Save and restart nginx webserver systemctl restart nginx.
4.) Configure MySQL/MariaDB database
Default options are ok, we just need to set root password, so issue folowing command and follow instructions to harden MariaDB server:
sudo mysql_secure_installation
5.) Install phpipam codebase and create initial configuration
Now that all prerequisites are met, it is time to install phpipam webapp. Lets first clone code from github repository. We will user master branch, that is the latest stable branch:
rm /var/www/html/index.nginx-debian.html git clone --recursive https://github.com/phpipam/phpipam.git /var/www/html/
Now we need to edit config.php file that has basic instructions, most important in this step is to configure credentials for MySQL. First copy sample config file:
cp /var/www/html/config.dist.php /var/www/html/config.php
Now edit config file (/var/www/html/config.php) and set database connection accordingly, change user/pass as needed. This is new account that will be created to access phpipam database only.
/** * database connection details ******************************/ $db['host'] = '127.0.0.1'; $db['user'] = 'phpipam'; $db['pass'] = 'phpipamadmin'; $db['name'] = 'phpipam'; $db['port'] = 3306;
If you have any other requirements (like server is behind reverse proxy, ...) set it here. Plese read and check all options in config.php.
6.) Install phpipam database
Now it is time to install database. Open your browser, it will show you phpipam web installer, select "Automatic database installation" and follow installer to complete installation.
Now phpipam installation is completed. Congratulations !
You need to do 3 things more:
6.1) Set flag that installation is completed:
Edit config.php and set $disable_installer = true;. This will prevent installer to be run again.
6.2) Set administration parameters:
Open website, go to Administration > phpIPAM settings and check parameters, modules etc, especially you need to set following parameters:
Prettify links: Yes Ping path: /usr/bin/ping FPing path: /usr/bin/fping
6.3) Set cron scripts
Set cron scripts that will be used to check host statuses and discover new hosts (crontab -e):
# update host statuses exery 15 minutes */15 * * * * /usr/bin/php /var/www/html/functions/scripts/pingCheck.php */15 * * * * /usr/bin/php /var/www/html/functions/scripts/discoveryCheck.php
6.4) Create backups
Set new cronjob that will create regular database backups (adjust user/pass according to what is set in config.php):
# Backup IP address table, remove backups older than 10 days
@daily /usr/bin/mysqldump -u phpipam -pphpipamadmin phpipam > /var/www/html/db/bkp/phpipam_bkp_$(date +"\%y\%m\%d").db
@daily /usr/bin/find /var/www/html/db/bkp/ -ctime +10 -exec rm {} \;
This is it, you phpipam is now installed.