___
# Tags
#docker
#unifi
#portainer
#homelab
# Helpful Docs
- Link to [LinuxServer.io's config](https://fleet.linuxserver.io/image?name=linuxserver/unifi-controller)
# Notes
- Pull the image you want using Portainer, I prefer to pick a fixed version opposed to using `Latest` because when I upgrade I want it to be an intentional process
![[Pasted image 20230203102332.png]]
- Review the given config for the variables you need to build out using the Portainer UI
```bash
docker create \
--name=unifi-controller \
-e PUID=1000 `# for UserID` \
-e PGID=1000 `# for GroupID` \
-e MEM_LIMIT=1024M `# Optionally change the Java memory limit (-Xmx) (default is 1024M).` \
-v /host/path/to/config:/config `# All Unifi data stored here` \
-p 10001:10001/udp `# Required for AP discovery` \
-p 8880:8880/tcp `# Unifi guest portal HTTP redirect port` \
-p 8843:8843/tcp `# Unifi guest portal HTTPS redirect port` \
-p 8443:8443/tcp `# Unifi web admin port` \
-p 8080:8080/tcp `# Required for device communication` \
-p 6789:6789/tcp `# For mobile throughput test` \
-p 5514:5514/tcp `# Remote syslog port` \
-p 3478:3478/udp `# Unifi STUN port` \
-p 1900:1900/udp `# Required for Make controller discoverable on L2 network option` \
--restart unless-stopped \
linuxserver/unifi-controller:7.3.76
```
- Review [[Installing Adguard Home in Docker]], and [[Review a Docker Config and What It Means]] to map the above config to Portainer
- Once you get the container deployed, it's time to add your Unifi APs to it and have the Unifi Controller adopt them
- Each Unifi AP comes with a factory reset button if you need reset it and start again, if your controller is on the same network segment as your APs it should auto-discover them by default and you can adopt them within the Unifi UI
- If you are looking to issue a re-adoption command over the CLI or factory resetting over the CLI refer to [[Setup Unifi APs with New Unifi-Controller]]