Self-hosted video downloader for YouTube and other sites (web UI for yt-dlp)
Self-hosted video downloader for YouTube and other sites (web UI for yt-dlp)
MeTube is a self-hosted web UI for yt-dlp, for downloading media from YouTube and dozens of other sites. Docker images are multi-arch (amd64/arm64).
Key capabilities:
docker run -d -p 8081:8081 -v /path/to/downloads:/downloads ghcr.io/alexta69/metube
services:
metube:
image: ghcr.io/alexta69/metube
container_name: metube
restart: unless-stopped
ports:
- "8081:8081"
volumes:
- /path/to/downloads:/downloads
Certain values can be set via environment variables, using the -e parameter on the docker command line, or the environment: section in Docker Compose.
1000 (legacy UID also supported).1000 (legacy GID also supported).022.light, dark, or auto. Defaults to auto.DEBUG, INFO, WARNING, ERROR, CRITICAL, or NONE. Defaults to INFO.false.5, then at most five downloads will run concurrently, and any additional downloads will wait until one of the active downloads completes. Defaults to 3.true, downloaded files are deleted on the server, when they are trashed from the "Completed" section of the UI. Defaults to false.0 (no limit).60.50.50000.0 (disabled)./downloads in the Docker image, and . otherwise.DOWNLOAD_DIR.true.true.(^|/)[.@].*$, which means directories starting with . or @.true, the download directories (DOWNLOAD_DIR and AUDIO_DOWNLOAD_DIR) are indexable on the web server. Defaults to false.queue.json, pending.json, completed.json, subscriptions.json). Defaults to /downloads/.metube in the Docker image, and . otherwise./downloads in the Docker image, and . otherwise.tmpfs) for better performance.false, ownership of DOWNLOAD_DIR, STATE_DIR, and TEMP_DIR (and their contents) will not be set on container start. Ensure user under which MeTube runs has necessary access to these directories already. Defaults to true.%(title)s.%(ext)s.%(title)s - %(section_number)s %(section_title)s.%(ext)s.%(playlist_title)s/%(title)s.%(ext)s. Set to empty to use OUTPUT_TEMPLATE instead.%(channel)s/%(title)s.%(ext)s. Set to empty to use OUTPUT_TEMPLATE instead.false. See Configuring yt-dlp options for details and security considerations.false, which protects against SSRF by refusing URLs that resolve to internal hosts. Set to true only in trusted environments — for example when routing traffic through a proxy/VPN client in Fake-IP mode (sing-box, Clash, Mihomo), which resolves hosts to the 198.18.0.0/15 range. Enabling this disables the SSRF protection entirely, so only use it when you control the network. You do not need this to use a proxy on an internal address: a proxy configured through the proxy option in YTDL_OPTIONS (or the *_proxy environment variables) is always reachable at its own host and port, wherever it lives.HH:MM, 24-hour) when you want the daily upgrades and MeTube restart to happen. Defaults to empty (disabled).A filename that would exceed the limit the filesystem accepts is shortened to fit, keeping its extension, with room left for the suffixes yt-dlp adds while downloading. Sites that put a long description in the title would otherwise fail the download outright with File name too long. Use trim_file_name in YTDL_OPTIONS if you want names shorter than the filesystem's own limit, or restrictfilenames to strip non-ASCII characters.
Enabling writeinfojson or writethumbnail in YTDL_OPTIONS also writes a feed-level .info.json and thumbnail when you add a playlist or channel. These reuse the template of the items they belong to — OUTPUT_TEMPLATE_CHANNEL or OUTPUT_TEMPLATE_PLAYLIST — evaluated against the feed itself, so with the defaults they land in the same folder as the videos, named after the feed. Set allow_playlist_files to false in YTDL_OPTIONS to skip them.
0.0.0.0, which is every IPv4 interface but no IPv6 one. Set it to * (or leave it empty) to listen on both stacks, or to :: for IPv6 only — :: does not also accept IPv4, whatever the host's bindv6only setting says.8081./.https instead of http (CERTFILE and KEYFILE required). Defaults to false.* allows all. When unset or empty, all cross-origin requests are denied. Required for browser extensions and bookmarklets — see Sending links to MeTube. Naming origins explicitly also lets them send credentials (a login cookie, or the Authorization header a reverse proxy checks), which * deliberately does not: it would let any site you visit drive your instance with your own session.robots.txt file mounted in the container.MeTube lets you customize how yt-dlp behaves at three levels, from broadest to most specific:
When a download starts, these layers are combined in order. If the same option appears in more than one layer, the more specific one wins: per-download overrides beat presets, and presets beat global options.
In JSON presets and overrides, setting an option to null clears that option for that download (for example, "download_archive": null overrides a global archive path so the archive is not used). This follows yt-dlp’s usual meaning of None for that option.
yt-dlp options in MeTube are expressed as JSON objects. The keys are yt-dlp API option names, which roughly correspond to command-line flags with dashes replaced by underscores. For exam