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