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