MeTube is a self-hosted web UI for yt-dlp, for downloading media from YouTube and dozens of other sitesβ .
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.
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.HH:MM, 24-hour) when you want the daily upgrades and MeTube restart to happen. Defaults to empty (disabled).0.0.0.0 (all interfaces).8081./.https instead of http (CERTFILE and KEYFILE required). Defaults to false.* to allow all origins. This must be configured for browser extensionsβ , bookmarkletsβ , and any other browser-based tools that contact MeTube from a different origin. For browser extensions use * (see below); for bookmarklets you can list specific sites, e.g. https://www.youtube.com,https://www.vimeo.com.robots.txt file mounted in the container.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.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 example, the command-line flag --write-subs becomes "writesubtitles": true in JSON.
Tip: Some command-line flags don't have a direct single-key equivalent β for instance,
--embed-thumbnailand--recode-videomust be expressed via"postprocessors". A full list of available API options can be found in the yt-dlp sourceβ , and this conversion scriptβ can help translate command-line flags to their API equivalents.
Global options form the baseline for every download. There are two ways to define them, and you can use either or both:
Inline via environment variable (YTDL_OPTIONS) β pass a JSON object directly:
environment:
- 'YTDL_OPTIONS={"writesubtitles": true, "subtitleslangs": ["en", "de"], "updatetime": false, "writethumbnail": true}'
Via a JSON file (YTDL_OPTIONS_FILE) β mount a file into the container and point to it:
volumes:
- /path/to/ytdl-options.json:/config/ytdl-options.json
environment:
- YTDL_OPTIONS_FILE=/config/ytdl-options.json
where ytdl-options.json contains:
{
"writesubtitles": true,
"subtitleslangs": ["en", "de"],
"updatetime": false,
"writethumbnail": true
}
The file is monitored for changes and reloaded automatically β no container restart needed. If you use both methods and they define the same key, the file takes precedence.
Presets let you define named bundles of options that appear in the web UI under Advanced Options as "Option Presets". Users can select one or more presets per download, making it easy to apply common option combinations without editing global settings.
Like global options, presets can be set inline or via a file:
YTDL_OPTIONS_PRESETS β a JSON object where each key is a preset name and its value is a set of yt-dlp options.YTDL_OPTIONS_PRESETS_FILE β path to a JSON file containing presets, monitored and reloaded on changes.If both are used and they define a preset with the same name, the file's version takes precedence.
Example β a presets file defining three presets:
{
"sponsorblock": {
"postprocessors": [
{ "key": "SponsorBlock", "categories": ["sponsor", "selfpromo", "interaction"] },
{ "key": "ModifyChapters", "remove_sponsor_segments": ["sponsor", "selfpromo", "interaction"] }
]
},
"embed-subs": {
"writesubtitles": true,
"writeautomaticsub": true,
"subtitleslangs": ["en", "de"],
"postprocessors": [{ "key": "FFmpegEmbedSubtitle" }]
},
"limit-rate": {
"ratelimit": 5000000
}
}
This makes three presets available in the UI:
When multiple presets are selected for a download, they are applied in order. If two presets set the same option, the later one wins.
For one-off tweaks, MeTube can expose a free-text JSON field in the UI ("Custom yt-dlp Options") where users type yt-dlp options that apply only to that single download. This is disabled by default:
environment:
- ALLOW_YTDL_OPTIONS_OVERRIDES=true
Once enabled, the field appears under Advanced Options. Any options entered there take the highest priority, overriding both global options and selected presets.
β οΈ Security note: Enabling this allows arbitrary yt-dlp API options to be supplied by anyone with access to the UI. Depending on the options used, this may enable arbitrary command execution inside the container. Enable only in trusted environments.
When a download starts, the final set of yt-dlp options is built in this order:
YTDL_OPTIONS / YTDL_OPTIONS_FILE).MeTube always forces its own flat-extract behaviour during the initial metadata fetch (extract_flat, noplaylist, etc.); presets cannot override those keys for that phase.
Example: Suppose your global options set "writesubtitles": false, but you select a preset that sets "writesubtitles": true. Subtitles will be written for that download because the preset overrides the global setting. If you additionally enter {"writesubtitles": false} in the per-download overrides field, that value wins and subtitles will not be written.
The project's Wiki contains examples of useful configurations contributed by users of MeTube:
In case you need to use your browser's cookies with MeTube, for example to download restricted or private videos:
cookies.txt.Browser extensions allow right-clicking videos and sending them directly to MeTube. If you're on an HTTPS page, your MeTube instance must be behind an HTTPS reverse proxy (see below) for extensions to work.
Since browser extensions make requests from their own origin (chrome-extension://... or moz-extension://...), you must set CORS_ALLOWED_ORIGINS=* for them to work.
Chrome: contributed by Rpslβ . You can install it from Google Chrome Webstoreβ or use developer mode and install from sourcesβ .
Firefox: contributed by nanocortexβ . You can install it from Firefox Addonsβ or get sources from hereβ .
rithaskβ created an iOS shortcut to send URLs to MeTube from Safari. Enter the MeTube instance address when prompted which will be saved for later use. You can run the shortcut from Safariβs share menu. The shortcut can be downloaded from this iCloud linkβ .
kushfestβ has created a Chrome bookmarklet for sending the currently open webpage to MeTube. Please note that if you're on an HTTPS page, your MeTube instance must be configured with HTTPS as true in the environment, or be behind an HTTPS reverse proxy (see below) for the bookmarklet to work.
Since bookmarklets run in the context of the current page (e.g. youtube.com), the requests they make to MeTube are cross-origin. You must add the origins of sites where you use the bookmarklet to the CORS_ALLOWED_ORIGINS environment variable, otherwise the browser will block the requests. For example, to use the bookmarklet on YouTube and Vimeo: CORS_ALLOWED_ORIGINS=https://www.youtube.com,https://www.vimeo.com.
GitHub doesn't allow embedding JavaScript as a link, so the bookmarklet has to be created manually by copying the following code to a new bookmark you create on your bookmarks bar. Change the hostname in the URL below to point to your MeTube instance.
javascript:!function(){xhr=new XMLHttpRequest();xhr.open("POST","https://metube.domain.com/add");xhr.withCredentials=true;xhr.send(JSON.stringify({"url":document.location.href,"quality":"best"}));xhr.onload=function(){if(xhr.status==200){alert("Sent to metube!")}else{alert("Send to metube failed. Check the javascript console for clues.")}}}();
shoonya75β has contributed a Firefox version:
javascript:(function(){xhr=new XMLHttpRequest();xhr.open("POST","https://metube.domain.com/add");xhr.send(JSON.stringify({"url":document.location.href,"quality":"best"}));xhr.onload=function(){if(xhr.status==200){alert("Sent to metube!")}else{alert("Send to metube failed. Check the javascript console for clues.")}}})();
The above bookmarklets use alert() for notifications. This variant shows a toast instead (Chrome β for Firefox, replace the !function(){...}() wrapper with (function(){...})()):
javascript:!function(){function notify(msg) {var sc = document.scrollingElement.scrollTop; var text = document.createElement('span');text.innerHTML=msg;var ts = text.style;ts.all = 'revert';ts.color = '#000';ts.fontFamily = 'Verdana, sans-serif';ts.fontSize = '15px';ts.backgroundColor = 'white';ts.padding = '15px';ts.border = '1px solid gainsboro';ts.boxShadow = '3px 3px 10px';ts.zIndex = '100';document.body.appendChild(text);ts.position = 'absolute'; ts.top = 50 + sc + 'px'; ts.left = (window.innerWidth / 2)-(text.offsetWidth / 2) + 'px'; setTimeout(function () { text.style.visibility = "hidden"; }, 1500);}xhr=new XMLHttpRequest();xhr.open("POST","https://metube.domain.com/add");xhr.send(JSON.stringify({"url":document.location.href,"quality":"best"}));xhr.onload=function() { if(xhr.status==200){notify("Sent to metube!")}else {notify("Send to metube failed. Check the javascript console for clues.")}}}();
dotvhsβ has created an extension for Raycastβ for adding videos to MeTube directly from Raycast.
It's possible to configure MeTube to listen in HTTPS mode. docker-compose example:
services:
metube:
image: ghcr.io/alexta69/metube
container_name: metube
restart: unless-stopped
ports:
- "8081:8081"
volumes:
- /path/to/downloads:/downloads
- /path/to/ssl/crt:/ssl/crt.pem
- /path/to/ssl/key:/ssl/key.pem
environment:
- HTTPS=true
- CERTFILE=/ssl/crt.pem
- KEYFILE=/ssl/key.pem
MeTube can also run behind a reverse proxy for HTTPS termination or authentication. When serving under a subdirectory, set URL_PREFIX accordingly.
The linuxserver/swagβ image includes ready-made snippets for MeTube in subfolderβ and subdomainβ modes, plus Authelia for authentication.
location /metube/ {
proxy_pass http://metube:8081;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
Note: the extra proxy_set_header directives are there to make WebSocket work.
Contributed by PIE-ytβ . Source hereβ .
# For putting in your Apache sites site.conf
# Serves MeTube under a /metube/ subdir (http://yourdomain.com/metube/)
<Location /metube/>
ProxyPass http://localhost:8081/ retry=0 timeout=30
ProxyPassReverse http://localhost:8081/
</Location>
<Location /metube/socket.io>
RewriteEngine On
RewriteCond %{QUERY_STRING} transport=websocket [NC]
RewriteRule /(.*) ws://localhost:8081/socket.io/$1 [P,L]
ProxyPass http://localhost:8081/socket.io retry=0 timeout=30
ProxyPassReverse http://localhost:8081/socket.io
</Location>
The following example Caddyfile gets a reverse proxy going behind caddyβ .
example.com {
route /metube/* {
uri strip_prefix metube
reverse_proxy metube:8081
}
}
MeTube is powered by yt-dlpβ , which requires frequent updates as video sites change their layouts. A new MeTube Docker image is published automatically when a new yt-dlp stable release is available, so keep your container up to date β watchtowerβ works well for this. To follow yt-dlp's nightly channel instead, set YTDL_NIGHTLY_UPDATE_TIME.
MeTube is only a UI for yt-dlpβ . Issues with authentication, postprocessing, permissions, or YTDL_OPTIONS should be debugged with yt-dlp directly first β once working, import those options into MeTube. To test inside the container:
docker exec -ti metube sh
cd /downloads
MeTube development relies on community contributions. If you need additional features, please submit a PR. Create an issue first to discuss the implementation β some PRs may not be accepted to reduce bloat. Feature requests without an accompanying PR are unlikely to be fulfilled.
Make sure you have Node.js 22+ and Python 3.13 installed.
# install Angular and build the UI
cd ui
curl -fsSL https://get.pnpm.io/install.sh | sh -
pnpm install
pnpm run build
# install python dependencies
cd ..
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync
# run
uv run python3 app/main.py
A Docker image can be built locally (it will build the UI too):
docker build -t metube .
Note that if you're running the server in VSCode, your downloads will go to your user's Downloads folder (this is configured via the environment in .vscode/launch.json).
Content type
Image
Digest
sha256:f53bb5229β¦
Size
305.5 MB
Last updated
2 months ago
docker pull aashumalik784/metube