RTMP/E-RTMP media server with REST API, SQLite, HLS, relay and optional HA clustering.
182
RTMP / E-RTMP media server with a bundled SQLite-backed HTTP API, built on librtmp2.
Source, full documentation and issue tracker: github.com/OpenRTMP/librtmp2-server · Web UI: librtmp2-server-panel
Alpha software. The HTTP/API/DB layer is usable, but the RTMP behaviour is still evolving. Test before relying on it in production.
docker run -d \
--name librtmp2-server \
-p 1935:1935 \
-p 8080:8080 \
-v librtmp2-data:/data \
openrtmp/librtmp2-server:latest
docker logs librtmp2-server # copy the generated API token
The server generates an API token on first start and prints it to stderr. To
pin the token instead, pass it as LRTMP2_API_TOKEN on the first start:
docker run -d \
--name librtmp2-server \
-p 1935:1935 -p 8080:8080 \
-e LRTMP2_API_TOKEN="$(openssl rand -hex 32)" \
-v librtmp2-data:/data \
openrtmp/librtmp2-server:latest
The token is stored in SQLite, so later changes to the environment variable
have no effect until the database is re-seeded (delete /data/server.db*).
latest, beta, alpha — moving channels0.6.9, v0.6.9 — pinned releases (both spellings are published)linux/amd64, linux/arm64, linux/riscv64Mirrors: ghcr.io/openrtmp/librtmp2-server and quay.io/openrtmp/librtmp2-server.
| Port | Protocol | Purpose |
|---|---|---|
| 1935 | RTMP | Publish / play (always on) |
| 8080 | HTTP | REST API, stats, HLS, health |
| 1936 | RTMPS | Only when LRTMP2_TLS_ENABLED=true |
| 1940 | TCP | Cluster control — trusted peers only |
| 1941 | TCP | Cluster media — trusted peers only |
| Path | Purpose |
|---|---|
/data | SQLite database (and recordings/HLS if enabled) |
The image runs as the unprivileged user openrtmp. Make a bind-mounted /data
writable for that user (e.g. chown 1000:1000 or an image-compatible UID).
Configuration is read from /etc/librtmp2-server/.env (seeded from
.env.example) and from process environment variables with the LRTMP2_
prefix, which take precedence:
| Variable | Default | Purpose |
|---|---|---|
LRTMP2_RTMP_BIND | 0.0.0.0:1935 | RTMP listener |
LRTMP2_HTTP_BIND | 0.0.0.0:8080 | HTTP API listener |
LRTMP2_DB | /data/server.db | SQLite path |
LRTMP2_API_TOKEN | generated | Fixed API token (first start only) |
LRTMP2_LOG_LEVEL | 2 | 0=error … 3=debug |
LRTMP2_TLS_ENABLED + LRTMP2_TLS_CERT_FILE / LRTMP2_TLS_KEY_FILE | false | Adds RTMPS on 1936 |
LRTMP2_HTTP_TRUSTED_PROXIES | empty | Proxies allowed to set X-Forwarded-For |
LRTMP2_CLUSTER_* | off | Optional HA cluster (ports 1940/1941) |
Media outputs are opt-in and documented in the repository:
LRTMP2_MEDIA_RECORDING_ENABLED)/hls/<stream_id>/ (LRTMP2_MEDIA_HLS_ENABLED)LRTMP2_MEDIA_PUSH_TARGETS)LRTMP2_MEDIA_EXEC_*)FFmpeg is included in the image, so HLS, push relay and transcoding work without extra packages. Recording and hooks do not depend on it.
Full variable reference:
.env.example
· media outputs
· clustering
services:
server:
image: openrtmp/librtmp2-server:latest
restart: unless-stopped
environment:
LRTMP2_HTTP_BIND: 0.0.0.0:8080
LRTMP2_RTMP_BIND: 0.0.0.0:1935
LRTMP2_API_TOKEN: ${LRTMP2_API_TOKEN:?set in .env}
volumes:
- server-data:/data
ports:
- "1935:1935"
- "8080:8080"
volumes:
server-data:
For the full server + web panel stack, use the panel's
compose.quickstart.yml.
GET http://localhost:8080/api/v1/healthMIT — see LICENSE.
Content type
Image
Digest
sha256:cf7a8c614…
Size
63.9 MB
Last updated
about 23 hours ago
docker pull openrtmp/librtmp2-server