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:
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:
- Multiple companion backends (see https://git.nerdvpn.de/NerdVPN.de/invidious/src/branch/nerdvpn/patches/invidious/0003-multiple-companion-backends.patch)
- Redis as video cache (see https://git.nerdvpn.de/NerdVPN.de/invidious/src/branch/nerdvpn/patches/invidious/0007-redis-for-video-cache.patch)
- Removal of materialized views as subscription tables in PostgreSQL (see https://git.nerdvpn.de/NerdVPN.de/invidious/src/branch/nerdvpn/patches/invidious/0008-remove-psql-materialized-views.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
First, read EVERYTHING on here: https://docs.invidious.io/
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:
git clone --recurse-submodules https://git.nerdvpn.de/NerdVPN.de/invidiouscd invidious
Build invidious:
patch.sh invidiousbuild.sh developmentfor the development image or./build.sh releasefor the production image
Build invidious-companion:
patch.sh companionbuild.sh companionto build the invidious companion
Update instructions
For invidious:
update.sh invidiousto get the latest upstreampatch.sh invidiousbuild.sh developmentfor the development image or./build.sh releasefor the production image
For invidious-companion:
update.sh companionto get the latest upstreampatch.sh companionbuild.sh companionto 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