# Invidious Router

> Open-source Go proxy that self-hosts a router sending requests to healthy Invidious instances, with health checks, region filtering and load balancing.

- **Category:** [Load Balancer](https://selfhost.directory/load-balancer)
- **Licence:** mit
- **Source model:** Open source
- **Latest version:** 1.2
- **Author:** gaincoder
- **Platforms:** Docker, Linux
- **Ports:** 8050 (HTTP server that routes requests to healthy Invidious instances)
- **Tags:** Youtube, Routing, Video Streaming, Reverse Proxy, Load Balancer, Go, Health check, Invidious

## Docker images

- [`gaincoder/invidious-router`](https://hub.docker.com/r/gaincoder/invidious-router)

## What is Invidious Router?

Written in Go, this router sits between you and the public Invidious frontends, forwarding each web request to whichever instance currently looks healthy. It periodically probes instances (checking status codes, scanning pages for YouTube-block notices, and weighing their success ratio), can keep only the fastest responders, pulls the default instance list from api.invidious.io with optional region filtering, and lets you add your own instances or blacklist unwanted ones. Traffic is spread evenly across what remains, recovered instances rejoin automatically, and an optional fallback to YouTube is off by default. The /router-status and /router-config endpoints let end users see which instances were picked and how the router is configured. Self-hosting is straightforward: grab a release binary or a distro package, or run the Docker image; the app serves HTTP on port 8050 and writes a YAML config (by default ./config/config.yaml) on first launch. It is MIT-licensed; the newest release, 1.2, came out in October 2024.

## Should you self-host Invidious Router?

Invidious Router scores **50/100** on selfhost.directory ([how scoring works](https://selfhost.directory/scoring)) and ranks **#2 of 2** in [Load Balancer](https://selfhost.directory/load-balancer).

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is easy: most people get it running in one sitting. An official Docker image is available. It is mit-licensed.

Its closest alternative on selfhost.directory is [HAProxy](https://selfhost.directory/project/haproxy) (68/100). It scores higher overall, so compare the two before you pick. [See Invidious Router vs HAProxy side by side.](https://selfhost.directory/compare/haproxy-vs-invidious-router)

## Features

- Automatic recovery
- Custom instance list
- Health Checks
- Instance blacklist
- Load Balancing
- Region filtering
- Response time filtering
- Status endpoints
- YAML configuration file
- YouTube fallback — disabled by default

## How to install Invidious Router

### Install Invidious Router with Docker

```sh
docker run gaincoder/invidious-router
```

### Install Invidious Router with Linux

1. Download the latest version for your operating system on the [releases page](https://gitlab.com/gaincoder/invidious-router/-/releases) or install your distro-specific package.
2. (on linux) Add permissions to execute
   ```sh
   sudo chmod +x invidious-router
   ```
3. Run it via command line
   ```sh
   ./invidious-router
   ```

Note: Also packaged in various Linux distros (see Repology).

## Invidious Router alternatives

- [Invidious](https://selfhost.directory/project/invidious): Open-source AGPL front-end for YouTube: watch without ads, tracking or JavaScript, with own subscriptions, playlists and a REST API; runs via Docker and PostgreSQL. (compare: https://selfhost.directory/compare/invidious-vs-invidious-router)
- [Golty](https://selfhost.directory/project/golty): Golty is a self-hosted, open-source tool that automatically downloads YouTube channels and playlists on a schedule, with a simple web dashboard. (compare: https://selfhost.directory/compare/golty-vs-invidious-router)
- [Materialious](https://selfhost.directory/project/materialious): Open-source, self-hosted material-design frontend for YouTube and Invidious: encrypted subscriptions, SponsorBlock, DeArrow, no ads. Web, desktop & Android TV support. (compare: https://selfhost.directory/compare/invidious-router-vs-materialious)
- [Traefik](https://selfhost.directory/project/traefik): Traefik is a self-hosted, open-source reverse proxy that auto-discovers services from Docker, Kubernetes, and other orchestrators to route traffic without manual config. (compare: https://selfhost.directory/compare/invidious-router-vs-traefik)
- [godoxy](https://selfhost.directory/project/godoxy): High-performance reverse proxy and container orchestrator for self-hosters (compare: https://selfhost.directory/compare/godoxy-vs-invidious-router)
- [hometube](https://selfhost.directory/project/hometube): Self-hosted, open-source video downloader for 1800+ platforms. Strips sponsors via SponsorBlock, organizes files for Plex, Jellyfin, Emby. Single Docker container. (compare: https://selfhost.directory/compare/hometube-vs-invidious-router)
- [netgoat](https://selfhost.directory/project/netgoat): NetGoat is an open-source, self-hosted Go reverse proxy and free Cloudflare alternative with domain routing, WAF rules, rate limiting, TLS/ACME and bot challenges. (compare: https://selfhost.directory/compare/invidious-router-vs-netgoat)
- [piped](https://selfhost.directory/project/piped): Open-source, self-hosted alternative front end for YouTube: no ads or tracking, with subscription feeds, playlists, SponsorBlock and audio-only playback. (compare: https://selfhost.directory/compare/invidious-router-vs-piped)

## More in Load Balancer

- [NGINX](https://selfhost.directory/project/nginx): NGINX is a self-hosted, open-source web server that also functions as a reverse proxy, load balancer, content cache, and mail proxy.
- [nginx-love](https://selfhost.directory/project/nginx-love): Self-hosted open-source platform for managing Nginx reverse proxies with ModSecurity WAF, Let's Encrypt SSL, load balancing, JA4 bot detection, and multi-user RBAC.
- [nginx-proxy](https://selfhost.directory/project/nginx-proxy): Self-hosted Nginx reverse proxy for Docker: this open-source container writes vhost configs from running containers and reloads them, with HTTPS and load balancing.
- [PgDog](https://selfhost.directory/project/pgdog): Self-hosted, open-source PostgreSQL proxy written in Rust: transaction-mode connection pooling, read/write load balancing with health checks, and automatic sharding.
- [production-stack](https://selfhost.directory/project/production-stack): Self-hosted, open-source Helm stack that scales vLLM across a Kubernetes cluster, with KV-cache-aware request routing and a Prometheus/Grafana monitoring dashboard.
- [Traefik](https://selfhost.directory/project/traefik): Traefik is a self-hosted, open-source reverse proxy that auto-discovers services from Docker, Kubernetes, and other orchestrators to route traffic without manual config.
- [Caddy](https://selfhost.directory/project/caddy): Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
- [docker-flow-proxy](https://selfhost.directory/project/docker-flow-proxy): Docker Flow Proxy is a self-hosted, open-source reverse proxy built on HAProxy that automatically reconfigures when services are deployed or scaled in Docker Swarm.
- [Ferron](https://selfhost.directory/project/ferron): Open-source, self-hosted Rust web server for static sites, PHP and reverse-proxied apps, with automatic TLS, Prometheus/OTLP metrics, and trace IDs in every log line.
- [HAProxy](https://selfhost.directory/project/haproxy): HAProxy is a free, very fast and reliable reverse-proxy offering high availability, load balancing, and proxying for TCP and HTTP-based applications.

## Links

- [Homepage](https://gitlab.com/gaincoder/invidious-router)
- [Releases](https://gitlab.com/gaincoder/invidious-router/-/releases)
- [Repology packaging status](https://repology.org/project/invidious-router/versions)

---
Source: https://selfhost.directory/project/invidious-router