Skip to content

Instantly share code, notes, and snippets.

@jorisvervuurt
Last active April 19, 2024 14:02
Show Gist options
  • Save jorisvervuurt/d8e03e31fdc45ad99d0797f6caeccb3c to your computer and use it in GitHub Desktop.
Save jorisvervuurt/d8e03e31fdc45ad99d0797f6caeccb3c to your computer and use it in GitHub Desktop.
Running Unifi Network in Docker using Docker Compose
version: '3'
services:
unifi-controller:
container_name: unifi-controller
image: lscr.io/linuxserver/unifi-controller:latest
network_mode: host
volumes:
- /opt/unifi-network/config:/config
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Amsterdam
- MEM_LIMIT=2048
- MEM_STARTUP=2048
restart: unless-stopped
#!/bin/bash
cd "$(dirname "$0")";
echo 'Pulling images...';
sudo docker compose pull;
echo -e '\nStopping and removing containers...';
sudo docker compose down;
echo -e '\nCreating and starting containers...';
sudo docker compose up -d;
echo -e '\nDone!';
@jorisvervuurt
Copy link
Author

jorisvervuurt commented Oct 13, 2023

I use these files to easily run Unifi Network inside Docker, using Docker Compose.

First, create the /opt/unifi-network directory and navigate to it using sudo mkdir -p /opt/unifi-network && cd /opt/unifi-network.
Then simply place the compose.yaml and update.sh files inside this directory.

To start Unifi Network, run docker compose up -d inside the directory. If you want to update Unifi Network in the future, simply run cd /opt/unifi-network && ./update.sh. Unifi Network will start automatically on reboots.

Note that the author of the Docker image I use recommends using this new image: https://github.com/linuxserver/docker-unifi-network-application

I haven't had the time to set that up though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment