guyavrhm/orion

Self-Hosted Torrent Client and Media Server

14

stars

1

commits

TypeScript

primary language

Sep 4, 2026

updated

media-server
pwa
self-hosted
streaming
subtitles
torrent-tool
transcoding

README

Orion

Self-Hosted Torrent Client and Media Server

Searches, downloads, transcodes, syncs, and streams to any device.

Orion Interface Preview

TypeScript Node.js Vite PWA Tests Docker License


What is Orion?

Orion is a lightweight self-hosted torrent client and media server built for reliable, automated media management and playback.

Instead of relying on live torrent streaming with limited device compatibility, or complex setups involving multiple services, Orion handles the entire media lifecycle automatically, even on a low-spec server. Everything is fully prepared in advance for instant playback across multiple devices.

Orion is split into two distinct halves:

  1. The Engine (Backend): Self-hosted on your server or computer. It automatically discovers and verifies torrent streams, manages downloads, fixes subtitles, transcodes media, and serves cached content to multiple clients.
  2. The Player (Universal PWA): A lightweight web client that works on virtually any browser, phone, tablet, or smart TV.

Queue up an entire season while you're at work or asleep. Once ready, open the app and play anywhere.

Quick Start

# Clone
git clone https://github.com/guyavrhm/orion.git
cd orion

# Configure
cp .env.example .env
# Edit .env: set your torrent provider URLs (see Configuration below)

# Launch
docker compose up -d --build

Open http://localhost:3000 (or http://<your-server-ip>:3000) in your browser on any device, or install it as a PWA.

Local Development

Prerequisites & setup

Requirements:

  • Node.js v22.x or later
  • Redis running on localhost:6379
  • FFmpeg & FFprobe installed and in $PATH
  • ffsubsync installed via pip install ffsubsync
# Install dependencies
npm install

# Start API server + all background workers (dev mode)
npm run dev:all

# Or start the Vite frontend dev server separately for hot reload
npm run dev

# Run automated tests
npm test

# Run tests with coverage
npm run test:coverage

Features

Playback & Client

  • Universal Web App: Cross-platform (iOS, Android, desktop, web) with synchronized watch progress, built-in search, and metadata integration.
  • Universal Two-Lane HLS Transcoding: Supports modern and legacy video formats with H.264 stream-copy, adaptive HEVC/AV1 re-encoding, and multi-channel audio normalization.

Torrent & Media Pipeline

  • Intelligent Torrent Engine: Dynamic API scraping with automated stream selection, codec-aware priority ranking, dead swarm failover, and queue stall management with piece preservation.
  • Automated Subtitle Pipeline: Multi-source fetching (embedded tracks + OpenSubtitles hash lookup), ffsubsync waveform alignment, RTL/BiDi rendering fixes, and algorithmic accuracy scoring.
  • Resilient Worker Architecture: Redis-backed BullMQ DAG pipeline for concurrent transcoding/subtitles, automatic crash recovery, and state resumption.

Storage & Self-Hosting

  • Smart Storage & LRU Eviction: Configurable storage caps with automatic LRU eviction and instant raw-torrent cleanup post-transcode.
  • Private & Self-Hosted: Zero telemetry, user-configured providers, and single-command deployment.

How It Compares

All the power of a full media automation stack in a single app, without fragile live torrent streaming or complex multi-service setups.

FeatureLive Torrent StreamingThe *Arr Stack + PlexOrion
Client SupportRestricted (fails on iOS/Safari)Native apps / Plex clientsUniversal (PWA on any device)
Stream DiscoveryManual trial & errorAutomated via IndexersAutomated swarm health testing
Playback & ScrubbingBuffers; scrubbing often breaksInstant (direct play)Instant (pre-transcoded HLS)
SubtitlesManual offset & broken RTLRequires Bazarr + manual BiDi fixesAuto audio-sync & BiDi/RTL correction
Storage ModelManual deletionLarge NAS / manual cleanupAutomatic LRU cache eviction
Setup ComplexitySingle app / web player5–7 containers + configsSingle docker compose up

Configuration

Create a .env file from the provided example (cp .env.example .env) and configure:

Torrent Providers

VariableDescription
TORRENT_MOVIE_PROVIDERSSingle or comma-separated API URL templates for movie streams
TORRENT_SHOW_PROVIDERSSingle or comma-separated API URL templates for show streams
TORRENT_MOVIE_PROVIDER_API_KEYSOptional API key(s) (single global key, or comma-separated matching provider order)
TORRENT_SHOW_PROVIDER_API_KEYSOptional API key(s) (single global key, or comma-separated matching provider order)

Multi-Provider & Formats: You can provide multiple comma-separated URLs to query multiple indexers concurrently. Endpoints can be standard Torznab/Newznab XML feeds or custom JSON APIs (Orion will dynamically scan the response to extract magnet links, seeders, and required metadata).

Users are responsible for ensuring their configured providers comply with local copyright laws. See the Legal Disclaimer below for more details.

Media & Storage

VariableDefaultDescription
MAX_STORAGE_GB100Storage cap before LRU eviction kicks in
SUBTITLE_LANGSeng,spaComma-separated subtitle languages (ISO 639-2 canonical codes)

Worker & Queue Concurrency

VariableDefaultDescription
CONCURRENCY_DOWNLOAD2Number of concurrent active torrent downloads
CONCURRENCY_TRANSCODE_FAST1Fast lane worker capacity (H.264 direct stream-copy)
CONCURRENCY_TRANSCODE_HEAVY1Heavy lane worker capacity (HEVC / AV1 / 10-bit re-encoding)
CONCURRENCY_SUBTITLE1Number of concurrent subtitle fetch & sync jobs
CONCURRENCY_FINALIZE1Number of concurrent finalization & SQLite registration jobs

Roadmap

Contributions and ideas are welcome! Here's what's on the horizon:

  • Offline PWA Downloads - Allow users to locally save transcoded media directly to their devices (via the browser) for a fully offline experience, perfect for flights or commutes.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Orion is an open-source, self-hosted personal media server application. It does not host, index, or distribute any copyrighted content. The application includes media browsing and discovery features that display publicly available metadata (titles, posters, descriptions, and ratings) sourced from third-party public APIs; Orion does not own, store, or claim rights over any of this metadata.

When a user initiates a stream, Orion sends a query to a user-configured external provider API. The developers have no control over what providers users configure or what content those providers return. Orion connects exclusively to endpoints specified by the end user in their own configuration.

Users are solely responsible for ensuring their use of Orion complies with all applicable local laws and regulations regarding copyright and media consumption.


Contributors

guyavrhm

1 commits

guyavrhm/orion

Self-Hosted Torrent Client and Media Server

14

stars

1

commits

TypeScript

primary language

Sep 4, 2026

updated

media-server
pwa
self-hosted
streaming
subtitles
torrent-tool
transcoding

README

Orion

Self-Hosted Torrent Client and Media Server

Searches, downloads, transcodes, syncs, and streams to any device.

Orion Interface Preview

TypeScript Node.js Vite PWA Tests Docker License


What is Orion?

Orion is a lightweight self-hosted torrent client and media server built for reliable, automated media management and playback.

Instead of relying on live torrent streaming with limited device compatibility, or complex setups involving multiple services, Orion handles the entire media lifecycle automatically, even on a low-spec server. Everything is fully prepared in advance for instant playback across multiple devices.

Orion is split into two distinct halves:

  1. The Engine (Backend): Self-hosted on your server or computer. It automatically discovers and verifies torrent streams, manages downloads, fixes subtitles, transcodes media, and serves cached content to multiple clients.
  2. The Player (Universal PWA): A lightweight web client that works on virtually any browser, phone, tablet, or smart TV.

Queue up an entire season while you're at work or asleep. Once ready, open the app and play anywhere.

Quick Start

# Clone
git clone https://github.com/guyavrhm/orion.git
cd orion

# Configure
cp .env.example .env
# Edit .env: set your torrent provider URLs (see Configuration below)

# Launch
docker compose up -d --build

Open http://localhost:3000 (or http://<your-server-ip>:3000) in your browser on any device, or install it as a PWA.

Local Development

Prerequisites & setup

Requirements:

  • Node.js v22.x or later
  • Redis running on localhost:6379
  • FFmpeg & FFprobe installed and in $PATH
  • ffsubsync installed via pip install ffsubsync
# Install dependencies
npm install

# Start API server + all background workers (dev mode)
npm run dev:all

# Or start the Vite frontend dev server separately for hot reload
npm run dev

# Run automated tests
npm test

# Run tests with coverage
npm run test:coverage

Features

Playback & Client

  • Universal Web App: Cross-platform (iOS, Android, desktop, web) with synchronized watch progress, built-in search, and metadata integration.
  • Universal Two-Lane HLS Transcoding: Supports modern and legacy video formats with H.264 stream-copy, adaptive HEVC/AV1 re-encoding, and multi-channel audio normalization.

Torrent & Media Pipeline

  • Intelligent Torrent Engine: Dynamic API scraping with automated stream selection, codec-aware priority ranking, dead swarm failover, and queue stall management with piece preservation.
  • Automated Subtitle Pipeline: Multi-source fetching (embedded tracks + OpenSubtitles hash lookup), ffsubsync waveform alignment, RTL/BiDi rendering fixes, and algorithmic accuracy scoring.
  • Resilient Worker Architecture: Redis-backed BullMQ DAG pipeline for concurrent transcoding/subtitles, automatic crash recovery, and state resumption.

Storage & Self-Hosting

  • Smart Storage & LRU Eviction: Configurable storage caps with automatic LRU eviction and instant raw-torrent cleanup post-transcode.
  • Private & Self-Hosted: Zero telemetry, user-configured providers, and single-command deployment.

How It Compares

All the power of a full media automation stack in a single app, without fragile live torrent streaming or complex multi-service setups.

FeatureLive Torrent StreamingThe *Arr Stack + PlexOrion
Client SupportRestricted (fails on iOS/Safari)Native apps / Plex clientsUniversal (PWA on any device)
Stream DiscoveryManual trial & errorAutomated via IndexersAutomated swarm health testing
Playback & ScrubbingBuffers; scrubbing often breaksInstant (direct play)Instant (pre-transcoded HLS)
SubtitlesManual offset & broken RTLRequires Bazarr + manual BiDi fixesAuto audio-sync & BiDi/RTL correction
Storage ModelManual deletionLarge NAS / manual cleanupAutomatic LRU cache eviction
Setup ComplexitySingle app / web player5–7 containers + configsSingle docker compose up

Configuration

Create a .env file from the provided example (cp .env.example .env) and configure:

Torrent Providers

VariableDescription
TORRENT_MOVIE_PROVIDERSSingle or comma-separated API URL templates for movie streams
TORRENT_SHOW_PROVIDERSSingle or comma-separated API URL templates for show streams
TORRENT_MOVIE_PROVIDER_API_KEYSOptional API key(s) (single global key, or comma-separated matching provider order)
TORRENT_SHOW_PROVIDER_API_KEYSOptional API key(s) (single global key, or comma-separated matching provider order)

Multi-Provider & Formats: You can provide multiple comma-separated URLs to query multiple indexers concurrently. Endpoints can be standard Torznab/Newznab XML feeds or custom JSON APIs (Orion will dynamically scan the response to extract magnet links, seeders, and required metadata).

Users are responsible for ensuring their configured providers comply with local copyright laws. See the Legal Disclaimer below for more details.

Media & Storage

VariableDefaultDescription
MAX_STORAGE_GB100Storage cap before LRU eviction kicks in
SUBTITLE_LANGSeng,spaComma-separated subtitle languages (ISO 639-2 canonical codes)

Worker & Queue Concurrency

VariableDefaultDescription
CONCURRENCY_DOWNLOAD2Number of concurrent active torrent downloads
CONCURRENCY_TRANSCODE_FAST1Fast lane worker capacity (H.264 direct stream-copy)
CONCURRENCY_TRANSCODE_HEAVY1Heavy lane worker capacity (HEVC / AV1 / 10-bit re-encoding)
CONCURRENCY_SUBTITLE1Number of concurrent subtitle fetch & sync jobs
CONCURRENCY_FINALIZE1Number of concurrent finalization & SQLite registration jobs

Roadmap

Contributions and ideas are welcome! Here's what's on the horizon:

  • Offline PWA Downloads - Allow users to locally save transcoded media directly to their devices (via the browser) for a fully offline experience, perfect for flights or commutes.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Orion is an open-source, self-hosted personal media server application. It does not host, index, or distribute any copyrighted content. The application includes media browsing and discovery features that display publicly available metadata (titles, posters, descriptions, and ratings) sourced from third-party public APIs; Orion does not own, store, or claim rights over any of this metadata.

When a user initiates a stream, Orion sends a query to a user-configured external provider API. The developers have no control over what providers users configure or what content those providers return. Orion connects exclusively to endpoints specified by the end user in their own configuration.

Users are solely responsible for ensuring their use of Orion complies with all applicable local laws and regulations regarding copyright and media consumption.


Contributors

guyavrhm

1 commits

Languages

TypeScript

69.9%

JavaScript

20.3%

CSS

8.2%

HTML

1.5%