Installing invidious with docker on Ubuntu

about the project

Invidious is an open-source alternative front-end to YouTube.

Visit the project

installation steps

generate a password for your postgresql.

openssl rand -hex 15

create the directory

mkdir -p /opt/invidious/data/postgresql
cd /opt/invidious/

clone the project

git clone https://github.com/iv-org/invidious.git docker
cd docker

configure your installation

vim docker-compose.yml

content

version: "3"
services:

  invidious:
    image: quay.io/invidious/invidious:latest
    restart: unless-stopped
    ports:
      - "3000:3000"
    environment:
      INVIDIOUS_CONFIG: |
        db:
          dbname: invidious
          user: kemal
          password: your_postgresql_password_here
          host: invidious-db
          port: 5432
        check_tables: true
    healthcheck:
      test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1
      interval: 30s
      timeout: 5s
      retries: 2
    logging:
      options:
        max-size: "1G"
        max-file: "4"
    depends_on:
      - invidious-db

  invidious-db:
    image: docker.io/library/postgres:14
    restart: unless-stopped
    volumes:
      - postgresdata:/var/lib/postgresql/data
      - ./config/sql:/config/sql
      - ./docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh
    environment:
      POSTGRES_DB: invidious
      POSTGRES_USER: kemal
      POSTGRES_PASSWORD: your_postgresql_password_here
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]

volumes:
  postgresql:
    driver_opts:
      type: none
      device: /opt/invidious/data/postgresql
      o: bind

start your invidious

docker-compose up -d

visit your instance

https://your_docker_host_ip:3000

nginx configuration example

server {
    listen your_listen_ip_here:80;
    server_name tube.bolha.tools;
    location / {
        return 301 https://tube.bolha.tools$request_uri;
    }
}

server {
    listen your_listen_ip_here:443 ssl http2;
    server_name tube.bolha.tools;

    ssl_certificate /etc/letsencrypt/live/bolha.tools/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/bolha.tools/privkey.pem;

    access_log /var/log/nginx/tube-bolha-tools-access.log;
    error_log /var/log/nginx/tube-bolha-tools-error.log;

    location / {
        proxy_pass http://your_invidious_ip_here:your_port_here;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;    # so Invidious knows domain
        proxy_http_version 1.1;     # to keep alive
        proxy_set_header Connection ""; # to keep alive
    }

}

Enjoy!


Did you like our content?

We have a lot to share; visit our site!

Our fediverse services ;)

Chat and video? We have it!

Translation tools

Video Platform Frontends

Text Editors

You can also visit our hacking space!

Follow our founder!

Follow the status of our tools

Do you want to support us? You can!

See you!

[s]