Reply
Emerging Member
Posts: 47
Registered: ‎04-29-2016
Kudos: 26
Solutions: 2

Community created docker image with UniFi 5.6.30 for Raspberry Pi

I've tagged the 5.6.30 image as stable.

 

Project links:

https://hub.docker.com/r/ryansch/unifi-rpi/

https://github.com/ryansch/docker-unifi-rpi

 

Overview

Docker images for running Ubiquiti's UniFi Controller software on a Raspberry Pi.

Supported tags and respective Dockerfile links

Usage

Prerequisites

A Raspberry Pi running with Docker and Docker Compose installed on it. Guides such as this or this are available for beginners.

On rpi:

  1. mkdir unifi && cd unifi
  2. curl -O https://raw.githubusercontent.com/ryansch/docker-unifi-rpi/master/docker-compose.yml
  3. (Optional) Edit docker-compose.yml to point to a different tag if you don't want latest.
  4. sudo docker-compose up -d

From any computer on your network:

Visit https://raspberrypi.local:8443/ with your browser. Replace raspberrypi.local with the actual hostname or local network IP address of your Raspberry Pi.

Building

  • docker build --pull -t ryansch/unifi-rpi:<version> <version>
SuperUser
Posts: 42,328
Registered: ‎06-23-2009
Kudos: 8642
Solutions: 1448

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

This sounds like a sociable thing to do!

 

I'm curious [and ignorant about this]: what is the advantage to

putitng the UniFi controller into a container--instead of simply

running it as an executable?    Dave


> HQ in Seacoast region New Hampshire U.S.A.
> Ubiquiti Certified Trainer [UCT] for:
     UBWA [AirMax] / UEWA [UniFi] / UBRSS [routers]
UBNT.NH@gmail.com
Emerging Member
Posts: 47
Registered: ‎04-29-2016
Kudos: 26
Solutions: 2

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

Most of the advantage comes from not "simply" being able to run it as an executable. You need to make sure you have all of the correct dependencies for the version of the controller that you're trying to run. If you're on a strange/old linux distro, you might be relegated to building things from source. You may also have to deal with different executables wanting different versions of dependencies (say maybe something else wants a different version of mongodb).

Containers make all of this very easy as the container not only contains the controller but also all of its dependencies. Only the paths we specify are able to hold persistent data, all other things in the container are guaranteed to be exactly the same every time we launch the container. Upgrades are easy as we either pull in the updates to the general tag we're using (like ryansch/unifi-rpi:5.6) or we update the tag we're pointing to (like ryansch/unifi-rpi:5.6.30).
SuperUser
Posts: 42,328
Registered: ‎06-23-2009
Kudos: 8642
Solutions: 1448

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

I understand the value of a container for complex apps and to

resolve hardware inconsistencies cleanly. But for the example

you suggest, wouldn't it be a better plan with less effort to

simply upgrade an ancient Linux OS? Linux developers spend

a huge amount of time to provide backwards compatibility to

old junk--it's one of their missions.   Dave


> HQ in Seacoast region New Hampshire U.S.A.
> Ubiquiti Certified Trainer [UCT] for:
     UBWA [AirMax] / UEWA [UniFi] / UBRSS [routers]
UBNT.NH@gmail.com
Emerging Member
Posts: 47
Registered: ‎04-29-2016
Kudos: 26
Solutions: 2

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

Sure I'd advocate for upgrading in that exact case.

For me it's much easier to just ensure I've got docker available where I want to run software. Then I can launch containers and be done. I don't have to worry about different package managers or configuration. The work is already done for me.
New Member
Posts: 17
Registered: ‎05-21-2017
Kudos: 1

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

What is the performance like of the Unifi controller in a container on the RPi3?

I have it running natively on an RPi3 and although it works, its pretty damned slow. Java and 1GB RAM total.
I have made changes to reduce max RAM for JVM to 400MB and still sloowwwwwww

Thanks
SuperUser
Posts: 42,328
Registered: ‎06-23-2009
Kudos: 8642
Solutions: 1448

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

A 1GB RAM setup will be very slow; conside at least 4GB.   Dave


> HQ in Seacoast region New Hampshire U.S.A.
> Ubiquiti Certified Trainer [UCT] for:
     UBWA [AirMax] / UEWA [UniFi] / UBRSS [routers]
UBNT.NH@gmail.com
New Member
Posts: 37
Registered: ‎09-24-2015
Kudos: 254

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

Dave-D, they're talking about the raspberry pi. the RAM chip is soldered on and I don't believe they even make a bigger chip for that one than 1GB

Emerging Member
Posts: 47
Registered: ‎04-29-2016
Kudos: 26
Solutions: 2

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

It runs fine on the RPi3 on java 8. If you're running java 7 things will be terrible. Try my container image.
SuperUser
Posts: 42,328
Registered: ‎06-23-2009
Kudos: 8642
Solutions: 1448

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

Yeah--I know it's a PI, but I thought there was a version

with more RAM. This doesn't seem like the best platform

for this kind of use.    Dve


> HQ in Seacoast region New Hampshire U.S.A.
> Ubiquiti Certified Trainer [UCT] for:
     UBWA [AirMax] / UEWA [UniFi] / UBRSS [routers]
UBNT.NH@gmail.com
Emerging Member
Posts: 47
Registered: ‎04-29-2016
Kudos: 26
Solutions: 2

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

I've been running the controller (and openvpn) on my pi3 for about 2 years without any issues. It's a great platform for it.
New Member
Posts: 8
Registered: ‎10-06-2017
Kudos: 3

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

[ Edited ]

I've used one of your docker images in the past and just tried again with the latest. I'm having issues with the username/password. I can't remember what I used in the past so I blew away my container and image and pulled fresh with the hopes the password would reset. But I can't figure it out. Can you pass along the default username/password I should be using please? Or some assistance on how I can reset it for the docker image.

 

I believe that one I used successfully was 5.5.24 or similar. Could have been a 5.4? Great work though - very useful. Hope you can help.

New Member
Posts: 12
Registered: ‎08-20-2017
Kudos: 1
Solutions: 1

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

Thank you so much for creating this installation! I followed your procedures and now have the UniFi controller running on my Pi 2. It is a model B with 1GB of RAM and performance is surprising good.

 

I tried all the other guides for install UniFi on my Pi and could never get it to install - Kept running into problems with the UniFi package not being signed, or some such opaque problem.

 

One catch I ran into - I used a stock OS image rather than the one with docker already installed and ran into a problem where docker-compose was still not installed after installing docker. I use sudo pip install docker-compose to get that installed.

Emerging Member
Posts: 47
Registered: ‎04-29-2016
Kudos: 26
Solutions: 2

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

[ Edited ]

tfdrover - I can help with that.  If you've used the recommended docker-compose setup and you want to start completely over, you can run `docker-compose down -v`.  That command will stop your container, remove it, and remove the docker volumes where persistent data is stored.  Normally you want to be able to replace the container and keep your data; that's what you ran into.

Emerging Member
Posts: 47
Registered: ‎04-29-2016
Kudos: 26
Solutions: 2

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

[ Edited ]

jyoungl6 - I have to do the same thing on alpine linux. I'll add that to the README. Thanks!

New Member
Posts: 23
Registered: ‎12-26-2017

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

is there any reason we shouldn't add port mapping for port 8443 to the docker-compose file?  is there really any need to have all ports available?

 

 

New Member
Posts: 37
Registered: ‎09-24-2015
Kudos: 254

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

crackers, theres the stun port, and i believe http is used for set-inform. You really shouldnt be mapping any ports though, I add 8443 and the like to the docker file for documentation purpoises but you really should be using something more complete than just port forwards, either --net=host or macvlan networking to get them on the same broadcast domain.

New Member
Posts: 23
Registered: ‎12-26-2017

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

it works fine as is, so net=host doesn't seem necessary... i was just curious why we wouldn't just map 8443->8443.

New Member
Posts: 20
Registered: ‎05-07-2017

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

Can someone help a docker newb with an issue?  My docker containers are set to auto-update on a watchtower, and it seems like whenever the Unifi linuxserver docker image updates, I lose all my settings and am basically starting over with a fresh server all over again (lost my last server, all the access points are tied to it, etc).

 

This is just in my home I can fix, but I need to know what I am doing wrong here...I am happy for the docker to auto-update like my other dockers on my NAS do, but I don't want to have to start over with a fresh server and fresh configuration wizard every time it does.

 

Help?

Highlighted
New Member
Posts: 3
Registered: ‎07-20-2017

Re: Community created docker image with UniFi 5.6.30 for Raspberry Pi

Love this, it was my first docker container and it worked perfectly.

Dumb question, how do I upgrade the controller to the latest version?

Reply