# ![UniFi OS Server](<https://daemonless.io/images/logos/unifi-os-server.svg>) UniFi OS Server

[![Build Status](<https://img.shields.io/github/actions/workflow/status/daemonless/unifi-os-server/build.yaml?style=flat-square&label=Build&color=green>)](<https://github.com/daemonless/unifi-os-server/actions>) [![Last Commit](<https://img.shields.io/github/last-commit/daemonless/unifi-os-server?style=flat-square&label=Last+Commit&color=blue>)](<https://github.com/daemonless/unifi-os-server/commits>) [![OCI Pulls](<https://img.shields.io/docker/pulls/daemonless/unifi-os-server?style=flat-square&label=OCI+Pulls&color=blue>)](<https://hub.docker.com/r/daemonless/unifi-os-server>) [![mlock Required](<https://img.shields.io/badge/mlock-required-orange?style=flat-square&logo=freebsd&logoColor=white>)](</guides/ocijail-patch/>) [![sysvipc Required](<https://img.shields.io/badge/sysvipc-required-orange?style=flat-square&logo=freebsd&logoColor=white>)](</guides/ocijail-patch/>)

Highly experimental: Ubiquiti UniFi OS Server on FreeBSD — runs the full UniFi management stack (unifi-core, UniFi Network) using FreeBSD jails and linuxulator.

> [!WARNING]
>
> **Highly experimental.** Ubiquiti does not ship UniFi OS Server for FreeBSD. This image cherry-picks the Linux binaries out of the official installer, runs them under linuxulator with stubs standing in for systemd, D-Bus, hardware identity and the package manager, and overlays a newer standalone Network release with UOS-only classes grafted from the bundle. It boots, restores Network backups and adopts devices, but a UOS or Network update can break any of that, and some console features (app installs, UOS backups, the unifi-core event stream to Network) are stubbed or known broken. Keep a working controller and a current backup; do not make this your only one.

|  |  |
| --- | --- |
| **Registry** | [`ghcr.io/daemonless/unifi-os-server`](<https://github.com/daemonless/unifi-os-server/pkgs/container/unifi-os-server>) |
| **Daemonless** | [daemonless/unifi-os-server](<https://github.com/daemonless/unifi-os-server>) |
| **Source** | [ui.com/consoles/unifi-os-server](<https://ui.com/consoles/unifi-os-server>) |
| **Website** | [ui.com](<https://ui.com/>) |

## Prerequisites

**Linux binary compatibility must be loaded on the host.** unifi-core, uos-agent and uid-agent are Linux ELF binaries run through linuxulator, and a jail cannot load kernel modules itself:

```
sysrc linux_enable=YES
service linux start
```

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 & Ports**

```
services:
  unifi-os-server:
    image: "ghcr.io/daemonless/unifi-os-server:latest"
    container_name: unifi-os-server
    volumes:
      - "/containers/unifi-os-server/data:/data"
      - "/containers/unifi-os-server/data:/compat/linux/data"
    annotations:
      org.freebsd.jail.allow.mlock: "true"
      org.freebsd.jail.allow.sysvipc: "true"
    # always (not unless-stopped) so FreeBSD's podman rc.d auto-starts it at boot
    restart: always
```

Save as `compose.yaml`, then run `podman-compose up -d`.

```
# .env

DIRECTOR_PROJECT=unifi-os-server
```

```
# appjail-director.yml

options:
  - alias:
  - ip4_inherit:
services:
  unifi-os-server:
    name: unifi_os_server
    options:
      - container: 'args:--pull'
      - template: !ENV '${PWD}/template.conf'
    volumes:
      - unifi-os-server_data: /data
      - unifi-os-server_data: /compat/linux/data
volumes:
  unifi-os-server_data:
    device: '/containers/unifi-os-server/data'
  unifi-os-server_data:
    device: '/containers/unifi-os-server/data'
```

```
# Makejail

ARG tag=latest

OPTION container=boot
OPTION overwrite=force
OPTION from=ghcr.io/daemonless/unifi-os-server:${tag}
```

```
# template.conf

exec.start: "/bin/sh /etc/rc"
exec.stop: "/bin/sh /etc/rc.shutdown jail"
mount.devfs
persist
allow.mlock
allow.sysvipc
```

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

> [!WARNING]
>
> **Experimental**
>
> Bastille's OCI support is experimental. It requires `buildah` and shares the host network stack (`inherit`). Mount volumes with `--volume HOST JAIL`; without it, image-declared volumes are stored under `${bastille_volumesdir}/${jail}`.

```
services:
  unifi-os-server:
    name: unifi-os-server
    image: "ghcr.io/daemonless/unifi-os-server:latest"
    network:
      - mode: host
    volumes:
      - "/containers/unifi-os-server/data:/data"
      - "/containers/unifi-os-server/data:/compat/linux/data"
```

Save as `bastille-compose.yml`, then run `bastille up`.

## Setup Instructions

**Networking.** The compose file in this repo runs with `network_mode: host` so UniFi's L2 device discovery works; add that line if your snippet lacks it. The server listens on 443 (web UI), 8080 (device inform), 8443 (Network HTTPS) and 3478/udp (STUN). On a bridge network instead, map those ports (`-p 443:443 -p 8080:8080 -p 8443:8443 -p 3478:3478/udp`); discovery will not work, so point devices at the controller yourself with `set-inform http://<host-ip>:8080/inform` or DHCP option 43.

**First start.** Open `https://<host-ip>/` and complete the setup wizard. Its "restore from backup" step only lists cloud backups; to restore a Network `.unf` file, finish setup first, then use Settings → Backups → Restore in the console. The bundled Network application is the current standalone release, so backups from an up-to-date controller restore.

**Moving devices from another controller.** Adopted devices keep working and follow their inform URL. Move one with `set-inform http://<host-ip>:8080/inform` over SSH (the device SSH credentials are in the old controller's Device SSH Authentication settings), or move all of them by setting the old controller's Inform Host override to the new address. Shut the old controller down once everything is online.

**Double `/data` mount.** The Linux services open SQLite databases under the Linux compat root, so the same data directory must be mounted at both `/data` and `/compat/linux/data`.

## Parameters

### Volumes

| Path | Description |
| --- | --- |
| `/data` | Persistent data (database, config, certs) |
| `/compat/linux/data` |  |

## 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).
> - **mlock:** Requires `--annotation 'org.freebsd.jail.allow.mlock=true'` ([ocijail 0.5.0+](</guides/ocijail-patch/>))
> - **sysvipc:** Requires `--annotation 'org.freebsd.jail.allow.sysvipc=true'` ([ocijail 0.5.0+](</guides/ocijail-patch/>))

---

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