# Self-host phpIPAM

> An open source IP address management app for tracking subnets, addresses, VLANs and devices, backed by MariaDB. Finish the database install from the first page with the generated root password.

- Page: https://levelrail.com/templates/phpipam/
- JSON: https://levelrail.com/templates/phpipam.json
- Category: Infrastructure
- Licence: GPL-3.0-or-later (Copyleft license)
- Source: https://github.com/phpipam/phpipam
- Upstream docs: https://phpipam.net/documents/

## Requirements
- Memory: about 512 MiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: 11.8.9

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| db | mariadb | 11.8.9 | none | mariadb_data -> /var/lib/mysql |
| phpipam | phpipam/phpipam-www | v1.9.0 | 80 | none |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| db | MYSQL_ROOT_PASSWORD | generated |
| phpipam | IPAM_DATABASE_HOST | preset |
| phpipam | IPAM_DATABASE_NAME | preset |
| phpipam | IPAM_DATABASE_PASS | generated |
| phpipam | IPAM_DATABASE_USER | preset |
| phpipam | IPAM_DATABASE_WEBHOST | preset |
| phpipam | TZ | preset |

## Deploy

### CLI

```bash
levelrail-cli templates install phpipam --name my-phpipam
```

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain db=app.example.com.

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/phpipam/install \
  -d '{
    "name": "my-phpipam"
  }'
```

Create a token in the dashboard first. Name, env and domains are the request fields.

## First run
1. Open the page, choose automatic database installation, enter root and the generated database root password, then set the admin password.

## Questions

### Can I deploy phpIPAM on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for phpIPAM, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image mariadb:11.8.9, phpipam/phpipam-www:v1.9.0 is what you deploy there.

Self-host phpIPAM, phpIPAM docker compose file, deploy phpIPAM on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
