phpIPAM Docker image
Branch: master
Clone or download
pierrecdn Support Google Maps & Geocode APIs
By adding GMAPS_API_KEY and GMAPS_APIcGEOCODE_KEY environement variables

Signed-off-by: pierrecdn <>
Latest commit 0f337b9 Jan 20, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
Dockerfile Support Google Maps & Geocode APIs Jan 20, 2019
LICENSE Initial commit Jul 17, 2015 Support Google Maps & Geocode APIs Jan 20, 2019
php.ini Removed PHP and error exposure and set timezone to UTC Feb 20, 2018


phpIPAM is an open-source web IP address management application. Its goal is to provide light and simple IP address management application.

phpIPAM is developed and maintained by Miha Petkovsek, released under the GPL v3 license, project source is here.

Learn more on phpIPAM homepage.

phpIPAM logo

How to use this Docker image


Run a MySQL database, dedicated to phpipam.

$ docker run --name phpipam-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -v /my_dir/phpipam:/var/lib/mysql -d mysql:5.6

Here, we store data on the host system under /my_dir/phpipam and use a specific root password.


$ docker run -ti -d -p 80:80 -e MYSQL_ENV_MYSQL_ROOT_PASSWORD=my-secret-pw --name ipam --link phpipam-mysql:mysql pierrecdn/phpipam

We are linking the two containers and exposing the HTTP port.

First install scenario

  • Browse to http://<ip>[:<specific_port>]/install/
  • Step 1 : Choose 'Automatic database installation'


  • Step 2 : Re-Enter connection information



  • You're done !


Docker compose

You can also create an all-in-one YAML deployment descriptor with Docker compose, like this:

version: '2'

    image: mysql:5.6
      - MYSQL_ROOT_PASSWORD=my-secret-pw
    restart: always
      - db_data:/var/lib/mysql
      - mysql
    image: pierrecdn/phpipam
      - MYSQL_ENV_MYSQL_ROOT_PASSWORD=my-secret-pw
      - MYSQL_ENV_MYSQL_HOST=mysql
      - "80:80"

And next :

$ docker-compose up -d

You can also point the MYSQL_ENV_PASSWORD_FILE environment variable to a file, in which case the contents of this file will be used as the password. This makes it possible to use docker secrets for instance:

version: '3'

      - MYSQL_ENV_MYSQL_PASSWORD_FILE=/run/secrets/phpipam_mysql_root_password
      - phpipam_mysql_root_password

The secret can be created by running echo my-secret-pw | docker secret create phpipam_mysql_root_password -

Advanced Configuration

Here is the list of the available environment variables in the phpipam container, pass them to docker using -e. None of them are actually needed to run the container, this is only to tweak the behavior.

Environment variable Default value Description
MYSQL_ENV_MYSQL_HOST mysql The host used to reach the MySQL instance
MYSQL_ENV_MYSQL_USER root The user to connect the MySQL instance
MYSQL_ENV_MYSQL_ROOT_PASSWORD (empty) The MySQL password. Can be set using the Web UI during the first install
MYSQL_ENV_MYSQL_DB phpipam The name of the MySQL DB to connect to
MYSQL_ENV_MYSQL_PASSWORD_FILE (empty) A file containing the password (if not using MYSQL_ROOT_PASSWORD) this allows to leverage docker secrets
PHPIPAM_BASE / The base URI under which phpipam runs. Useful when performing rewrites with a reverse-proxy
GMAPS_API KEY (empty) Google Maps API Key, used to display maps of your devices
GMAPS_API_GEOCODE_KEY (empty) Google Maps Geocode API Key, used to find coordinates from an address/ a location of your device

Specific integration (HTTPS, multi-host containers, etc.)

Regarding your requirements and docker setup, you've to expose resources.

For HTTPS, run a reverse-proxy in front of your phpipam container and link it to.

For multi-host containers, expose ports, run etcd or consul to make service discovery works etc.


phpIPAM is under heavy development by the amazing Miha. To upgrade the release version, just change the PHPIPAM_VERSION environment variable to the target release (see here).