# ![NetBox](<https://daemonless.io/images/logos/netbox.svg#only-light>) ![NetBox](<https://daemonless.io/images/logos/netbox-dark.svg#only-dark>) NetBox

[![Build Status](<https://img.shields.io/github/actions/workflow/status/daemonless/netbox/build.yaml?style=flat-square&amp;label=Build&amp;color=green>)](<https://github.com/daemonless/netbox/actions>) [![Last Commit](<https://img.shields.io/github/last-commit/daemonless/netbox?style=flat-square&amp;label=Last+Commit&amp;color=blue>)](<https://github.com/daemonless/netbox/commits>) [![OCI Pulls](<https://img.shields.io/docker/pulls/daemonless/netbox?style=flat-square&amp;label=OCI+Pulls&amp;color=blue>)](<https://hub.docker.com/r/daemonless/netbox>)

Network source of truth (IPAM/DCIM), built from the upstream NetBox release.

|  |  |
| --- | --- |
| **Port** | `8080` |
| **Registry** | [`ghcr.io/daemonless/netbox`](<https://github.com/daemonless/netbox/pkgs/container/netbox>) |
| **Daemonless** | [daemonless/netbox](<https://github.com/daemonless/netbox>) |
| **Source** | [netbox-community/netbox](<https://github.com/netbox-community/netbox>) |
| **Website** | [netboxlabs.com/oss/netbox](<https://netboxlabs.com/oss/netbox/>) |

Needs PostgreSQL 15+ and Redis. Migrations run automatically at start.

## Prerequisites

Before deploying, ensure your host environment is ready. See the [Quick Start Guide](<https://daemonless.io/guides/quick-start/index.md>) for host setup instructions, including the security model for host vs. container privileges.

## Deployment

**Customize Paths, UID &amp; Ports**

Install and manage **NetBox** on FreeBSD with [fjord](<https://fjord.daemonless.io>):

```
fjord install netbox
```

Or open the **App Store** in the fjord web UI and install **NetBox** from the wizard. New to fjord? See the [Install Guide](<https://fjord.daemonless.io/install/>).

**1\.** Save as `.env` and fill in what is empty:

```
# NetBox for FreeBSD (Daemonless)
# Copy to .env and edit.

# Host paths for persistent storage
NETBOX_CONFIG_PATH=/containers/netbox/config
DB_DATA_LOCATION=/containers/netbox/postgres

# Database password and first-run admin (change both before first start)
DB_NAME=netbox
DB_USER=netbox
DB_PASSWORD=changeme
SUPERUSER_NAME=admin
SUPERUSER_PASSWORD=changeme

TZ=UTC
```

**2\.** Save as `compose.yaml`:

```
name: netbox

services:
  netbox:
    image: ghcr.io/daemonless/netbox:latest
    container_name: netbox
    network_mode: host
    depends_on: [postgres, redis]
    restart: unless-stopped
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=${TZ:-UTC}
      - DB_HOST=${DB_HOST:-127.0.0.1}
      - DB_NAME=${DB_NAME:-netbox}
      - DB_USER=${DB_USER:-netbox}
      - DB_PASSWORD=${DB_PASSWORD}
      - REDIS_HOST=${REDIS_HOST:-127.0.0.1}
      - SUPERUSER_NAME=${SUPERUSER_NAME:-admin}
      - SUPERUSER_PASSWORD=${SUPERUSER_PASSWORD}
      - GRANIAN_WORKERS=${GRANIAN_WORKERS:-4}
      # - GRANIAN_WORKERS_LIFETIME=12h
    volumes:
      - ${NETBOX_CONFIG_PATH}:/config
    ports:
      - 8080:8080

  postgres:
    image: ghcr.io/daemonless/postgres:18
    container_name: netbox-postgres
    network_mode: host
    restart: unless-stopped
    annotations:
      org.freebsd.jail.allow.sysvipc: "true"
    environment:
      - POSTGRES_DB=${DB_NAME:-netbox}
      - POSTGRES_USER=${DB_USER:-netbox}
      - POSTGRES_PASSWORD=${DB_PASSWORD}
    volumes:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data

  redis:
    image: ghcr.io/daemonless/redis:latest
    container_name: netbox-redis
    network_mode: host
    restart: unless-stopped
```

Then run `podman-compose up -d`.

```
# .env

DIRECTOR_PROJECT=netbox
PUID=1000
PGID=1000
TZ=UTC
DB_HOST=127.0.0.1
DB_NAME=netbox
DB_USER=netbox
DB_PASSWORD=changeme
REDIS_HOST=127.0.0.1
SUPERUSER_NAME=admin
SUPERUSER_PASSWORD=changeme
GRANIAN_WORKERS=4
NETBOX_CONFIG_PATH=/containers/netbox/config
DB_DATA_LOCATION=/containers/netbox/postgres
```

```
# appjail-director.yml

options:
  - alias:
  - ip4_inherit:
services:
  netbox:
    name: netbox
    options:
      - container: 'args:--pull'
    oci:
      user: root
      environment:
        - PUID: !ENV '${PUID}'
        - PGID: !ENV '${PGID}'
        - TZ: !ENV '${TZ}'
        - DB_HOST: !ENV '${DB_HOST}'
        - DB_NAME: !ENV '${DB_NAME}'
        - DB_USER: !ENV '${DB_USER}'
        - DB_PASSWORD: !ENV '${DB_PASSWORD}'
        - REDIS_HOST: !ENV '${REDIS_HOST}'
        - SUPERUSER_NAME: !ENV '${SUPERUSER_NAME}'
        - SUPERUSER_PASSWORD: !ENV '${SUPERUSER_PASSWORD}'
        - GRANIAN_WORKERS: !ENV '${GRANIAN_WORKERS}'
        - NETBOX_CONFIG_PATH: !ENV '${NETBOX_CONFIG_PATH}'
        - DB_DATA_LOCATION: !ENV '${DB_DATA_LOCATION}'
    volumes:
      - netbox: /config
  postgres:
    name: postgres
    options:
      - from: ghcr.io/daemonless/postgres:18
      - template: !ENV '${PWD}/postgres-template.conf'
    oci:
      environment:
        - POSTGRES_DB: !ENV '${DB_NAME}'
        - POSTGRES_USER: !ENV '${DB_USER}'
        - POSTGRES_PASSWORD: !ENV '${DB_PASSWORD}'
    volumes:
      - db_data: /var/lib/postgresql/data
  redis:
    name: redis
    options:
      - from: ghcr.io/daemonless/redis:latest
      - template: !ENV '${PWD}/template.conf'
volumes:
  netbox:
    device: '/containers/netbox'
  db_data:
    device: !ENV '${DB_DATA_LOCATION}'
```

```
# Makejail

ARG tag=latest

OPTION container=boot
OPTION overwrite=force
OPTION from=ghcr.io/daemonless/netbox:${tag}
```

Save the files above, then run `appjail-director up`.

Open `http://<server>:8080` from another machine (the server's own browser can't use a published port).

## Parts

| Service | Image | Role |  |
| --- | --- | --- | --- |
| **netbox** | `ghcr.io/daemonless/netbox:latest` |  | [docs](<https://daemonless.io/images/netbox/index.md>) |
| **postgres** | `ghcr.io/daemonless/postgres:18` |  | [docs](<https://daemonless.io/images/postgres/index.md>) |
| **redis** | `ghcr.io/daemonless/redis:latest` |  | [docs](<https://daemonless.io/images/redis/index.md>) |

## Parameters

### Environment Variables

| Variable | Default | Description |
| --- | --- | --- |
| `PUID` | `1000` |  |
| `PGID` | `1000` |  |
| `TZ` | `UTC` |  |
| `DB_HOST` | `127.0.0.1` | Where NetBox finds PostgreSQL (set automatically for the built-in database; 127.0.0.1 on host networking) |
| `DB_NAME` | `netbox` | PostgreSQL database name |
| `DB_USER` | `netbox` | PostgreSQL user |
| `DB_PASSWORD` | `changeme` | Database password (or DB\_PASSWORD\_FILE) |
| `REDIS_HOST` | `127.0.0.1` | Where NetBox finds Redis (set automatically for the built-in Redis; 127.0.0.1 on host networking) |
| `SUPERUSER_NAME` | `admin` | Optional first-run admin user |
| `SUPERUSER_PASSWORD` | `changeme` | Optional first-run admin password |
| `GRANIAN_WORKERS` | `4` | Granian worker processes (default 2) |
| `ALLOWED_HOSTS` | \`\` | Space-separated hostnames (default \*) |
| `CSRF_TRUSTED_ORIGINS` | \`\` | Space-separated origins, e.g. [https://netbox.example.com](<https://netbox.example.com>) |
| `NETBOX_CONFIG_PATH` | `/containers/netbox/config` | Path to store NetBox secrets, media and scripts |
| `DB_DATA_LOCATION` | `/containers/netbox/postgres` | Path to store PostgreSQL data files |
| `NETBOX_SECRET_KEY` | `<NETBOX_SECRET_KEY>` | Optional; auto-generated into /config/secret\_key |
| `NETBOX_API_TOKEN_PEPPER` | `<NETBOX_API_TOKEN_PEPPER>` | Optional; auto-generated into /config/api\_token\_pepper |
| `GRANIAN_*` | \`\` | Any Granian option via its env var, e.g. GRANIAN\_WORKERS\_LIFETIME |

### Volumes

| Path | Description |
| --- | --- |
| `/config` | Secrets, media, scripts, configuration\_extra.py |

### Ports

| Port | Protocol | Description |
| --- | --- | --- |
| `8080` | TCP | Web UI |

## Version Tags

| Tag | Description | Best For |
| :--- | :--- | :--- |
| `latest` | **Upstream Binary**. Built from official release. | Most users — recommended. |

> [!NOTE]
>
> **Implementation Details**
>
> - **Architectures:** amd64
> - **User:** `bsd` (UID/GID set via [PUID/PGID](<https://daemonless.io/guides/permissions/index.md>)). Defaults to `1000:1000`.
> - **Base:** Built on `ghcr.io/daemonless/base` (FreeBSD 15.1).

---

Need help? Join our [Discord](<https://discord.gg/Kb9tkhecZT>) community.
