How to Install phpIPAM on macOS

phpIPAM is an open-source IP address management solution that helps to manage IP address space, track subnets and devices, and generate reports. It is written in PHP and requires a web server and a database server to run. In this tutorial, we will learn how to install phpIPAM on macOS.

Prerequisites

Before proceeding with the installation, make sure you have the following:

Step 1: Download phpIPAM

Go to the phpIPAM website and download the latest version of phpIPAM.

wget https://github.com/phpipam/phpipam/archive/master.zip

Once downloaded, extract the zip file to the web server directory.

unzip master.zip -d /var/www/html/

Step 2: Configure MySQL/MariaDB

phpIPAM requires a database server to store data. In this tutorial, we will use MariaDB as the database server.

Install MariaDB using Homebrew:

brew install mariadb

Start the MariaDB service:

brew services start mariadb

Log in to the MariaDB shell as root:

mysql -u root

Create a new database for phpIPAM:

CREATE DATABASE phpipam;

Create a new user and grant all privileges to the phpipam database:

CREATE USER 'phpipam'@'localhost' IDENTIFIED BY 'password123';
GRANT ALL PRIVILEGES ON phpipam.* TO 'phpipam'@'localhost';
FLUSH PRIVILEGES;

Step 3: Configure PHP

phpIPAM requires some PHP extensions to be installed. In this tutorial, we will use Homebrew to install them.

Install PHP 7.4:

brew install php@7.4

Install the required PHP extensions:

brew install php@7.4-gd php@7.4-mysql php@7.4-intl php@7.4-mcrypt php@7.4-bcmath

Edit the PHP configuration file:

sudo nano /usr/local/etc/php/7.4/php.ini

Change the following settings:

date.timezone = America/New_York

max_execution_time = 300

upload_max_filesize = 128M

post_max_size = 128M

Save and close the file.

Restart the web server service:

sudo apachectl restart

Step 4: Configure phpIPAM

Edit the phpIPAM configuration file:

sudo nano /var/www/html/phpipam-master/config.php

Update the following settings:

/* database connection details */
$db['host'] = 'localhost';
$db['user'] = 'phpipam';
$db['pass'] = 'password123';
$db['name'] = 'phpipam';

/* encryption key */
$config['encryption_key'] = '1234567890123456';

/* session name */
$config['cookies']['cookieName'] = 'phpipam';

/* base web directory */
$config['webroot'] = '/phpipam';

/* url to domain */
$config['baseurl'] = 'http://localhost/phpipam';

/* set debugging */
$config['debug'] = false;

Save and close the file.

Step 5: Install phpIPAM

Open a web browser and navigate to http://localhost/phpipam/install/.

Follow the on-screen instructions to complete the installation process.

Once the installation is complete, log in to phpIPAM using the default username and password:

Conclusion

In this tutorial, we learned how to install phpIPAM on macOS. You can now use phpIPAM to manage IP address space, track subnets and devices, and generate reports.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!