Choosing an approach
| Approach | When to use |
|---|---|
| Docker | You want a ready-to-run container with no additional setup |
| Static file server | You already have an HTTP server or CDN and want to serve the build/ directory directly |
Serving the build directory
After building from source, thebuild/ directory is self-contained. Serve it with any HTTP server that can:
- Serve static files
- Fall back to
index.htmlfor unknown paths (required for SPA routing)
nginx
The following configuration serves the SPA and sets the recommended caching headers:The
try_files ... /index.html directive is required. Without it, navigating to a deep URL directly returns a 404 instead of loading the app.HTTP caching recommendations
Stremio Web uses content-addressed asset paths (/<commit-hash>/scripts/main.js). You can take advantage of this with aggressive caching:
| Resource | Recommended max-age | Rationale |
|---|---|---|
index.html | 2 hours (7200 s) | Entry point must stay fresh so clients get new deploys |
Hashed assets (/<hash>/...) | 1 month (2629744 s) | Path changes with every deploy; safe to cache indefinitely |
manifest.json, images, favicons | 1 day | Infrequently updated static assets |
http_server.js) applies.
HTTPS requirement
If you need a certificate, Let’s Encrypt provides free TLS certificates.Required security headers
To enableSharedArrayBuffer support, add these headers to responses serving index.html:
PWA installation
Stremio Web ships with amanifest.json and a service worker generated by Workbox. When served over HTTPS, browsers will offer to install it as a Progressive Web App.
The service worker:
- Caches the app shell and assets for offline use
- Uses
clientsClaim: trueandskipWaiting: true, so a new version activates as soon as it is available - Caches files up to 20 MB in size
Connecting to Stremio Core
The in-browser app connects to Stremio Core (the streaming server) to handle torrent streaming, transcoding, and local add-on communication.- By default, the app attempts to connect to a locally running Stremio desktop application that exposes the Core API.
- If you are self-hosting without a desktop app, users can point the app at any compatible Stremio Core endpoint via Settings → Advanced → Streaming server URL.
- The Core and the web app must be on compatible versions. Check the
@stremio/stremio-core-webdependency version inpackage.jsonfor the bundled Core version.
The web app bundles
stremio-core-web as a WebAssembly module, so basic functionality (add-on browsing, metadata) works without a separate server. A running Stremio Core is only required for actual video streaming.