How to Install TubeArchivist on a VPS with Docker: A Searchable Personal YouTube Video Archive

A video you rely on can disappear without warning. A channel you follow retitles, deletes older uploads, or shuts down, and a link you saved suddenly points at an empty page. For creators the stakes are higher: a video of your own work that lives only on one platform can vanish along with the account or the platform's policy. TubeArchivist answers that problem in an orderly way: it downloads videos to your own server, indexes titles, descriptions, and other metadata, and serves everything through a searchable web interface — a personal video library, not just a downloads folder.

One boundary needs stating up front, because this guide only makes sense inside it: archive videos you actually have the rights to — your own work, public-domain videos, and freely licensed videos such as Creative Commons works that allow downloading and storing. Do not use this guide to download other people's copyrighted work without permission. That rule is not a formality; it decides whether your archive stays usable with a clear conscience in the long run.

This guide installs TubeArchivist as a three-container stack on a VPS — the main application, Redis for the queue, and Elasticsearch for the search index — then sets up a channel subscription, a download queue, and a rescan schedule.

Before you start: what you need

  • A VPS with Docker and Docker Compose v2 installed. TubeArchivist is not a lightweight app: the project itself calls for around 2 GB of available memory for a small setup, and around 4 GB for a mid-to-large one. A 1 GB VPS will feel cramped once Elasticsearch is running.
  • Plenty of disk space, watched continuously. Video eats space far faster than music or documents, and Elasticsearch itself will lock its index to read-only if disk usage passes 95%, until it drops below 90% again.
  • Port 8000 free on the VPS, since that is TubeArchivist's web interface port.
  • Two strong, different passwords: one for logging in to TubeArchivist, and another for Elasticsearch. Both are written in the Compose file, so do not share that file in a public repository.
  • sudo access on the host, because one kernel setting for Elasticsearch has to be changed at system level.

Check Docker, Compose, and memory:

docker --version
docker compose version
free -h

Expected output: the first two commands print version numbers, and the third shows enough available memory for this stack. If available memory is under 2 GB, upgrade the VPS first or lighten the load from other services before continuing.

Step 1: prepare the kernel setting for Elasticsearch

Elasticsearch inside Docker needs the host kernel setting vm.max_map_count set to at least 262144. Without it, the Elasticsearch container fails to start with a confusing error, even though the cause is a single setting.

Set it temporarily, then make it permanent on Ubuntu Server:

sudo sysctl -w vm.max_map_count=262144
echo "vm.max_map_count = 262144" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

Expected output: the first command changes the value right away, and the last command confirms 262144 is read from the permanent configuration. If your host runs another operating system, find that system's way of applying sysctl parameters permanently — the value matters, not the file path.

Step 2: create the folder and the Compose file

Create the TubeArchivist project folder:

mkdir -p ~/tubearchivist
cd ~/tubearchivist

Then create a docker-compose.yml file with a text editor, for example nano docker-compose.yml, and fill it with this configuration, which follows the project's official example file. Replace the three marked values: the host address, the initial username, and both passwords:

services:
  tubearchivist:
    container_name: tubearchivist
    restart: unless-stopped
    image: bbilly1/tubearchivist
    ports:
      - 8000:8000
    volumes:
      - media:/youtube
      - cache:/cache
    environment:
      - ES_URL=http://archivist-es:9200
      - REDIS_CON=redis://archivist-redis:6379
      - TA_HOST=http://Your-VPS-IP:8000
      - TA_USERNAME=tubearchivist
      - TA_PASSWORD=your-login-password
      - ELASTIC_PASSWORD=your-elasticsearch-password
      - TZ=Asia/Jakarta
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8000/api/health/"]
      interval: 2m
      timeout: 10s
      retries: 3
      start_period: 30s
    depends_on:
      - archivist-es
      - archivist-redis
  archivist-redis:
    image: redis
    container_name: archivist-redis
    restart: unless-stopped
    expose:
      - "6379"
    volumes:
      - redis:/data
    depends_on:
      - archivist-es
  archivist-es:
    image: bbilly1/tubearchivist-es
    container_name: archivist-es
    restart: unless-stopped
    environment:
      - "ELASTIC_PASSWORD=your-elasticsearch-password"
      - "ES_JAVA_OPTS=-Xms1g -Xmx1g"
      - "xpack.security.enabled=true"
      - "discovery.type=single-node"
      - "path.repo=/usr/share/elasticsearch/data/snapshot"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - es:/usr/share/elasticsearch/data
    expose:
      - "9200"
volumes:
  media:
  cache:
  redis:
  es:

What each service does: tubearchivist is the main application with the official image bbilly1/tubearchivist, serving the web interface on port 8000, storing media in the media volume mounted at /youtube, and cache in the cache volume. archivist-redis uses the redis image and holds the queue for download and indexing jobs; its port 6379 is only exposed inside the Compose network, not to the host, so it needs no outside opening. archivist-es uses the image bbilly1/tubearchivist-es and stores the search index in the es volume; the Elasticsearch password in this service must match ELASTIC_PASSWORD in the main service exactly, because the two authenticate against each other.

Two notes from the official example file: the image bbilly1/tubearchivist-es is only available for the amd64 architecture; if your VPS uses another architecture, swap in the official Elasticsearch image at the version named in the project's example file, and check its release notes. Also, the variable TA_HOST must hold the full address you will type in the browser, protocol and port included, because TubeArchivist uses it to build internal links.

Step 3: start the stack and wait until it is healthy

Start all three containers:

docker compose up -d
docker compose ps
docker compose logs -f tubearchivist

Expected output: all three containers show as running, and the TubeArchivist logs show the application starting to serve. Press Ctrl+C to leave the log view. Do not panic if the web interface does not open at once — Elasticsearch takes time to start, and TubeArchivist depends on it. The Compose file above already includes a healthcheck against the endpoint http://localhost:8000/api/health/ inside the container, so a healthy status in docker compose ps is a more trustworthy signal than guessing from waiting time.

Open a browser and visit http://Your-VPS-IP:8000, then log in with the username and password from TA_USERNAME and TA_PASSWORD in the Compose file. Expected output: the TubeArchivist dashboard opens, empty but working — no channels yet, no videos yet, and that is normal.

The diagram above sums up the flow: channel subscriptions enter the Redis queue, yt-dlp downloads save files to the media volume, metadata is indexed by Elasticsearch, and the web interface on port 8000 serves search results and the video player from that index.

Step 4: subscribe to a channel, queue, and schedule

Start with one channel whose videos are your own work or freely licensed, not dozens of channels at once. Open the Channels page, add that channel as a subscription, then open the Downloads page and press Rescan subscriptions. TubeArchivist will add that channel's videos to the download queue; you can mark videos you do not want as ignored, so the queue does not swell with uploads that are not relevant.

Before pressing Start download, open the Settings page and check the download format. By default TubeArchivist downloads the best quality available, which may not play in every browser. For broad compatibility, the project itself gives an example format such as bestvideo[vcodec*=avc1]+bestaudio[acodec*=mp4a]/mp4. Pick a format that fits your devices, save it, then start the download from the Downloads page.

Once the first download finishes, set the schedule so the archive does not stop at one manual run. In Settings, arrange subscription rescans and automatic downloads to match your channel's rhythm: a channel that uploads weekly does not need an hourly rescan, while a daily channel needs a tighter schedule. A sensible schedule saves bandwidth and keeps the queue short, because new videos arrive a few at a time instead of piling up by the hundreds.

Expected output: a finished download appears on the video page with its title, thumbnail, and searchable metadata. Try searching for one word from that video's title or description — if the video shows up, the Elasticsearch index is working, not just the file sitting on disk.

Step 5: maintain the archive — disk space, watched state, and playlists

A healthy video archive is maintained, not left to pile up. Mark videos you have watched using the watched-state checkbox in the interface, so you always know what is still unseen. Create user playlists for a series or a topic, so a large archive stays explorable without relying on memory.

Check disk space regularly:

docker system df
df -h

Expected output: you see Docker volume usage and host disk usage before either approaches its limit. When disk runs short, delete videos you no longer need from the TubeArchivist interface, not by deleting files straight from the volume — deleting through the interface also cleans up the index entries, so search does not show videos whose files are gone.

Common errors and fixes

SymptomLikely causeFix
Elasticsearch fails to start, and the log mentions vm.max_map_countThe host kernel setting is too lowRun sudo sysctl -w vm.max_map_count=262144 and make it permanent in /etc/sysctl.conf
Elasticsearch errors about being unable to write to its data volumeElasticsearch volume permissions do not matchStop the stack, run chown 1000:0 -R on the Elasticsearch volume path, then start again
VPS-IP:8000 will not openOne container is not healthy yet, or port 8000 is already takenRun docker compose ps and docker compose logs tubearchivist; if there is a port conflict, change the mapping to 9000:8000 and open port 9000
Search does not find a video that was already downloadedThe Elasticsearch index is not finished, or the Elasticsearch service has a problemWait for indexing to finish, check the archivist-es logs, and make sure disk usage has not passed the 95% threshold
The download queue stalls or fails across the boardA problem at the video source, or a format your browser cannot playCheck the download job logs, adjust the download format in Settings, and try one video first before queueing many
Login is rejected even though the password looks rightTA_USERNAME or TA_PASSWORD was mistyped in the Compose fileRecheck the Compose file, recreate the containers with docker compose up -d, and log in again

Updating TubeArchivist

Since media, cache, and the index live in volumes, updating means pulling the newest images and recreating the containers:

cd ~/tubearchivist
docker compose pull
docker compose up -d
docker compose ps

Expected output: all three containers return to running status, and the archive, subscriptions, and index stay intact. Always read the release notes before updating, because this project sometimes adds new environment variables or changes the recommended Elasticsearch version — an update skipped too far ahead may no longer be supported smoothly. Do not delete the media, cache, or es volumes when updating.

Summary

PartValue used
Main imagebbilly1/tubearchivist
Elasticsearch imagebbilly1/tubearchivist-es (amd64 only)
Queue imageredis
Web interface port8000
Media volumemedia:/youtube
Cache volumecache:/cache
ElasticsearchES_URL=http://archivist-es:9200, discovery.type=single-node
RedisREDIS_CON=redis://archivist-redis:6379
Kernel settingvm.max_map_count=262144
Memory guidanceAround 2 GB for a small setup, 4 GB for mid-to-large
Restartunless-stopped

Final checklist

  • ☐ The setting vm.max_map_count=262144 is active and permanent on the host.
  • ☐ All three containers (tubearchivist, archivist-redis, archivist-es) show as running.
  • ☐ The initial login with TA_USERNAME and TA_PASSWORD succeeds on port 8000.
  • ☐ One channel whose videos are your own work or freely licensed is subscribed.
  • ☐ One video finishes downloading and is findable through search.
  • ☐ Rescan and automatic download schedules are set in Settings.
  • ☐ Disk space is monitored, well away from the 95% threshold that locks the index.
  • ☐ The media, cache, and es volumes are part of your backup plan.

Which of your own videos would you most hate to lose from a platform, and how often does that channel upload? Share it in the comments — the answer decides the rescan schedule that makes the most sense for your archive.

Read also: the Rnevio article "Jellyfin: Media Server Pribadi Gratis, Nonton Koleksi Sendiri di Mana Saja" covers serving a media collection from your own server, while the paired guide in this batch is available at a Navidrome guide for a personal music server on a VPS.

Diskusi

Ada pertanyaan atau pengalaman yang ingin dibagikan?

0komentar

Komentar ditinjau sebelum ditampilkan. Mari berdiskusi dengan sopan dan sesuai topik.