Note: Any PaaS or SaaS provider/software (Heroku, YunoHost, Repli...) are unsupported. Use them at your own risk. They WILL cause problems with Invidious and might even suspend your account for "abuse" since Invidious is heavy, bandwidth intensive and technically a proxy (and most providers don't like them). If you use one and want to report an issue, please mention which one you use.
Hardware requirements
Running Invidious and Invidious companion requires at least 20GB disk space, 2GB of free RAM, as long as it is restarted regularly, as recommended in the post-install configuration. Public instances should ideally have at least 60G disk space, 4GB of RAM, 2vCPU, a 200 mbps link and 20TB of traffic (no data cap/unlimited traffic is preferred).
Compiling Invidious requires at least 2.5GB of free RAM (We recommend to have at least 4GB installed).
If you have less (e.g on a cheap VPS) you can setup a SWAP file or partition, so the combined amount is >= 4GB.
MIGRATION NEEDED (NEW): Invidious companion
Invidious companion replace both inv-sig-helper and youtube-trusted-session-generator. You don't need to execute youtube-trusted-session-generator anymore.
This method uses the pre-built Docker image from quay
Note: Currently the repository has to be cloned, this is because the init-invidious-db.sh file and the config/sql directory have to be mounted to the postgres container (See the volumes section in the docker-compose file below). This "problem" will be solved in the future.
Make sure to run the newer Docker Compose V2: https://docs.docker.com/compose/install/linux/. It should already be installed if you can successfully run the command docker compose (with a space between the two words).
Note: This compose is made for a true "production" setup, where Invidious is behind a reverse proxy. If you prefer to directly access Invidious, replace 127.0.0.1:3000:3000 with 3000:3000 under the ports: section.
Run the docker composition:
docker compose up -d
Docker-compose method (development)
This method builds a Docker image from sourcePlayback won't work without Invidious companion configured.
systemctlenable--nowpostgresql
sudo-i-upostgres
psql-c"CREATE USER kemal WITH PASSWORD 'kemal';"# Change 'kemal' here to a stronger password, and update `password` in config/config.ymlcreatedb-Okemalinvidious
exit
Set up Invidious
sudosu-invidious
cdinvidious
make
# Configure config/config.yml as you likecpconfig/config.example.ymlconfig/config.yml# edit config.yaml to include invidious companioneditconfig/config.yaml
add:
invidious_companion:
# URL used for the internal communication between invidious and invidious companion-private_url:"http://localhost:8282/companion"# IT is NOT recommended to use the same key as HMAC KEY. Generate a new key!invidious_companion_key:"CHANGE_ME!!"# Deploy the database./invidious--migrate
exit
# wget from a binary release# https://github.com/iv-org/invidious-companion/releases/tag/release-masterwgethttps://github.com/iv-org/invidious-companion/releases/download/release-master/invidious_companion-x86_64-unknown-linux-gnu.tar.gz
# or compile it using https://docs.deno.com/runtime/gitclonehttps://github.com/iv-org/invidious-companion.git
denotaskcompile
# launch it manuallySERVER_SECRET_KEY=CHANGE_ME!!SAME_AS_INVIDIOUS_COMPANION_SECRET_KEY_FROM_INVIDIOUS_CONFIG./invidious-companion
Seemoredocsabouttheenvironmentvariables:https://github.com/iv-org/invidious-companion/wiki/Environment-variables
sudowgethttps://github.com/iv-org/invidious-companion/raw/refs/heads/master/invidious-companion.service-O/etc/systemd/system/invidious-companion.service
sudosystemctlenable--nowinvidious-companion.service
By installing Windows-specific builds of Crystal. Be wary, as we don't currently have records of Invidious being tested on those "unsupported" builds yet.
Not official supported by Invidious developers!
Is your platform not listed (Podman, BSD, LXC and more)?
Take a look at the community installation guide: here
You must set a random generated value for the parameter hmac_key:! On Linux you can generate it using the command pwgen 20 1.
Because of various issues, Invidious must be restarted often, at least once a day, ideally every hour.
If you use a reverse proxy, you must configure Invidious to properly serve request through it:
https_only: true : if you are serving your instance via https, set it to true
domain: domain.ext: if you are serving your instance via a domain name, set it here
external_port: 443: if you are serving your instance via https, set it to 443
use_pubsub_feeds: true: if you are serving your instance on the internet, allow for faster notification of new videos (detailed explanation).
use_innertube_for_captions: true: if you are serving a public instance or you are hosting Invidious in a datacenter, allow to unblock captions (detailed explanation).
Advanced (improve performance)
For performance reasons, you may configure Invidious companion to be served directly under your reverse proxy for serving the video streams.
This will greatly improve your playback when used by multiple users.
Uncomment public_url for the parameter invidious_companion: in Invidious config.yaml and configure it like this:
Configure the public_url to be the same as the domain used for Invidious or on a separate domain (if you want) with the path /companion.
Examples: https://MYINVIDIOUSDOMAIN/companion or https://COMPANION.MYINVIDIOUSDOMAIN/companion.