LIVEReading: Watch YouTube Without Ads or Tracking via InvidiousTotal time: 12 minSteps: 6Worked first time: 65% LIVEReading: Watch YouTube Without Ads or Tracking via InvidiousTotal time: 12 minSteps: 6Worked first time: 65%
CBW
Watch YouTube Without Ads or Tracking via Invidious
Mediumgithub.com/iv-org/invidious2026-07-01

Watch YouTube Without Ads or Tracking via Invidious

Invidious is a self-hosted alternative front-end for YouTube. Watch any YouTube video with no ads, no tracking, and no Google account required.

// Build stats

  • Total time12 min
  • Number of steps6
  • DifficultyMedium
  • Worked first time65%
// Before you start

What you need

  • A Linux server or VPS (Ubuntu 22.04 recommended)
  • Docker and Docker Compose installed
  • A terminal with SSH access to your server
  • Port 3000 open on your firewall
  • Basic comfort running copy-paste terminal commands
01
Step 1 of 6

Clone the Invidious repository

2 min

This downloads all the files needed to run Invidious onto your server. Git is almost always pre-installed on Ubuntu. The folder it creates will hold your entire setup.

Terminal · mac
$ git clone https://github.com/iv-org/invidious.git && cd invidious
What you should see
A folder called 'invidious' is created and you are now inside it.
This might happen

git: command not found

Run: sudo apt update && sudo apt install -y git — then retry the clone command.

02
Step 2 of 6

Copy the example Docker Compose config

1 min

Invidious ships with a ready-made Docker Compose file. You copy it to the standard name Docker expects so it gets picked up automatically. You do not need to edit any code.

Terminal · mac
$ cp docker-compose.yml-example docker-compose.yml
What you should see
No output means success. A new file called docker-compose.yml now exists in the folder.
03
Step 3 of 6

Set a secure database password

3 min

The default config uses a placeholder password for the internal database. You need to replace it in two places inside docker-compose.yml. The sed command below does both replacements for you automatically — just swap YOUR_PASSWORD for any strong password you choose (no spaces).

Terminal · mac
$ sed -i 's/CHANGE_ME/YOUR_PASSWORD/g' docker-compose.yml
What you should see
No output. Run: grep CHANGE_ME docker-compose.yml — it should return nothing, confirming the placeholder is gone.
This might happen

grep still finds CHANGE_ME after running the command

Open docker-compose.yml in nano (nano docker-compose.yml), find every CHANGE_ME manually, and replace with your password. Save with Ctrl+O, exit with Ctrl+X.

04
Step 4 of 6

Pull the Docker images

5 min

This downloads the pre-built Invidious app image and the PostgreSQL database image from Docker Hub. It can take a few minutes depending on your connection speed. You only need to do this once.

Terminal · mac
$ docker compose pull
What you should see
Lines showing 'Pull complete' for each image layer. Ends with no errors.
This might happen

docker compose: command not found (older systems use 'docker-compose' with a hyphen)

Replace 'docker compose' with 'docker-compose' in every command in this guide.

05
Step 5 of 6

Start Invidious

2 min

This launches the database and the Invidious app together in the background. The -d flag means they run silently so your terminal stays free. Invidious will be available on port 3000.

Terminal · mac
$ docker compose up -d
What you should see
Lines like 'Container invidious-db-1 Started' and 'Container invidious-invidious-1 Started'.
This might happen

Port 3000 is already in use by another app

Open docker-compose.yml in nano, find '3000:3000' under ports, and change the left number to a free port like 3001:3000. Then re-run docker compose up -d.

06
Step 6 of 6

Open Invidious in your browser

1 min

Navigate to your server's IP address on port 3000. If you are running this on your own computer, use localhost. You should see the Invidious homepage — search for any YouTube video and it will play without ads.

Terminal · mac
$ http://YOUR_SERVER_IP:3000
What you should see
The Invidious homepage loads with a search bar. Searching for a video returns results and plays them.
This might happen

Page does not load or connection is refused

Wait 30 seconds — the app sometimes takes a moment to finish starting. Then check logs with: docker compose logs invidious — look for any ERROR lines.

// Status

cooked. baked. worked.

A private, ad-free, tracking-free YouTube front-end running on your own server, accessible from any browser on your network.

// the honest bit

The honest part

Invidious works by scraping YouTube without using official APIs. YouTube periodically changes its internals, which can break video playback for days until the Invidious team pushes a fix. You may hit rate-limiting if your server IP makes too many requests. This is not a replacement for a YouTube account — features like uploading or YouTube Premium are not supported. Subscriptions and watch history are stored locally on your server only.