Last active
April 19, 2024 14:02
-
-
Save jorisvervuurt/d8e03e31fdc45ad99d0797f6caeccb3c to your computer and use it in GitHub Desktop.
Running Unifi Network in Docker using Docker Compose
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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!'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 usingsudo mkdir -p /opt/unifi-network && cd /opt/unifi-network
.Then simply place the
compose.yaml
andupdate.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 runcd /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.