commit | author | age
|
bab5d7
|
1 |
# UniFi |
JK |
2 |
|
b16cbd
|
3 |
This is a Docker image of UniFi SDN controller |
bab5d7
|
4 |
based on `openjdk:8-jre-slim` |
JK |
5 |
|
|
6 |
## Tags |
|
7 |
|
|
8 |
Container is created for each stable UniFi release and tagged as vX.X.X. |
f6b8c2
|
9 |
`:latest` tag is for the latest stable release (currently 5.10). |
b16cbd
|
10 |
`:lts` tag is for the latest 5.6 LTS release. |
0e6da1
|
11 |
`:v5.7` tag is for the latest 5.7 release. |
JK |
12 |
`:v5.8` tag is for the latest 5.8 release. |
f6b8c2
|
13 |
`:v5.9` tag is for the latest 5.9 release. |
bab5d7
|
14 |
|
JK |
15 |
## Usage |
|
16 |
|
|
17 |
```bash |
|
18 |
docker run -d --name=unifi \ |
|
19 |
-p 8080:8080 -p 8443:8443 \ |
|
20 |
jacekkow/unifi |
|
21 |
``` |
|
22 |
|
|
23 |
UniFi interface should be available at https://127.0.0.1:8443/ |
|
24 |
(first run wizard is opened if the instance is unconfigured). |
|
25 |
|
|
26 |
By default it uses Docker data volume for persistence. |
|
27 |
|
|
28 |
You can update such installation by passing `--volumes-from` option |
|
29 |
to `docker run`: |
|
30 |
|
|
31 |
```bash |
|
32 |
docker pull jacekkow/unifi |
|
33 |
docker stop unifi |
|
34 |
docker rename unifi unifi-old |
|
35 |
docker run -d --name=unifi \ |
|
36 |
-p 8080:8080 -p 8443:8443 \ |
|
37 |
--volumes-from unifi-old \ |
|
38 |
jacekkow/unifi |
|
39 |
docker rm -v unifi-old |
|
40 |
``` |
|
41 |
|
|
42 |
### Local storage |
|
43 |
|
|
44 |
If you prefer to have direct access to container's data |
|
45 |
from the host, you can use local storage instead of data volumes: |
|
46 |
|
|
47 |
```bash |
|
48 |
docker run -d --name=unifi \ |
|
49 |
-p 8080:8080 -p 8443:8443 \ |
|
50 |
-v /srv/unifi/data:/usr/lib/unifi/data \ |
|
51 |
--user root \ |
|
52 |
jacekkow/unifi |
|
53 |
``` |
|
54 |
|
|
55 |
`/srv/unifi/data` directory will be automatically populated |
|
56 |
with default configuration if necessary. |
|
57 |
|
|
58 |
File ownership is recursively changed to `unifi:unifi` (`500:500`) |
|
59 |
on each start, provided the container is run as root |
|
60 |
(don't worry - unifi user will be used to start UniFi). |
|
61 |
|
|
62 |
### Captive portal and STUN |
|
63 |
|
|
64 |
Using captive portal requires forwarding of additional ports |
|
65 |
(8880 and 8843): |
|
66 |
|
|
67 |
```bash |
|
68 |
docker run -d --name=unifi \ |
|
69 |
-p 8080:8080 -p 8443:8443 \ |
|
70 |
-p 8880:8880 -p 8843:8843 \ |
|
71 |
jacekkow/unifi |
|
72 |
``` |
|
73 |
|
|
74 |
For STUN (NAT traversal) UDP port 3478 must be available: |
|
75 |
|
|
76 |
```bash |
|
77 |
docker run -d --name=unifi \ |
|
78 |
-p 8080:8080 -p 8443:8443 \ |
|
79 |
-p 3478:3478/udp \ |
|
80 |
jacekkow/unifi |
|
81 |
``` |
|
82 |
|
|
83 |
Note that STUN was not tested in container-based environment! |
|
84 |
This port is also not exposed in Dockerfile. |
|
85 |
|
|
86 |
### Configuration |
|
87 |
|
|
88 |
You can configure the instance by editing files |
|
89 |
in directory /usr/lib/unifi/data inside the container |
|
90 |
(or appropriate host dir if local storage is used). |
|
91 |
|
|
92 |
By default the JVM is started with option `-Xmx1024m`. |
|
93 |
You can override this default using `JAVA_OPTS` environment |
|
94 |
variable: |
|
95 |
|
|
96 |
```bash |
|
97 |
docker run -d --name=unifi \ |
|
98 |
-p 8080:8080 -p 8443:8443 \ |
|
99 |
-e "JAVA_OPTS=-Xmx512m" \ |
|
100 |
jacekkow/unifi |
|
101 |
``` |