|
1 | | -# SlimeVR Server + Web GUI (Docker) |
| 1 | +# SlimeVR Docker |
2 | 2 |
|
3 | | - |
4 | | - |
5 | | -[](https://github.com/madkoding/docker-slimevr-web-server/actions/workflows/docker-publish.yml) |
6 | | - |
| 3 | +Run [SlimeVR Server](https://github.com/SlimeVR/SlimeVR-Server) + Web GUI in Docker. |
7 | 4 |
|
8 | | -Run [SlimeVR Server](https://github.com/SlimeVR/SlimeVR-Server) and its Web GUI in Docker with a setup that works across Linux, macOS, and Windows, plus an optimized Linux hotplug mode for direct USB tracker usage. |
9 | | - |
10 | | -## Quick Start (Linux) |
11 | | - |
12 | | -1. Install Docker + Compose (`docker compose version` should work). |
13 | | -2. Run: |
| 5 | +## Quick Start |
14 | 6 |
|
15 | 7 | ```bash |
16 | | -./slimevrctl up |
17 | | -``` |
18 | | - |
19 | | -3. Open: |
20 | | - |
21 | | -```text |
22 | | -http://localhost:8080 |
| 8 | +docker compose up -d --build |
| 9 | +open http://localhost:8080 |
23 | 10 | ``` |
24 | 11 |
|
25 | 12 | Stop: |
26 | | - |
27 | 13 | ```bash |
28 | | -./slimevrctl down |
| 14 | +docker compose down |
29 | 15 | ``` |
30 | 16 |
|
31 | | -This repo defaults to Linux USB hotplug mode, so no extra `-f ...` flags are needed. |
32 | | - |
33 | | -Optional commands: |
34 | | - |
35 | | -```bash |
36 | | -./slimevrctl status |
37 | | -./slimevrctl logs |
38 | | -./slimevrctl restart |
39 | | -./slimevrctl doctor |
| 17 | +## What it does |
| 18 | + |
| 19 | +```mermaid |
| 20 | +sequenceDiagram |
| 21 | + participant User |
| 22 | + participant Nginx |
| 23 | + participant SlimeVR |
| 24 | + participant Tracker |
| 25 | +
|
| 26 | + Note over SlimeVR: Starts, downloads latest version<br/>from GitHub automatically |
| 27 | + SlimeVR->>Tracker: Detect trackers via USB/HID |
| 28 | + SlimeVR->>Nginx: Copy GUI to /gui_mount |
| 29 | + User->>Nginx: GET /:8080 |
| 30 | + Nginx-->>User: 302 → /?ip=<host_ip> |
| 31 | + User->>Nginx: GET /?ip=<host_ip> |
| 32 | + Nginx->>User: Serve SlimeVR Web GUI |
| 33 | + User->>SlimeVR: WebSocket connections |
| 34 | + Tracker->>SlimeVR: Tracking data (port 6969) |
40 | 35 | ``` |
41 | 36 |
|
42 | | -## Features |
43 | | - |
44 | | -- Auto-downloads `slimevr.jar` and `slimevr-gui-dist.tar.gz` from official releases |
45 | | -- Single `.env` configuration for version and Web GUI port |
46 | | -- Nginx-served Web GUI with automatic `?ip=` redirect |
47 | | -- Cross-platform default compose profile (Docker Desktop friendly) |
48 | | -- Linux override profile for stable USB/HID hotplug behavior |
49 | | - |
50 | | -## Project Structure |
51 | | - |
52 | | -```text |
53 | | -. |
54 | | -|- .env |
55 | | -|- docker-compose.yml |
56 | | -|- docker-compose.linux.yml |
57 | | -|- nginx/ |
58 | | -| |- Dockerfile |
59 | | -| |- entrypoint.sh |
60 | | -| \- templates/ |
61 | | -| \- default.conf.template |
62 | | -\- slimevr/ |
63 | | - \- Dockerfile |
64 | | -``` |
| 37 | +## Architecture |
65 | 38 |
|
66 | | -## Requirements |
| 39 | +| Container | Purpose | Network | |
| 40 | +|-----------|---------|---------| |
| 41 | +| `slimevr` | Java server + tracker comms | host | |
| 42 | +| `nginx` | Serves Web GUI | host | |
67 | 43 |
|
68 | | -- Docker Engine 24+ (or Docker Desktop) |
69 | | -- Docker Compose v2 (`docker compose`) |
| 44 | +- **slimevr**: Downloads latest SlimeVR from GitHub, copies GUI to volume |
| 45 | +- **nginx**: Serves GUI, auto-redirects with `?ip=` parameter for WebSocket connection |
70 | 46 |
|
71 | 47 | ## Configuration |
72 | 48 |
|
73 | | -Edit `.env`: |
| 49 | +Create `.env` if you need custom values (all optional): |
74 | 50 |
|
75 | 51 | ```env |
76 | | -SLIMEVR_VERSION=19.0.0-rc.1 |
77 | 52 | WEBGUI_PORT=8080 |
78 | | -COMPOSE_FILE=docker-compose.linux.yml |
79 | | -``` |
80 | | - |
81 | | -`COMPOSE_FILE` selects which compose file is used by default. |
82 | | - |
83 | | -> On Linux, keep this enabled for direct USB tracker access. |
84 | | -> On macOS/Windows, change it to `COMPOSE_FILE=docker-compose.yml`. |
85 | | -
|
86 | | -## Run |
87 | | - |
88 | | -### Option A: Cross-platform default (Linux/macOS/Windows) |
89 | | - |
90 | | -```bash |
91 | | -COMPOSE_FILE=docker-compose.yml docker compose up -d |
| 53 | +SLIMEVR_VERSION=latest |
92 | 54 | ``` |
93 | 55 |
|
94 | | -Or set it in `.env` and run: |
95 | | - |
96 | | -```bash |
97 | | -docker compose up -d |
98 | | -``` |
99 | | - |
100 | | -This mode uses explicit port mappings and is the recommended default for Docker Desktop users. |
101 | | - |
102 | | -### Option B: Linux USB hotplug mode (recommended for direct USB trackers) |
103 | | - |
104 | | -```bash |
105 | | -docker compose -f docker-compose.linux.yml up -d |
106 | | -``` |
107 | | - |
108 | | -This mode enables host networking and mounts `/dev` + `/run/udev` for resilient USB/HID reattach behavior. |
109 | | - |
110 | | -## Access the Web GUI |
111 | | - |
112 | | -Open: |
113 | | - |
114 | | -```text |
115 | | -http://<HOST_IP>:<WEBGUI_PORT>/ |
116 | | -``` |
117 | | - |
118 | | -The GUI auto-redirects to: |
119 | | - |
120 | | -```text |
121 | | -http://<HOST_IP>:<WEBGUI_PORT>/?ip=<HOST_IP> |
122 | | -``` |
123 | | - |
124 | | -## Ports |
125 | | - |
126 | | -| Service | Port(s) | Protocol | |
127 | | -|---|---|---| |
128 | | -| SlimeVR Trackers | 6969 | UDP | |
129 | | -| Web GUI | `WEBGUI_PORT` | TCP | |
130 | | -| WebSocket Bridge | 21110 | TCP | |
131 | | -| OSC Router | 9000, 9002 | TCP/UDP | |
132 | | -| VRC OSC | 9000, 9001 | TCP/UDP | |
133 | | -| VMC | 39539, 39540 | TCP/UDP | |
134 | | -| Legacy Discovery | 4768 | UDP | |
| 56 | +Without `.env`, defaults are used (port `8080`, latest version). |
135 | 57 |
|
136 | 58 | ## Volumes |
137 | 59 |
|
138 | | -- `slimevr-config`: persistent SlimeVR config (`vrconfig.yml`) |
139 | | -- `slimevr-gui`: GUI static assets shared between app and Nginx |
| 60 | +| Volume | Purpose | |
| 61 | +|--------|---------| |
| 62 | +| `slimevr-config` | Persists `vrconfig.yml` | |
| 63 | +| `slimevr-gui` | GUI assets (slimevr → nginx) | |
140 | 64 |
|
141 | | -## Troubleshooting |
| 65 | +## Ports |
142 | 66 |
|
143 | | -- `ERR_TOO_MANY_REDIRECTS`: ensure redirect is only applied when `?ip=` is missing. |
144 | | -- Nginx error `server directive is not allowed here`: do not replace `nginx.conf` with a `server {}` block; use `conf.d/default.conf`. |
145 | | -- Linux USB not detected: run with `docker-compose.linux.yml` (hotplug mode). |
146 | | -- Seeing `Welcome to nginx!` on `:8080`: rebuild/restart with `./slimevrctl restart` to apply the GUI root config. |
147 | | -- macOS/Windows USB passthrough: Docker Desktop does not expose raw USB devices to Linux containers like native Linux does. For direct USB trackers, use Linux (native/VM/WSL2 with USB/IP). |
148 | | -- Port already in use (`6969` or `21110`): stop conflicting processes or containers. |
| 67 | +| Port | Protocol | Purpose | |
| 68 | +|------|----------|---------| |
| 69 | +| 6969 | UDP | Tracker data | |
| 70 | +| 8080 | TCP | Web GUI | |
| 71 | +| 21110 | TCP | WebSocket VR Bridge | |
| 72 | +| 9000-9002 | TCP/UDP | OSC | |
| 73 | +| 39539-39540 | TCP/UDP | VMC | |
149 | 74 |
|
150 | | -Check conflicts: |
| 75 | +## Update |
151 | 76 |
|
152 | 77 | ```bash |
153 | | -sudo ss -ltnup | grep -E '(:6969|:21110)' |
| 78 | +docker compose up -d --build |
154 | 79 | ``` |
155 | 80 |
|
156 | | -## Update |
| 81 | +Always downloads latest unless you set `SLIMEVR_VERSION` in `.env`. |
157 | 82 |
|
158 | | -To update SlimeVR, set a new `SLIMEVR_VERSION` in `.env` and recreate: |
| 83 | +## Troubleshooting |
159 | 84 |
|
160 | 85 | ```bash |
161 | | -docker compose up -d --build |
162 | | -``` |
| 86 | +# Check status |
| 87 | +docker compose ps |
163 | 88 |
|
164 | | -For Linux hotplug mode: |
| 89 | +# View logs |
| 90 | +docker compose logs -f |
165 | 91 |
|
166 | | -```bash |
167 | | -docker compose -f docker-compose.linux.yml up -d --build |
| 92 | +# Full diagnostics |
| 93 | +./slimevrctl doctor |
168 | 94 | ``` |
169 | 95 |
|
170 | 96 | ## Credits |
171 | 97 |
|
172 | 98 | - [SlimeVR](https://slimevr.dev/) |
173 | | -- Web GUI assets from the official [SlimeVR releases](https://github.com/SlimeVR/SlimeVR-Server/releases) |
| 99 | +- GUI from official [SlimeVR releases](https://github.com/SlimeVR/SlimeVR-Server/releases) |
174 | 100 |
|
175 | 101 | ## License |
176 | 102 |
|
177 | | -MIT |
178 | | - |
179 | | -## Donations |
180 | | - |
181 | | -BTC: `bc1qrd3mexqu43qn0597d248725kdp3tr28252q64p` |
182 | | - |
183 | | -<!-- AUTO-UPDATE-DATE --> |
184 | | -**Last updated:** 2026-04-04 |
| 103 | +MIT |
0 commit comments