Show HN: UniFi OS Server in Docker

AdriaanvRossum1 pts0 comments

GitHub - unihosted/unifi-os-server-docker · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

Uh oh!

There was an error while loading. Please reload this page.

unihosted

unifi-os-server-docker

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star<br>16

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>3 Commits<br>3 Commits

.github/workflows

.github/workflows

.gitignore

.gitignore

Dockerfile

Dockerfile

README.md

README.md

docker-compose.yaml

docker-compose.yaml

site-localhost-bypass.conf

site-localhost-bypass.conf

uos-entrypoint.sh

uos-entrypoint.sh

View all files

Repository files navigation

UniFi OS Server in Docker

Ubiquiti only ships the UniFi OS Server (UOS) as an OCI image embedded inside a proprietary Rust installer — you can't just pull it from a registry. This repository extracts that OCI image, adjusts it to our liking, and ships it with a compose file and config that make it fit to run in Docker. No parallel Podman setup required.

Quick Start

Save the compose below as docker-compose.yaml, set UOS_SYSTEM_IP to your public IP, and run docker compose up -d. The Web UI will be at https://localhost:11443 once the container is ready. Every port and environment variable is documented inline: the compose is the reference.

services:<br>unifi-os-server:<br>container_name: unifi-os-server<br>image: ghcr.io/unihosted/unifi-os-server-docker:latest<br>cgroup: host<br>restart: unless-stopped<br>cap_add:<br>- NET_RAW<br>- NET_ADMIN<br>ports:<br>- "8080:8080" # HTTP inform / redirect<br>- "8443:8443" # UniFi Controller API<br>- "8444:8444" # Secure Portal for Hotspot<br>- "8880-8882:8880-8882" # Hotspot portal redirection (HTTP)<br>- "10003:10003/udp" # UniFi discovery (Only needed on local network)<br>- "11443:443" # UniFi Web UI (HTTPS)<br>- "3478:3478/udp" # STUN used for device poking<br>- "5514:5514/udp" # Syslog<br>- "6789:6789" # Speed test

# Network App bypass — skips UOS SSO, direct access to the controller<br># API on 127.0.0.1:8081. Bind to localhost ONLY; never expose publicly.<br>- "127.0.0.1:7443:7443"<br>- "127.0.0.1:5432:5432" # PostgreSQL (localhost only)<br>extra_hosts:<br>- "host.docker.internal:host-gateway"<br>- "host.containers.internal:host-gateway"<br>volumes:<br>- /sys/fs/cgroup:/sys/fs/cgroup:rw<br>- ./docker/uos:/var/lib/uosserver<br>- ./docker/uos:/var/lib/unifi<br>- ./docker/data/:/data<br>tmpfs:<br>- /run:exec<br>- /run/lock<br>- /tmp:exec<br>- /var/lib/journal<br>- /var/opt/unifi/tmp:size=64m<br>- /data/unifi-core/config/http<br>networks:<br>- unifi-os-server-network<br>depends_on:<br>- unifi-os-server-mongodb<br>environment:<br>TZ: Europe/Amsterdam<br>UOS_SYSTEM_IP: "127.0.0.1"<br># SSO bypass for the Network App (port 7443). Used by UniHosted for<br># debugging and direct API access. NOT for production — the port is<br># bound to localhost above and must stay that way.<br>EXPOSE_NETWORK_APP: "true"

MONGO_INTERNAL: "false" # Defaults to false → uses the external MongoDB service below.<br># Set to "true" and remove the unifi-network-mongodb service + depends_on<br># to let the UniFi Network App run its own mongod (port 27117).

unifi-os-server-mongodb:<br>container_name: unifi-os-server-mongodb<br>image: mongo:4.4<br>networks:<br>- unifi-os-server-network<br>volumes:<br>- ./docker/mongodb:/data/db

networks:<br>unifi-os-server-network:

Why This Exists

Ubiquiti ships UOS as an OCI image, but bundles it inside a proprietary installer rather than publishing it to a registry. At UniHosted we were already running everything else in Docker, so rather than maintain a parallel Podman setup just for one application, we extract the OCI image from the installer and re-package it so it runs cleanly under Docker. Once the pipeline worked, it seemed silly not to share it. If you're in the same boat, here it is.

By default the internal mongod is removed and the container expects a separate MongoDB 4.4 instance (see the included docker-compose.yaml). Set MONGO_INTERNAL=true to let the UniFi Network App manage its own bundled mongod (port 27117) instead.

How It Works

One of the nice things about this project is that the build is fully transparent: nothing happens behind a curtain. We...

unifi docker server network compose mongodb

Related Articles