├── .dockerignore ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── Dockerfile ├── README.md └── root └── etc ├── cont-init.d ├── 20-config └── 30-keygen └── services.d └── unifi └── run /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .gitignore 3 | .github 4 | .gitattributes 5 | READMETEMPLATE.md 6 | README.md 7 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [linuxserverurl]: https://linuxserver.io 4 | [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ## Thanks, team linuxserver.io 21 | 22 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [linuxserverurl]: https://linuxserver.io 4 | [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | ## Thanks, team linuxserver.io 15 | 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdisk 44 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM lsiobase/ubuntu:xenial 2 | 3 | # set version label 4 | ARG BUILD_DATE 5 | ARG VERSION 6 | LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" 7 | LABEL maintainer="sparklyballs" 8 | 9 | # package versions 10 | ARG UNIFI_VER="5.6.40" 11 | 12 | # environment settings 13 | ARG DEBIAN_FRONTEND="noninteractive" 14 | 15 | RUN \ 16 | echo "**** add mongo repository ****" && \ 17 | apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6 && \ 18 | echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" >> /etc/apt/sources.list.d/mongo.list && \ 19 | echo "**** install packages ****" && \ 20 | apt-get update && \ 21 | apt-get install -y \ 22 | binutils \ 23 | jsvc \ 24 | mongodb-org-server \ 25 | openjdk-8-jre-headless \ 26 | wget && \ 27 | echo "**** install unifi ****" && \ 28 | curl -o \ 29 | /tmp/unifi.deb -L \ 30 | "http://dl.ubnt.com/unifi/${UNIFI_VER}/unifi_sysvinit_all.deb" && \ 31 | dpkg -i /tmp/unifi.deb && \ 32 | echo "**** cleanup ****" && \ 33 | apt-get clean && \ 34 | rm -rf \ 35 | /tmp/* \ 36 | /var/lib/apt/lists/* \ 37 | /var/tmp/* 38 | 39 | # add local files 40 | COPY root/ / 41 | 42 | # Volumes and Ports 43 | WORKDIR /usr/lib/unifi 44 | VOLUME /config 45 | EXPOSE 8080 8081 8443 8843 8880 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [linuxserverurl]: https://linuxserver.io 2 | [forumurl]: https://forum.linuxserver.io 3 | [ircurl]: https://www.linuxserver.io/irc/ 4 | [podcasturl]: https://www.linuxserver.io/podcast/ 5 | [appurl]: https://www.ubnt.com/enterprise/#unifi 6 | [hub]: https://hub.docker.com/r/linuxserver/unifi/ 7 | 8 | THIS IMAGE IS DEPRECATED. PLEASE USE THE MULTI-ARCH IMAGES AT `linuxserver/unifi-controller` 9 | 10 | More information here: https://blog.linuxserver.io/2019/02/18/changes-to-our-unifi-image/ 11 | 12 | [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] 13 | 14 | The [LinuxServer.io][linuxserverurl] team brings you another container release featuring easy user mapping and community support. Find us for support at: 15 | * [forum.linuxserver.io][forumurl] 16 | * [IRC][ircurl] on freenode at `#linuxserver.io` 17 | * [Podcast][podcasturl] covers everything to do with getting the most from your Linux Server plus a focus on all things Docker and containerisation! 18 | 19 | # linuxserver/unifi 20 | [![](https://images.microbadger.com/badges/version/linuxserver/unifi.svg)](https://microbadger.com/images/linuxserver/unifi "Get your own version badge on microbadger.com")[![](https://images.microbadger.com/badges/image/linuxserver/unifi.svg)](https://microbadger.com/images/linuxserver/unifi "Get your own image badge on microbadger.com")[![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/unifi.svg)][hub][![Docker Stars](https://img.shields.io/docker/stars/linuxserver/unifi.svg)][hub][![Build Status](https://ci.linuxserver.io/buildStatus/icon?job=Docker-Builders/x86-64/x86-64-unifi)](https://ci.linuxserver.io/job/Docker-Builders/job/x86-64/job/x86-64-unifi/) 21 | 22 | The [UniFi®](https://www.ubnt.com/enterprise/#unifi) Controller software is a powerful, enterprise wireless software engine ideal for high-density client deployments requiring low latency and high uptime performance. 23 | 24 | [![unifi](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/unifi-banner.png)][appurl] 25 | 26 | ## Usage 27 | 28 | ``` 29 | docker create \ 30 | --name=unifi \ 31 | -v :/config \ 32 | -e PGID= -e PUID= \ 33 | -p 3478:3478/udp \ 34 | -p 10001:10001/udp \ 35 | -p 8080:8080 \ 36 | -p 8081:8081 \ 37 | -p 8443:8443 \ 38 | -p 8843:8843 \ 39 | -p 8880:8880 \ 40 | -p 6789:6789 \ 41 | linuxserver/unifi 42 | ``` 43 | 44 | Using tags, you can choose between either the latest "LTS Stable" branch (the default, no tag required) or the "Unstable" branch of UniFi. See the UniFi [FAQ Page](https://help.ubnt.com/hc/en-us/articles/360008240754#1) for a breakdown of their various branches. 45 | 46 | Add one of the tags, if required, to the linuxserver/unifi line of the run/create command in the following format, linuxserver/unifi:unstable 47 | 48 | #### Tags 49 | 50 | + **latest** : releases from the 5.6.x "LTS Stable" branch 51 | + **unstable** : releases from the 5.9.x "Unstable" branch. 52 | 53 | ## Parameters 54 | 55 | `The parameters are split into two halves, separated by a colon, the left hand side representing the host and the right the container side. 56 | For example with a port -p external:internal - what this shows is the port mapping from internal to external of the container. 57 | So -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080 58 | http://192.168.x.x:8080 would show you what's running INSIDE the container on port 80.` 59 | 60 | 61 | * `-p 3478` - port(s) 62 | * `-p 10001` - port(s) required for AP discovery 63 | * `-p 8080` - port(s) required for Unifi to function 64 | * `-p 8081` - port(s) 65 | * `-p 8443` - port(s) 66 | * `-p 8843` - port(s) 67 | * `-p 8880` - port(s) 68 | * `-p 6789` - port(s) For throughput test 69 | * `-v /config` - where unifi stores it config files etc, needs 3gb free 70 | * `-e PGID` for GroupID - see below for explanation 71 | * `-e PUID` for UserID - see below for explanation 72 | 73 | It is based on xenial with s6 overlay, for shell access whilst the container is running do `docker exec -it unifi /bin/bash`. 74 | 75 | ### User / Group Identifiers 76 | 77 | Sometimes when using data volumes (`-v` flags) permissions issues can arise between the host OS and the container. We avoid this issue by allowing you to specify the user `PUID` and group `PGID`. Ensure the data volume directory on the host is owned by the same user you specify and it will "just work" TM. 78 | 79 | In this instance `PUID=1001` and `PGID=1001`. To find yours use `id user` as below: 80 | 81 | ``` 82 | $ id dockeruser 83 | uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup) 84 | ``` 85 | 86 | ## Setting up the application 87 | 88 | The webui is at https://ip:8443, setup with the first run wizard. 89 | 90 | For Unifi to adopt other devices, e.g. an Access Point, it is required to change the inform ip address. Because Unifi runs inside Docker by default it uses an ip address not accessable by other devices. To change this go to Settings > Controller > Controller Settings and set the Controller Hostname/IP to an ip address accessable by other devices. 91 | 92 | Alternatively to manually adopt a device take these steps: 93 | 94 | ``` 95 | ssh ubnt@$AP-IP 96 | mca-cli 97 | set-inform http://$address:8080/inform 98 | ``` 99 | 100 | Use `ubnt` as the password to login and `$address` is the IP address of the host you are running this container on and `$AP-IP` is the Access Point IP address. 101 | 102 | ## Common problems 103 | 104 | When using a Security Gateway (router) it could be that network connected devices are unable to obtain an ip address. This can be fixed by setting "DHCP Gateway IP", under Settings > Networks > network_name, to a correct (and accessable) ip address. 105 | 106 | ## Info 107 | 108 | * Shell access whilst the container is running: `docker exec -it unifi /bin/bash` 109 | * To monitor the logs of the container in realtime: `docker logs -f unifi` 110 | 111 | 112 | * container version number 113 | 114 | `docker inspect -f '{{ index .Config.Labels "build_version" }}' unifi` 115 | 116 | * image version number 117 | 118 | `docker inspect -f '{{ index .Config.Labels "build_version" }}' linuxserver/unifi` 119 | 120 | ## Versions 121 | 122 | + **14.09.18:** Update to 5.6.40. 123 | + **06.07.18:** Update to 5.6.39. 124 | + **26.04.18:** Update to 5.6.37. 125 | + **24.03.18:** Update to 5.6.36. 126 | + **14.03.18:** Add unstable branch for 5.7x releases. 127 | + **19.02.18:** Add port 6789 to support throughput test 128 | + **09.02.18:** Update to 5.6.30. 129 | + **08.02.18:** Use loop to simplify symlinks. 130 | + **08.01.18:** Update to 5.6.29. 131 | + **15.12.17:** Update to 5.6.26. 132 | + **09.12.17:** Fix continuation lines. 133 | + **12.11.17:** Add STUN server port 3478 mapping to example. 134 | + **11.11.17:** Update to 5.6.22. 135 | + **22.10.17:** Fix typos in Dockerfile and cert gen. 136 | + **05.10.17:** Update to 5.5.24. 137 | + **03.08.17:** Update to 5.5.20. 138 | + **15.07.17:** Update to 5.5.19 and switch to using .deb package, no need to keep up with the unifi repo merry-go-round. 139 | + **05.07.17:** Change repo to stable. Remove execstack command, no longer required. 140 | + **18.03.17:** Fix execstack warning. 141 | + **14.10.16:** Add version layer information. 142 | + **20.09.16** Bump to pick up ver 5.27. 143 | + **10.09.16** Add layer badges to README. 144 | + **28.08.16** Add badges to README. 145 | + **01.07.16** Switch to lsiobase/xenial for conformity. 146 | + **25.06.16** Rebase to xenial and use updated repository. 147 | + **02.11.15** Initial Release. 148 | -------------------------------------------------------------------------------- /root/etc/cont-init.d/20-config: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | # create our folders 4 | mkdir -p \ 5 | /config/{data,logs,run} 6 | 7 | 8 | # create symlinks for config 9 | symlinks=( \ 10 | /usr/lib/unifi/data \ 11 | /usr/lib/unifi/logs \ 12 | /usr/lib/unifi/run ) 13 | 14 | for i in "${symlinks[@]}" 15 | do 16 | [[ -L "$i" && ! "$i" -ef /config/"$(basename "$i")" ]] && unlink "$i" 17 | [[ ! -L "$i" ]] && ln -s /config/"$(basename "$i")" "$i" 18 | done 19 | 20 | # permissions 21 | chown -R abc:abc \ 22 | /config \ 23 | /usr/lib/unifi 24 | -------------------------------------------------------------------------------- /root/etc/cont-init.d/30-keygen: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | # generate key 4 | [[ ! -f /config/data/keystore ]] && \ 5 | keytool -genkey -keyalg RSA -alias unifi -keystore /config/data/keystore \ 6 | -storepass aircontrolenterprise -keypass aircontrolenterprise -validity 1825 \ 7 | -keysize 4096 -dname "cn=unifi" 8 | 9 | # permissions 10 | chown abc:abc \ 11 | /config/data/keystore 12 | -------------------------------------------------------------------------------- /root/etc/services.d/unifi/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | cd /config || exit 4 | 5 | exec \ 6 | s6-setuidgid abc java -Xmx1024M -jar /usr/lib/unifi/lib/ace.jar start 7 | --------------------------------------------------------------------------------