[Skip to content](https://github.com/andrewhack/stremio-libtorrent-server#start-of-content)

You signed in with another tab or window. [Reload](https://github.com/andrewhack/stremio-libtorrent-server) to refresh your session.You signed out in another tab or window. [Reload](https://github.com/andrewhack/stremio-libtorrent-server) to refresh your session.You switched accounts on another tab or window. [Reload](https://github.com/andrewhack/stremio-libtorrent-server) to refresh your session.Dismiss alert

{{ message }}

[andrewhack](https://github.com/andrewhack)/ **[stremio-libtorrent-server](https://github.com/andrewhack/stremio-libtorrent-server)** Public

- [Notifications](https://github.com/login?return_to=%2Fandrewhack%2Fstremio-libtorrent-server) You must be signed in to change notification settings
- [Fork\\
0](https://github.com/login?return_to=%2Fandrewhack%2Fstremio-libtorrent-server)
- [Star\\
3](https://github.com/login?return_to=%2Fandrewhack%2Fstremio-libtorrent-server)


main

[**1** Branch](https://github.com/andrewhack/stremio-libtorrent-server/branches) [**23** Tags](https://github.com/andrewhack/stremio-libtorrent-server/tags)

[Go to Branches page](https://github.com/andrewhack/stremio-libtorrent-server/branches)[Go to Tags page](https://github.com/andrewhack/stremio-libtorrent-server/tags)

Go to file

Code

Open more actions menu

## Folders and files

| Name | Name | Last commit message | Last commit date |
| --- | --- | --- | --- |
| ## Latest commit<br>[![andrewhack](https://avatars.githubusercontent.com/u/46722365?v=4&size=40)](https://github.com/andrewhack)[andrewhack](https://github.com/andrewhack/stremio-libtorrent-server/commits?author=andrewhack)<br>[docs: backlog spec — adaptive piece-picking (throughput vs continuity)](https://github.com/andrewhack/stremio-libtorrent-server/commit/a5e7441444499b0377c98f9d4d29d593c7a44d52)<br>Open commit details<br>3 hours agoJul 4, 2026<br>[a5e7441](https://github.com/andrewhack/stremio-libtorrent-server/commit/a5e7441444499b0377c98f9d4d29d593c7a44d52) · 3 hours agoJul 4, 2026<br>## History<br>[123 Commits](https://github.com/andrewhack/stremio-libtorrent-server/commits/main/) <br>Open commit details<br>[View commit history for this file.](https://github.com/andrewhack/stremio-libtorrent-server/commits/main/) 123 Commits |
| [docker](https://github.com/andrewhack/stremio-libtorrent-server/tree/main/docker "docker") | [docker](https://github.com/andrewhack/stremio-libtorrent-server/tree/main/docker "docker") | [Net: dual-stack BT listener + port-follows-env publish (0.2.21)](https://github.com/andrewhack/stremio-libtorrent-server/commit/1d340403b7275b313bf02a58df6a434d103573ed "Net: dual-stack BT listener + port-follows-env publish (0.2.21)  - engine: listen_interfaces now binds [::] as well as 0.0.0.0 so IPv6 peers can   reach the inbound listener (an IPv4-only host just drops that bind). - compose.yaml / compose.hub.yaml / docker/launch.sh: publish   STREMIOSRV_BT_LISTEN_PORT on BOTH sides (TCP+UDP) so relocating the port still   reaches inbound peers. docker/launch.sh previously mapped host:$BT_PORT ->   container:6881 (a mismatch that silently killed inbound on a non-default port). - README: note a changed BT port must be forwarded/published to a MATCHING port. - bump 0.2.20 -> 0.2.21.") | 6 hours agoJul 4, 2026 |
| [docs](https://github.com/andrewhack/stremio-libtorrent-server/tree/main/docs "docs") | [docs](https://github.com/andrewhack/stremio-libtorrent-server/tree/main/docs "docs") | [docs: backlog spec — adaptive piece-picking (throughput vs continuity)](https://github.com/andrewhack/stremio-libtorrent-server/commit/a5e7441444499b0377c98f9d4d29d593c7a44d52 "docs: backlog spec — adaptive piece-picking (throughput vs continuity)  Buffer-health control loop that widens the forward priority/deadline band when the buffer is deep (harvest throughput, ~3x the current narrow picker in the sim) and collapses it on a seek / shallow buffer (protect continuity + fast resume). Includes the reproducible simulation, libtorrent levers (evolution of focus_file/deadlines/boost_piece), watermarks, real-swarm validation plan, and a never-worse-than-today release guardrail. Env-flagged, off by default.") | 3 hours agoJul 4, 2026 |
| [scripts](https://github.com/andrewhack/stremio-libtorrent-server/tree/main/scripts "scripts") | [scripts](https://github.com/andrewhack/stremio-libtorrent-server/tree/main/scripts "scripts") | [feat: dependency monitoring — /health cert component + protocol drift…](https://github.com/andrewhack/stremio-libtorrent-server/commit/c5d5a2ee74e3e70049784cc048c5831880b6dee5 "feat: dependency monitoring — /health cert component + protocol drift detectors (v0.2.4)  Dependency 1 (TLS cert, incl. shared *.stremio.rocks wildcard): /health now reports a `cert` component (present only when a cert exists, so dev/test stays healthy) — degraded (503) within 14 days of expiry or if unreadable; `certDaysLeft` in the body. AHM polls /health → alert.  Dependency 2 (Stremio protocol drift): scripts/synthetic_playback.py (e2e CC-torrent stream + endpoint shape check, exit non-zero on break) and scripts/check_stremio_releases.py (GitHub release watch → re-test trigger). Wiring + cron in docs/monitoring.md. stdlib only.") | last weekJun 26, 2026 |
| [src/stremiosrv](https://github.com/andrewhack/stremio-libtorrent-server/tree/main/src/stremiosrv "This path skips through empty directories") | [src/stremiosrv](https://github.com/andrewhack/stremio-libtorrent-server/tree/main/src/stremiosrv "This path skips through empty directories") | [Trackers: add the 6 stock-server defaults we lacked (parity)](https://github.com/andrewhack/stremio-libtorrent-server/commit/3fda9cc6de60e4464351592bdcc4c3c44375e5ac "Trackers: add the 6 stock-server defaults we lacked (parity)  bt.rer.lol, open.dstud.io, run.publictracker.xyz, retracker01-msk-virt.corbina.net, tracker.therarbg.to, tracker1.myporn.club — the entries in stock server.js's default set that ours lacked. Cheap parity per the crosscheck; ships in the next release (opt-in live ngosang list already covers auto-freshness).") | 3 hours agoJul 4, 2026 |
| [tests](https://github.com/andrewhack/stremio-libtorrent-server/tree/main/tests "tests") | [tests](https://github.com/andrewhack/stremio-libtorrent-server/tree/main/tests "tests") | [Trackers: fix add\_trackers for lt 2.0 dict-form trackers()](https://github.com/andrewhack/stremio-libtorrent-server/commit/13f0ba3f6a75ed98fe869d12dbe3daf3fbb370f7 "Trackers: fix add_trackers for lt 2.0 dict-form trackers()  torrent_handle.trackers() returns dicts on libtorrent 2.0 (verified 2.0.11), not announce_entry objects — read t[\"url\"] (defensive to the object form too). The fake handle in the test now mirrors the real dict API.") | 8 hours agoJul 4, 2026 |
| [.dockerignore](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/.dockerignore ".dockerignore") | [.dockerignore](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/.dockerignore ".dockerignore") | [feat(stage3): Dockerfile (FROM stremio-docker-dual + uv/py312 + libto…](https://github.com/andrewhack/stremio-libtorrent-server/commit/f80e5c4082299235f1675a7591f3c5d386a34998 "feat(stage3): Dockerfile (FROM stremio-docker-dual + uv/py312 + libtorrent + server) — Task 3") | last monthJun 5, 2026 |
| [.gitattributes](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/.gitattributes ".gitattributes") | [.gitattributes](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/.gitattributes ".gitattributes") | [feat(allinone): nginx serves web player + proxies API (single origin,…](https://github.com/andrewhack/stremio-libtorrent-server/commit/df3f76a1c4be013e219c82be039282069d1c6e31 "feat(allinone): nginx serves web player + proxies API (single origin, http+https)") | last weekJun 24, 2026 |
| [.gitignore](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/.gitignore ".gitignore") | [.gitignore](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/.gitignore ".gitignore") | [Repo: drop internal SDD ledger + dead leaking test fixture from VCS](https://github.com/andrewhack/stremio-libtorrent-server/commit/3f1d690a7d9eeb785cd8762dde618b6795068a82 "Repo: drop internal SDD ledger + dead leaking test fixture from VCS  .superpowers/sdd/ is local subagent-driven-development scaffolding (and named an internal host/IP) — untrack it and gitignore so it stays local-only. Delete tests/fixtures/opensubhash-urls.txt: it was referenced nowhere and embedded an internal hostname + a content infohash, neither of which belongs in a public, content-neutral repo.") | 4 days agoJun 30, 2026 |
| [.python-version](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/.python-version ".python-version") | [.python-version](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/.python-version ".python-version") | [feat: Stage 1 skeleton — FastAPI app factory, Pydantic config, /healt…](https://github.com/andrewhack/stremio-libtorrent-server/commit/cd127e54158af96cc127d277caf8dda71aeb35b3 "feat: Stage 1 skeleton — FastAPI app factory, Pydantic config, /health (ITCOM); tests green  uv/FastAPI project; Settings (env STREMIOSRV_*), /health 200 contract, create_app factory. ruff clean, 3 tests pass. Endpoint bodies (settings/playback/hlsv2) gated on Stage 0 fixtures.") | last monthJun 4, 2026 |
| [Dockerfile](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/Dockerfile "Dockerfile") | [Dockerfile](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/Dockerfile "Dockerfile") | [build: base from Docker Hub (androshack/stremio-docker-dual); clean r…](https://github.com/andrewhack/stremio-libtorrent-server/commit/350606f37fde8018dabd68705327a73a1d09c81e "build: base from Docker Hub (androshack/stremio-docker-dual); clean rebuild (v0.2.3)  The base image was pruned off the build host and only existed locally, so 0.2.1/0.2.2 shipped as layered stopgaps. The base is now rebuilt from the companion fork (Dockerfile.nvidia, fixed for current stremio-web: node:22 + pnpm@11) and published to Docker Hub. Point FROM at androshack/stremio-docker-dual:latest so a clean from-scratch build works on any host. This bumps the bundled web client to the pinned stremio-web release. No stremiosrv code change vs 0.2.2.") | last weekJun 25, 2026 |
| [QUICKSTART.md](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/QUICKSTART.md "QUICKSTART.md") | [QUICKSTART.md](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/QUICKSTART.md "QUICKSTART.md") | [docs: state the image is linux/amd64 (x86-64) only](https://github.com/andrewhack/stremio-libtorrent-server/commit/cdd2648d2e58d2426f617fb660ea6ae85796edca "docs: state the image is linux/amd64 (x86-64) only  The prebuilt image and its base are single-arch linux/amd64; ARM hosts (Pi, ARM TV boxes, Apple Silicon) must build from source. Note it in the Quick Start.") | last weekJun 24, 2026 |
| [README.md](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/README.md "README.md") | [README.md](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/README.md "README.md") | [Net: dual-stack BT listener + port-follows-env publish (0.2.21)](https://github.com/andrewhack/stremio-libtorrent-server/commit/1d340403b7275b313bf02a58df6a434d103573ed "Net: dual-stack BT listener + port-follows-env publish (0.2.21)  - engine: listen_interfaces now binds [::] as well as 0.0.0.0 so IPv6 peers can   reach the inbound listener (an IPv4-only host just drops that bind). - compose.yaml / compose.hub.yaml / docker/launch.sh: publish   STREMIOSRV_BT_LISTEN_PORT on BOTH sides (TCP+UDP) so relocating the port still   reaches inbound peers. docker/launch.sh previously mapped host:$BT_PORT ->   container:6881 (a mismatch that silently killed inbound on a non-default port). - README: note a changed BT port must be forwarded/published to a MATCHING port. - bump 0.2.20 -> 0.2.21.") | 6 hours agoJul 4, 2026 |
| [compose.gpu.yaml](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/compose.gpu.yaml "compose.gpu.yaml") | [compose.gpu.yaml](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/compose.gpu.yaml "compose.gpu.yaml") | [feat(deploy): GPU-optional startup — durable launch.sh (auto-detect/d…](https://github.com/andrewhack/stremio-libtorrent-server/commit/3fd56c7d5a2d7a428ecfc098dabe9ecc68ea65d4 "feat(deploy): GPU-optional startup — durable launch.sh (auto-detect/degrade) + compose GPU overlay") | last weekJun 24, 2026 |
| [compose.hub.yaml](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/compose.hub.yaml "compose.hub.yaml") | [compose.hub.yaml](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/compose.hub.yaml "compose.hub.yaml") | [Net: dual-stack BT listener + port-follows-env publish (0.2.21)](https://github.com/andrewhack/stremio-libtorrent-server/commit/1d340403b7275b313bf02a58df6a434d103573ed "Net: dual-stack BT listener + port-follows-env publish (0.2.21)  - engine: listen_interfaces now binds [::] as well as 0.0.0.0 so IPv6 peers can   reach the inbound listener (an IPv4-only host just drops that bind). - compose.yaml / compose.hub.yaml / docker/launch.sh: publish   STREMIOSRV_BT_LISTEN_PORT on BOTH sides (TCP+UDP) so relocating the port still   reaches inbound peers. docker/launch.sh previously mapped host:$BT_PORT ->   container:6881 (a mismatch that silently killed inbound on a non-default port). - README: note a changed BT port must be forwarded/published to a MATCHING port. - bump 0.2.20 -> 0.2.21.") | 6 hours agoJul 4, 2026 |
| [compose.vpn.yaml](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/compose.vpn.yaml "compose.vpn.yaml") | [compose.vpn.yaml](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/compose.vpn.yaml "compose.vpn.yaml") | [compose.vpn: bind gluetun control API to localhost](https://github.com/andrewhack/stremio-libtorrent-server/commit/fed8ad54aa1c29e6297d0a9bea3dc58f47990e47 "compose.vpn: bind gluetun control API to localhost") | 4 days agoJun 30, 2026 |
| [compose.yaml](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/compose.yaml "compose.yaml") | [compose.yaml](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/compose.yaml "compose.yaml") | [Net: dual-stack BT listener + port-follows-env publish (0.2.21)](https://github.com/andrewhack/stremio-libtorrent-server/commit/1d340403b7275b313bf02a58df6a434d103573ed "Net: dual-stack BT listener + port-follows-env publish (0.2.21)  - engine: listen_interfaces now binds [::] as well as 0.0.0.0 so IPv6 peers can   reach the inbound listener (an IPv4-only host just drops that bind). - compose.yaml / compose.hub.yaml / docker/launch.sh: publish   STREMIOSRV_BT_LISTEN_PORT on BOTH sides (TCP+UDP) so relocating the port still   reaches inbound peers. docker/launch.sh previously mapped host:$BT_PORT ->   container:6881 (a mismatch that silently killed inbound on a non-default port). - README: note a changed BT port must be forwarded/published to a MATCHING port. - bump 0.2.20 -> 0.2.21.") | 6 hours agoJul 4, 2026 |
| [pyproject.toml](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/pyproject.toml "pyproject.toml") | [pyproject.toml](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/pyproject.toml "pyproject.toml") | [Net: dual-stack BT listener + port-follows-env publish (0.2.21)](https://github.com/andrewhack/stremio-libtorrent-server/commit/1d340403b7275b313bf02a58df6a434d103573ed "Net: dual-stack BT listener + port-follows-env publish (0.2.21)  - engine: listen_interfaces now binds [::] as well as 0.0.0.0 so IPv6 peers can   reach the inbound listener (an IPv4-only host just drops that bind). - compose.yaml / compose.hub.yaml / docker/launch.sh: publish   STREMIOSRV_BT_LISTEN_PORT on BOTH sides (TCP+UDP) so relocating the port still   reaches inbound peers. docker/launch.sh previously mapped host:$BT_PORT ->   container:6881 (a mismatch that silently killed inbound on a non-default port). - README: note a changed BT port must be forwarded/published to a MATCHING port. - bump 0.2.20 -> 0.2.21.") | 6 hours agoJul 4, 2026 |
| [uv.lock](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/uv.lock "uv.lock") | [uv.lock](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/uv.lock "uv.lock") | [Net: dual-stack BT listener + port-follows-env publish (0.2.21)](https://github.com/andrewhack/stremio-libtorrent-server/commit/1d340403b7275b313bf02a58df6a434d103573ed "Net: dual-stack BT listener + port-follows-env publish (0.2.21)  - engine: listen_interfaces now binds [::] as well as 0.0.0.0 so IPv6 peers can   reach the inbound listener (an IPv4-only host just drops that bind). - compose.yaml / compose.hub.yaml / docker/launch.sh: publish   STREMIOSRV_BT_LISTEN_PORT on BOTH sides (TCP+UDP) so relocating the port still   reaches inbound peers. docker/launch.sh previously mapped host:$BT_PORT ->   container:6881 (a mismatch that silently killed inbound on a non-default port). - README: note a changed BT port must be forwarded/published to a MATCHING port. - bump 0.2.20 -> 0.2.21.") | 6 hours agoJul 4, 2026 |
| View all files |

## Repository files navigation

# 🎬 stremio-libtorrent-server

[Permalink: 🎬 stremio-libtorrent-server](https://github.com/andrewhack/stremio-libtorrent-server#-stremio-libtorrent-server)

### Your own Stremio streaming server — open, fast, and _yours_. One command to run it. 🚀

[Permalink: Your own Stremio streaming server — open, fast, and yours. One command to run it. 🚀](https://github.com/andrewhack/stremio-libtorrent-server#your-own-stremio-streaming-server--open-fast-and-yours-one-command-to-run-it-)

Self-host the **complete Stremio experience** — the **web player** _and_ a powerful, open
**BitTorrent streaming engine** — in a single container on your own hardware. It's a **full torrent**
**client**, not just a streamer: it downloads whole files and can **pin favorites to keep & seed**.
Point any Stremio client (browser, Android TV, Tizen, webOS, desktop) at it and press play.

No subscription. No tracking. No black box. **100% free and open — our gift to the community.** 💛

> **Sharing back with the community. 💛** This is a real torrent client, so a title you started keeps
> **downloading to completion and seeding (uploading) back to other Stremio users** even after you
> close the player — that's how you help keep the swarm fast and healthy **for everyone**. Unpinned
> titles are cleared automatically; **pin** the ones you'd like to keep sharing. Prefer to limit it?
> Cap up/down bandwidth in the settings any time — your box, your call.

[![Docker Hub](https://camo.githubusercontent.com/e829672ebd6254ac20451a013dcf82001f7ffbf1f3af58939f5c824ec19767ec/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f636b65722532304875622d616e64726f736861636b253246737472656d696f2d2d6c6962746f7272656e742d2d7365727665722d3234393645443f6c6f676f3d646f636b6572266c6f676f436f6c6f723d7768697465)](https://hub.docker.com/r/androshack/stremio-libtorrent-server)[![License: MIT](https://camo.githubusercontent.com/7ce445fb52c8e3a953faefef1f14242bf5f2d9dcf4c4ef5bc05c1d0edc68a28d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d3344413633392e737667)](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/LICENSE)

* * *

## ✨ Why you'll love it

[Permalink: ✨ Why you'll love it](https://github.com/andrewhack/stremio-libtorrent-server#-why-youll-love-it)

- **🚀 Install in one command.**`docker run …` — that's the whole setup. No building, no config files.
- **📺 Just works on TVs.** Automatic **trusted HTTPS** (a real Let's Encrypt cert) that smart TVs actually accept — zero certificate headaches.
- **⚡ Faster, more reliable.** Unlike the closed stock server, this one **accepts inbound peers** and fetches **playhead-first**, so streams start quicker and hold up on thin swarms.
- **🎛️ Truly yours to control.** Real dials for cache, buffering, peers, and transcode — tune deeply, or never touch a thing.
- **🖥️ Hardware transcode, optional.** Intel **VAAPI** / NVIDIA **NVENC** when you expose a GPU to the container (opt-in — see [Advanced](https://github.com/andrewhack/stremio-libtorrent-server#-advanced--tune-it-your-way)), with graceful CPU fallback — and a missing GPU never stops it from starting.
- **🧩 Your addons, your choice.** It's **neutral infrastructure**: it streams whatever a Stremio addon hands it. It bundles no content and is not a source.
- **🔓 Open source.** Read it, change it, trust it.

* * *

## 🚀 Quick Start — anyone can do this

[Permalink: 🚀 Quick Start — anyone can do this](https://github.com/andrewhack/stremio-libtorrent-server#-quick-start--anyone-can-do-this)

> **Architecture:** the published image is **`linux/amd64` (x86-64) only**. It runs on any normal
> PC/server/NAS. ARM hosts (Raspberry Pi, most ARM TV boxes, Apple Silicon) aren't supported by the
> prebuilt image — build from source on those.

**1.** Install [Docker](https://docs.docker.com/get-docker/).
**2.** Copy **one** command below — whichever matches your hardware — and replace `YOUR_SERVER_IP`
with your machine's LAN IP (e.g. `192.168.1.50`). **Not sure which? Use the first one — it works on**
**everything.** _(The GPU options only speed up the occasional video that needs converting; they're not required.)_

**💻 No GPU — works everywhere (start here)**

```
docker run -d --name stremio --restart unless-stopped \
  -e IPADDRESS=YOUR_SERVER_IP \
  -p 8080:8080 -p 12470:12470 -p 6881:6881/tcp -p 6881:6881/udp \
  -v stremio-data:/root/.stremio-server \
  androshack/stremio-libtorrent-server
```

**🟦 Intel / AMD GPU (VAAPI)** — same, plus `--device /dev/dri`

```
docker run -d --name stremio --restart unless-stopped \
  -e IPADDRESS=YOUR_SERVER_IP \
  --device /dev/dri:/dev/dri \
  -p 8080:8080 -p 12470:12470 -p 6881:6881/tcp -p 6881:6881/udp \
  -v stremio-data:/root/.stremio-server \
  androshack/stremio-libtorrent-server
```

**🟩 NVIDIA GPU (NVENC)** — plus `--gpus all` (first install the [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) on the host)

```
docker run -d --name stremio --restart unless-stopped \
  -e IPADDRESS=YOUR_SERVER_IP \
  --gpus all \
  -p 8080:8080 -p 12470:12470 -p 6881:6881/tcp -p 6881:6881/udp \
  -v stremio-data:/root/.stremio-server \
  androshack/stremio-libtorrent-server
```

**🟦🟩 Both Intel + NVIDIA** — both flags

```
docker run -d --name stremio --restart unless-stopped \
  -e IPADDRESS=YOUR_SERVER_IP \
  --gpus all --device /dev/dri:/dev/dri \
  -p 8080:8080 -p 12470:12470 -p 6881:6881/tcp -p 6881:6881/udp \
  -v stremio-data:/root/.stremio-server \
  androshack/stremio-libtorrent-server
```

**3.** Open it:

- 🌐 **In a browser (same network):**`http://YOUR_SERVER_IP:8080` — _browser playback covers MP4/H.264; for MKV/HEVC content use the **desktop or TV** apps (browsers can't decode those)._
- 🔒 **Trusted HTTPS (and TVs):** run `docker logs stremio` and use the printed URL — **it looks like**`https://192-168-1-50.519b6502d940.stremio.rocks:12470` _(replace `192-168-1-50` with your internal IP, dots written as dashes)_.

Sign into Stremio, add your addons, press play. 🍿
_(Prefer a file? Grab [`compose.hub.yaml`](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/compose.hub.yaml) → `IPADDRESS=YOUR_SERVER_IP docker compose -f compose.hub.yaml up -d`.)_

* * *

## 🧰 Minimum hardware

[Permalink: 🧰 Minimum hardware](https://github.com/andrewhack/stremio-libtorrent-server#-minimum-hardware)

It's light — direct play (most content) barely touches the CPU; the GPU only matters for transcoding.

| Resource | Minimum | Recommended | Notes |
| --- | --- | --- | --- |
| **CPU** | 2 cores, x86-64 | 4+ cores | `amd64` only. Transcoding (clients that can't direct-play) is the only heavy load. |
| **RAM** | 1 GB | 2 GB+ | Engine + buffers + nginx; transcoding adds ~0.5–1 GB. |
| **Disk** | ~3 GB + cache | SSD, cache ≥ largest file | Image ~1.5 GB; download cache defaults to **18 GiB** (tune with `STREMIOSRV_CACHE_SIZE`). Keep free space ≥ your biggest single file. |
| **GPU** | none | Intel VAAPI / NVIDIA NVENC | Optional — only speeds up transcoding; a missing/broken GPU never blocks startup. |
| **Network** | any | wired + `6881` forwarded | Wired beats Wi-Fi for 4K; forward port `6881` for the full swarm (see below). |

* * *

## 📺 On your TV

[Permalink: 📺 On your TV](https://github.com/andrewhack/stremio-libtorrent-server#-on-your-tv)

Smart TVs insist on a **trusted** HTTPS connection — a self-signed cert won't do. Set `IPADDRESS`
and this server fetches a real Let's Encrypt certificate for you automatically (via Stremio's
`*.stremio.rocks` magic DNS, which maps that long URL back to your server's IP — even on your LAN).
In the TV's Stremio app, set the **Streaming Server URL** to the `…stremio.rocks:12470` address shown
by `docker logs stremio`.

> **Note — the Stremio _desktop_ app (v6).** The desktop shell launches its own bundled streaming
> server and re‑points itself at `127.0.0.1:11470` on **every** start — it injects a
> `?streamingServerUrl=` parameter that overwrites the saved URL — so simply setting the Streaming
> Server URL doesn't stick. (This is the shell's behaviour, not a `serverVersion` gate — that part is
> already correct.) Two ways to use **this** box from the desktop:
>
> - **Best — launch with a flag** _(native player, full MKV/HEVC):_ start Stremio with
>   `--development --webui-url=<your …stremio.rocks:12470 URL>` (the trusted URL from
>   `docker logs stremio`). A non‑default `--webui-url` skips the localhost injection and loads the
>   player from this box; `--development` also skips the unused bundled server. Add the flag to your
>   shortcut and launch from it each time. It **must** be the **trusted**`:12470` URL — a self‑signed
>   cert is refused. After signing into your account, relaunch via the shortcut (login resets the URL).
> - **Zero‑install** _(MP4/H.264 only):_ open the `:12470` URL in a browser, or install it as an app.
>
> **TVs are unaffected** — Samsung/LG accept the `:12470` URL directly and it sticks.

* * *

## 🌍 Want the _full_ swarm? Forward one port.

[Permalink: 🌍 Want the full swarm? Forward one port.](https://github.com/andrewhack/stremio-libtorrent-server#-want-the-full-swarm-forward-one-port)

A lot of BitTorrent's speed comes from peers reaching **you** — and home routers block that by
default. For maximum peers and throughput, **forward port `6881` (TCP _and_ UDP)** on your router to
your server. It works fine without forwarding — you'll just reach fewer peers on sparse torrents.
(Unlike the stock server, this one actually _listens_ for inbound peers, so the forward genuinely pays off.)

* * *

## 🔐 Run behind a VPN

[Permalink: 🔐 Run behind a VPN](https://github.com/andrewhack/stremio-libtorrent-server#-run-behind-a-vpn)

Tunnel only the streaming server's BitTorrent traffic through a VPN (kill-switch + optional
port-forwarding) using [gluetun](https://github.com/qdm12/gluetun), while your LAN keeps reaching the
player/admin directly:

```
WIREGUARD_PRIVATE_KEY=... WIREGUARD_ADDRESSES=10.2.0.2/32 IPADDRESS=<your-LAN-IP> \
  docker compose -f compose.vpn.yaml up -d
```

Notes:

- The VPN's **kill-switch** is on by default — if the tunnel drops, torrent traffic stops (no IP leak).
- **Inbound peers / seeding** need a provider that supports **port-forwarding** (e.g. ProtonVPN, PIA,
AirVPN). Without it you still stream, but with outbound-only connectivity.
- Set `FIREWALL_OUTBOUND_SUBNETS` to your LAN CIDR(s) so the player and admin stay reachable.

* * *

## 🔧 Advanced — tune it your way

[Permalink: 🔧 Advanced — tune it your way](https://github.com/andrewhack/stremio-libtorrent-server#-advanced--tune-it-your-way)

Everything is a plain `-e NAME=value` environment variable:

| Setting | Default | What it does |
| --- | --- | --- |
| `IPADDRESS` | _(unset)_ | Your server IP → auto **trusted TV cert** via `*.stremio.rocks`. Unset → self-signed. |
| `SERVER_URL` | auto | URL the web player targets. Set for a custom domain. |
| `STREMIOSRV_CACHE_SIZE` | `19327352832` (18 GiB) | Download-cache budget in bytes (LRU-evicted). Keep it **above your largest file**. |
| `STREMIOSRV_READAHEAD_BYTES` | `134217728` (128 MiB) | Playhead buffer — bigger absorbs more swarm jitter (fewer rebuffers). |
| `STREMIOSRV_BT_LISTEN_PORT` | `6881` | BitTorrent peer port (TCP **and** UDP, IPv4 **and** IPv6). The one to forward. **If you change it, publish the _same_ port** — the compose files and `docker/launch.sh` follow this var automatically; a hand-rolled `docker run` must use matching `-p <port>:<port>/tcp -p <port>:<port>/udp` (mapping to a _different_ container port silently kills inbound peering). |
| `STREMIOSRV_BT_MAX_CONNECTIONS` | `400` | Max peer connections. |
| `STREMIOSRV_DOWNLOAD_RATE_LIMIT` | `0` | Cap download throughput in **bytes/sec** (`0` = unlimited). E.g. `12500000` ≈ 100 Mbit/s. |
| `STREMIOSRV_UPLOAD_RATE_LIMIT` | `0` | Cap upload throughput in **bytes/sec** (`0` = unlimited). Handy so seeding doesn't saturate your line. |
| `STREMIOSRV_IDLE_DOWNLOAD_RATE_LIMIT` | `1048576` (1 MiB/s) | **Cross-torrent playback priority.** While _anything_ is being streamed, every _other_ (idle) torrent is capped to this many bytes/sec so the torrent you're watching wins the bandwidth. `0` disables it (idle torrents compete freely). |
| `STREMIOSRV_MAX_STREAMS` | `0` | Max **concurrent playbacks** (distinct torrents being streamed). A new play past the cap gets `503`. `0` = unlimited. |
| `STREMIOSRV_SEED_ON_COMPLETE` | `true` | Keep seeding after a torrent finishes (full torrent-client behaviour). `false` = **stop seeding + drop peers** the moment it completes. Pinned items always keep seeding. |
| `STREMIOSRV_MAX_SEED_MINUTES` | `0` | Stop seeding this many **minutes after completion** (`0` = seed forever). Applies on top of `SEED_ON_COMPLETE`. |
| `STREMIOSRV_EXTRA_TRACKERS` | _(empty)_ | Extra trackers appended to **every** torrent (on top of the built-in defaults). Comma/space/newline-separated `udp://`/`http(s)://`/`ws(s)://` URLs. |
| `STREMIOSRV_TRACKER_LIST_URL` | _(empty)_ | Optional URL of a community tracker list (e.g. the raw [ngosang/trackerslist](https://github.com/ngosang/trackerslist)`trackers_best.txt`). Fetched in a **background thread** to keep the list current — best-effort, **never blocks startup or playback**; offline falls back to the last cached list, then the built-in defaults. Empty = fully static. |
| `STREMIOSRV_TRACKER_LIST_REFRESH_HOURS` | `24` | How often the background tracker-list source re-fetches (only when a URL is set). |
| `DOMAIN` | `localhost` | CN for the self-signed cert (when not using `IPADDRESS`). |
| `CERT_FILE` | `certificates.pem` | Bring-your-own cert (full-chain + key) filename in the data volume. |

**Trackers & peer discovery.** Every torrent is announced to a curated set of public trackers (baked-in
defaults) **plus DHT, LSD and PEX** — so a bare infohash finds peers even when the magnet carries no
tracker, exactly like the stock Stremio server. Extend it two ways: add your own with
`STREMIOSRV_EXTRA_TRACKERS`, or point `STREMIOSRV_TRACKER_LIST_URL` at a maintained list (e.g.
[ngosang/trackerslist](https://github.com/ngosang/trackerslist)) to keep the set current — that fetch
runs in a background thread and **never blocks startup or playback** (offline → last cached list → the
built-in defaults). The bigger peering win, though, is **inbound connectivity**: forward
`STREMIOSRV_BT_LISTEN_PORT` (6881) so you reach the whole swarm, not just what trackers hand back.

**GPU transcode** (only for clients that can't direct-play). Docker does **not** expose the host GPU to a
container by default, so the one-command install above is **CPU-only**. The server _auto-detects_ a GPU,
but only one you've handed in — so opt in at launch:

- **Intel/AMD VAAPI** → add `--device /dev/dri:/dev/dri`
- **NVIDIA NVENC** → add `--gpus all` (requires the [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) on the host)
- **Or just use [`docker/launch.sh`](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/docker/launch.sh)** — it probes the host and adds the right flags for you,
degrading gracefully (a broken or absent driver never blocks startup). Full NVIDIA driver + **Proxmox**
**passthrough** setup: [NVIDIA-GPU.md](https://github.com/andrewhack/stremio-docker/blob/main/NVIDIA-GPU.md) (companion fork).

**Your own domain instead of stremio.rocks:** put a full-chain+key PEM as `certificates.pem` in the
data volume, set `-e SERVER_URL=https://yourdomain:12470`, and leave `IPADDRESS` unset.

**Tailscale (zero port-forwarding, trusted HTTPS):** if you reach the server over a [Tailscale](https://tailscale.com/)
tailnet, you can skip both port-forwarding _and_ the `*.stremio.rocks` dependency. Provision a cert for the
node's MagicDNS name (`tailscale cert <node>.<tailnet>.ts.net`), concatenate the cert + key into one PEM,
drop it in the data volume as `certificates.pem`, and set `-e SERVER_URL=https://<node>.<tailnet>.ts.net:12470`
with `IPADDRESS` unset. Point your devices' Stremio **Streaming Server URL** at that tailnet address — works
across your own devices and anyone you share the tailnet with, with a browser/TV-trusted cert.

**Ports:**`8080` web+API (HTTP/LAN) · `12470` web+API (HTTPS) · `11470` direct API · `6881` BitTorrent.

📖 Full ops guide: [`docs/DEVOPS.md`](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/docs/DEVOPS.md) · TLS deep-dive: [`docs/cert-guide.md`](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/docs/cert-guide.md).

* * *

## 🧠 Why it exists

[Permalink: 🧠 Why it exists](https://github.com/andrewhack/stremio-libtorrent-server#-why-it-exists)

The stock Stremio streaming server is closed-source and, in practice:

- **outbound-only** — it never listens for inbound peers, so you only reach the connectable half of a swarm;
- it **hides the torrent levers** — no real control over piece picking, connectivity, or cache.

This opens it up: **inbound connectivity + playhead-first piece picking** for faster starts and better
reliability on sparse swarms, **plus** hardware transcode for clients that can't direct-play — all in
an image you run yourself. It is **content-neutral infrastructure**: it streams whatever infohash a
Stremio _addon_ hands it, and bundles or surfaces nothing.

## 🏗️ Under the hood

[Permalink: 🏗️ Under the hood](https://github.com/andrewhack/stremio-libtorrent-server#%EF%B8%8F-under-the-hood)

One image, two source repos. The runtime image is built **`FROM`** a GPU/ffmpeg base (the companion
fork) and layers the open server on top:

```
┌─────────────── stremio-docker-dual  (companion fork, MIT) ──────────────┐
│ jellyfin-ffmpeg (NVENC/VAAPI) · nginx · bundled Stremio web player        │
└───────────────────────────────▲──────────────────────────────────────────┘
                                 │ FROM
┌─────────────── stremio-libtorrent-server  (this repo) ──────────────────┐
│ FastAPI + libtorrent engine · nginx serves web player + proxies the API   │
│ → one container: web player + open engine on a single origin              │
└────────────────────────────────────────────────────────────────────────────┘
```

Companion fork: **[andrewhack/stremio-docker](https://github.com/andrewhack/stremio-docker)**
(builds the `stremio-docker-dual` image; see its [`NVIDIA-GPU.md`](https://github.com/andrewhack/stremio-docker/blob/main/NVIDIA-GPU.md) for GPU/Proxmox setup).

Modules: `api/` (Stremio HTTP API) · `torrent/` (libtorrent + piece-picker) · `stream/` (Range file
server) · `transcode/` (ffmpeg NVENC/VAAPI → HLS) · `config.py` · `health.py`. Protocol reference:
[`docs/protocol-map.md`](https://github.com/andrewhack/stremio-libtorrent-server/blob/main/docs/protocol-map.md).

## ✅ Status

[Permalink: ✅ Status](https://github.com/andrewhack/stremio-libtorrent-server#-status)

All stages shipped and verified on hardware:

| Stage | Scope | State |
| --- | --- | --- |
| 0–1 | Protocol map · FastAPI skeleton · `/health` | ✅ |
| 2 | Torrent core + direct play (inbound peers, head & holes, Range serving, stats) | ✅ |
| 3 | Transcode / HLS (`hlsv2`, NVENC/VAAPI) | ✅ |
| 4 | Subtitles · `opensubHash` · casting | ✅ |
| 5 | Productionise — compose, DEVOPS, healthcheck, AHM | ✅ |
| 6 | All-in-one (web player + engine) · TV-trusted SSL · GPU-optional · Docker Hub | ✅ |

## 🛠️ Development

[Permalink: 🛠️ Development](https://github.com/andrewhack/stremio-libtorrent-server#%EF%B8%8F-development)

```
uv sync
uv run pytest -q          # unit tests
uv run ruff check .       # lint
uv run uvicorn stremiosrv.app:create_app --factory --host 0.0.0.0 --port 11470
```

## 🔐 Appendix — how the TV HTTPS URL works (`*.stremio.rocks`)

[Permalink: 🔐 Appendix — how the TV HTTPS URL works (*.stremio.rocks)](https://github.com/andrewhack/stremio-libtorrent-server#-appendix--how-the-tv-https-url-works-stremiorocks)

_Skip this unless you're curious or customizing certs — the Quick Start needs none of it._

When you set `IPADDRESS`, the container prints a TV-ready HTTPS URL like:

```
https://192-168-1-50.519b6502d940.stremio.rocks:12470
        └────┬─────┘ └────┬─────┘ └─────┬─────┘ └─┬─┘
          your IP,     shared ID     Stremio's    HTTPS
          dashed       (see below)   free DNS     port
```

- **`192-168-1-50`** — your server's IP with dots turned into dashes.
- **`…stremio.rocks`** — a free service Stremio runs that (a) resolves `<dashed-ip>.…stremio.rocks`
back to that IP (even a LAN IP — no DNS setup by you), and (b) carries a **trusted Let's Encrypt**
**wildcard cert**, so TVs/browsers accept the HTTPS connection with no warning.
- **`:12470`** — the container's HTTPS port.

A TV opening it → resolves to your server's IP → connects on `12470` → sees a trusted cert → connects.
The name resolves to your **internal** IP, so the TV must be on the **same network** (normal home
setup). For **remote** access, use your **public** IP in the URL and forward port `12470`.

### About `519b6502d940` — a shared, third-party dependency

[Permalink: About 519b6502d940 — a shared, third-party dependency](https://github.com/andrewhack/stremio-libtorrent-server#about-519b6502d940--a-shared-third-party-dependency)

This ID belongs to **Stremio's own certificate service**, not to any docker image: the cert is fetched
from Stremio's API (`api.strem.io/api/certificateGet`), which issues it for a subdomain of Stremio's
`stremio.rocks` domain. It is **not unique to your install** — everyone running this (or the upstream
[tsaridas/stremio-docker](https://github.com/tsaridas/stremio-docker)) image shares the same
`*.519b6502d940.stremio.rocks` wildcard cert from **Stremio's free certificate service**. The image
only _calls_ that Stremio API; it didn't create the ID.

- ✅ Zero-config trusted HTTPS for TVs.
- ⚠️ It depends on Stremio's cert service keeping that wildcard alive; if it's ever rotated or taken
down, the automatic cert path stops working (your stream still runs — only the trusted-HTTPS URL is affected).

**Independent fallback — bring your own cert** (no reliance on stremio.rocks): put a full-chain + key
PEM as `certificates.pem` in the data volume, set `-e SERVER_URL=https://yourdomain:12470`, and **leave**
**`IPADDRESS` unset** — the server uses your cert as-is. Or, on a trusted LAN, skip HTTPS entirely and
use `http://<your-server-ip>:8080`.

## 📜 License & spirit

[Permalink: 📜 License & spirit](https://github.com/andrewhack/stremio-libtorrent-server#-license--spirit)

**MIT** — built on the MIT-licensed [stremio-docker](https://github.com/tsaridas/stremio-docker) fork.

This is **not a commercial product, and we don't monetize it.** It's our contribution to the people
who just want their own open, private streaming server. Use it, share it, make it better. 💛

> Keep it legal: this is neutral infrastructure for content **you** have the right to stream.

## About

Self-hosted Stremio: open libtorrent engine + web player, one container - One-command installation


[stremio.itcom-solutions.com/](https://stremio.itcom-solutions.com/ "https://stremio.itcom-solutions.com/")

### Topics

[docker](https://github.com/topics/docker "Topic: docker") [torrent](https://github.com/topics/torrent "Topic: torrent") [streaming](https://github.com/topics/streaming "Topic: streaming") [bittorrent](https://github.com/topics/bittorrent "Topic: bittorrent") [selfhosted](https://github.com/topics/selfhosted "Topic: selfhosted") [self-hosted](https://github.com/topics/self-hosted "Topic: self-hosted") [libtorrent](https://github.com/topics/libtorrent "Topic: libtorrent") [stremio](https://github.com/topics/stremio "Topic: stremio") [media-streaming](https://github.com/topics/media-streaming "Topic: media-streaming") [fastapi](https://github.com/topics/fastapi "Topic: fastapi")

### Resources

[Readme](https://github.com/andrewhack/stremio-libtorrent-server#readme-ov-file)

### Uh oh!

There was an error while loading. [Please reload this page](https://github.com/andrewhack/stremio-libtorrent-server).

[Activity](https://github.com/andrewhack/stremio-libtorrent-server/activity)

### Stars

[**3**\\
stars](https://github.com/andrewhack/stremio-libtorrent-server/stargazers)

### Watchers

[**1**\\
watching](https://github.com/andrewhack/stremio-libtorrent-server/watchers)

### Forks

[**0**\\
forks](https://github.com/andrewhack/stremio-libtorrent-server/forks)

[Report repository](https://github.com/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2Fandrewhack%2Fstremio-libtorrent-server&report=andrewhack+%28user%29)

## [Releases\  23](https://github.com/andrewhack/stremio-libtorrent-server/releases)

[v0.2.21 — dual-stack BT listener + relocatable port\\
Latest\\
\\
6 hours agoJul 4, 2026](https://github.com/andrewhack/stremio-libtorrent-server/releases/tag/v0.2.21)

[\+ 22 releases](https://github.com/andrewhack/stremio-libtorrent-server/releases)

## [Packages\  0](https://github.com/users/andrewhack/packages?repo_name=stremio-libtorrent-server)

No packages published

## [Contributors\  2](https://github.com/andrewhack/stremio-libtorrent-server/graphs/contributors)

- [![@andrewhack](https://avatars.githubusercontent.com/u/46722365?s=64&v=4)](https://github.com/andrewhack)[**andrewhack** Andrey Karadimov](https://github.com/andrewhack)
- [![@claude](https://avatars.githubusercontent.com/u/81847?s=64&v=4)](https://github.com/claude)[**claude** Claude](https://github.com/claude)

## Languages

- [Python92.0%](https://github.com/andrewhack/stremio-libtorrent-server/search?l=python)
- [Shell6.1%](https://github.com/andrewhack/stremio-libtorrent-server/search?l=shell)
- Other1.9%

You can’t perform that action at this time.