youtube-dl NAS Guides

Installation, operations, and mobile sharing guides for youtube-dl-nas

View the Project on GitHub hyeonsangjeon/youtube-dl-nas

Install, Upgrade, and Troubleshoot

This is the operational path for a normal Docker or NAS installation. It keeps downloads and application state outside the container so an image update does not discard either one.

Install With Docker Compose

Docker Compose is the recommended deployment method.

git clone https://github.com/hyeonsangjeon/youtube-dl-nas.git
cd youtube-dl-nas
cp .env.example .env

Edit .env and set at least MY_ID and MY_PW. Review these paths before the first start:

Validate and start the deployment:

docker compose config
docker compose pull
docker compose up -d
docker compose ps

Open http://<nas-address>:<WEB_PORT> and sign in with the configured ID and password. Use HTTPS before exposing the dashboard outside a trusted network.

For Compose secrets, mount one file per value and set MY_ID_FILE, MY_PW_FILE, YDLNAS_API_TOKEN_FILE, or YDLNAS_WEBHOOK_URL_FILE to its container path. Direct environment variables remain the default and take precedence when both forms are configured. A requested secret file must be a readable, non-empty regular file; startup errors identify only the variable and never print its contents.

Upgrade

Back up or snapshot DOWNLOAD_DIR and CONFIG_DIR before changing an image or deployment configuration. Then update the checked-out deployment and recreate the container:

git pull --ff-only
docker compose pull
docker compose up -d
docker compose ps
docker compose logs --tail=100 youtube-dl-nas

The default Compose file follows modenaf360/youtube-dl-nas:latest. To control upgrade timing, replace latest in compose.yaml with a tag from the release page and run the same pull and up commands. Keep both persistent mounts unchanged.

Upgrading To 26.1105

From 26.1029, keep the same environment and both mounts. The library layout and subtitle search need no manual migration, database, LLM endpoint, or API key. Existing files, history dates, collections and connection permissions remain. New dashboard-issued AI tokens default to read-only; select download access explicitly for a new client that should queue work. Startup/hourly yt-dlp updates and startup nlptutti updates remain enabled by default.

After recreating the container, check /health for version 26.1105, sign in, confirm the library count, and try Files & History → Subtitles with a word known to occur in a saved subtitle. A mounted file’s date is its modification date, not a reconstructed download date. The dashboard guide explains search coverage and the MCP guide covers client setup.

If health or stored state fails validation, stop the new container and recreate the previous pinned image with the same mounts and settings. Keep a pre-upgrade state backup; do not delete volumes as a troubleshooting step.

Troubleshooting Checklist

Container Does Not Start

Validate resolved settings and inspect recent logs:

docker compose config
docker compose ps
docker compose logs --tail=200 youtube-dl-nas

Confirm that MY_ID and MY_PW are set in .env and that another service is not already using WEB_PORT.

Downloads Or State Disappear

Confirm the host paths behind /downfolder and /usr/src/app/metadata still point to the intended persistent directories. The first mount holds media; the second holds queue and history state. Recreating a container is safe only when both mounts are preserved.

Inspect the mounted paths and available space:

docker compose exec youtube-dl-nas sh -lc \
  'id; df -h /downfolder /usr/src/app/metadata; ls -ld /downfolder /usr/src/app/metadata'

If the directories are not writable, align PUID, PGID, and host-folder permissions with the account that owns the mounted paths.

A Source Stops Downloading

Pull the newest image first. The container also updates yt-dlp at startup and on its configured schedule, but some sources can still require cookies, a proxy, or a later upstream extractor fix. A signed-in administrator can manage a bounded Netscape cookies file under dashboard Options. An external YTDLP_COOKIES_FILE mount remains the read-only alternative. Check cookies, PROXY, and YTDLP_EXTRA_ARGS only when the source requires them.

New requests accept only HTTP(S) sources that resolve to public-network addresses. This prevents an exposed dashboard credential from turning the NAS into a private-network fetcher. If the intended media source is hosted on a trusted internal address, set YDLNAS_ALLOW_PRIVATE_SOURCES=true explicitly and restrict dashboard access to trusted users.

Do not post private URLs, cookies, passwords, API tokens, or complete browser headers in logs or issues.

Login Or Mobile Sharing Fails

Use the full dashboard base URL, including the port and any reverse-proxy path. Set COOKIE_SECURE=true only when the dashboard is served exclusively over HTTPS. Mobile shares travel directly from the phone to the NAS; GitHub Pages hosts only the setup guide and import files.

Repeated failed sign-ins from one address are slowed down automatically: five free attempts, then delays that double from 10 seconds up to 5 minutes. The sign-in page and the REST id/pw path answer with HTTP 429 and the remaining wait; Bearer tokens and MCP connections are not throttled. Dashboard sessions expire after YDLNAS_SESSION_MAX_AGE_DAYS (default 30) days without use and whenever the configured ID or password changes, so shared phones sign in again after a credential change.

Behind a reverse proxy, set YDLNAS_TRUSTED_PROXIES to the proxy address so each real client gets its own sign-in limit; otherwise every user behind that proxy shares one limit and repeated failures from one of them delay all of them. Dashboard actions require the browser’s Origin to match the address the NAS sees. Proxies that forward Host or X-Forwarded-Host/X-Forwarded-Proto need nothing else; for a proxy that cannot, list the public address in YDLNAS_TRUSTED_ORIGINS.

See the mobile sharing guide for Android PWA, Android local HTTP, and iPhone/iPad setup.

Notifications Do Not Arrive

Run docker exec <container> python /usr/src/app/webhooks.py --test. It prints each configured host, its detected format, and the HTTP status or not delivered. The container log shows [webhook] lines with the host only; the URL itself is never printed. A Telegram URL needs ?chat_id=, and a self-hosted ntfy or Slack-compatible server needs a ntfy+ or slack+ prefix unless its JSON payload is acceptable. HTTP 301 redirect means the address moved, often from http:// to https://; configure the final URL. A misspelled name in YDLNAS_WEBHOOK_EVENTS is reported as ignored, and --test prints the events that remain.

Report A Reproducible Problem

Search existing issues before opening a new report. If the problem remains, use the bug report form and include:

For feature ideas, use the feature request form.