# Invidious.nerdvpn.de Invidious fork with customizations for invidious.nerdvpn.de Theme for my instance is based on: https://github.com/Tsyron/Invidious-Theme Original repo at: https://github.com/iv-org/invidious Based upon patches from: - https://github.com/yewtudotbe/invidious-custom - https://git.nadeko.net/Fijxu/invidious # WARNING This fork is not compatible with upstream invidious (i.e. https://github.com/iv-org/invidious). If you already have an instance using the official invidious, you CANNOT simply switch to this instance and vice-versa. This is due to the the following changes which I implemented to improve the performance and reliability of my instance: - Removal of materialized views as subscription tables in PostgreSQL (see https://git.nerdvpn.de/NerdVPN.de/invidious/src/branch/nerdvpn/patches/invidious/011-remove-psql-mat-views.patch) - Redis as video cache (see https://git.nerdvpn.de/NerdVPN.de/invidious/src/branch/nerdvpn/patches/invidious/010-use-redis-for-video-cache.patch) If you NEVER used Invidious before, you can safely start with my fork, but you won't be able to switch to upstream Invidious at all. # Requirements You'll have to set these up yourself: - Docker Compose V2 (this is still not included on many default docker installations so make sure you actually have the plugin version 2). - PostgreSQL 16 Server. - Nginx Web Server (1.26 or higher for quic support). - HAProxy 2.x with my config under `etc/haproxy/haproxy.conf`. - Redis Server for the video cache. - (optional) PGBouncer, recommended if you want to host a public instance to pool connections to PSQL, otherwise you might run into DB pool errors. - (optional) Anubis https://github.com/TecharoHQ/anubis, recommended if you want to host a public instance and not get DDoS'ed from bots and ai. # For public instances If you want to host a public instance, you should acuire a few VPN/proxies to bypass blockage from YouTube. Otherwise, your instance (and your server IP) will simply get blocked by YouTube after a few hours max. I will not give any recommendations here because this is something you should research and manage for yourself. A few important infos: - Datacenter IPv4 proxies will not work. - Static residential IPv4 proxies will not work. - Most VPN providers that do not allow dynamically switching target server or target IP will not work. - Datacenter IPv6 proxies with at most a /40 CIDR subnet will work if they allow unlimited IP rotation in that subnet. - Rotating residential proxies will work but they're really expensive (I'm talking about upwards 50€ / months just for one). - You need at least 500 GiB traffic / month without DASH. - You need at least 30 TiB traffic / month with DASH and/or local proxy. The more users use your instance, the more traffic you'll need. # Build instructions Do this in a separate dir (for example /srv/invidious) under non-root permissions: First, clone this repo with all subrepos: 1. `git clone --recurse-submodules https://git.nerdvpn.de/NerdVPN.de/invidious` 2. `cd invidious` Build invidious: 1. `patch.sh invidious` 2. `build.sh development` for the development image or `./build.sh release` for the production image Build invidious-companion: 1. `patch.sh companion` 2. `build.sh companion` to build the invidious companion # Update instructions For invidious: 1. `update.sh invidious` to get the latest upstream 2. `patch.sh invidious` 3. `build.sh development` for the development image or `./build.sh release` for the production image For invidious-companion: 1. `update.sh companion` to get the latest upstream 2. `patch.sh companion` 3. `build.sh companion` to build the invidious companion # Run instructions (docker compose V2) - `docker compose up -d` # Run instructions (systemd) First copy the invidious.service to /etc/systemd/system/ - Enable and start with: `systemctl enable --now invidious.service`