-
Universal Support Works with YouTube, Twitch, Vimeo, SoundCloud, and thousands of other sites.
-
Zero Database
No state, no queues, just files on disk. -
Optional Security
HTTP Basic Auth (browser-native).
If credentials are set, the UI, API, and downloads are protected. -
Modern UI
Simple dashboard with real-time terminal logs (SSE). -
In-App Update Notice Optional release notification card in the UI so operators can spot newer versions quickly.
-
Flexible Formats
- Best video + audio → MP4
- Audio-only extraction → MP3
-
Release-Baked yt-dlp Official images are built with a fresh yt-dlp binary at release time, and local source builds can refresh it again when you use
--build.
| Variable | Description |
|---|---|
PORT |
Port to run on (default: 3002) |
BASIC_AUTH_USER |
Username for Basic Auth (optional) |
BASIC_AUTH_PASS |
Password for Basic Auth (optional) |
OUTPUT_DIR |
Download directory (default: /data/downloads) |
PUBLIC_BASE_URL |
Public domain (e.g. https://mediafetch.example.com) Required to generate download links |
MAX_CONCURRENT_JOBS |
Maximum simultaneous yt-dlp jobs (default: 2) |
JOB_TIMEOUT_MS |
Per-job timeout in milliseconds (default: 600000) |
VERSION_CHECK_TTL_MS |
Cache duration for release checks in milliseconds (default: 21600000) |
Update checks are built in and always use the official MediaFetch release channel.
| GITHUB_REPO | GitHub repository used for update checks (default: lukedunsmoto/mediafetch) |
Update checks are built in and always use the official MediaFetch release channel.
Note
IfBASIC_AUTH_USERandBASIC_AUTH_PASSare not set, authentication is disabled (useful for local dev).
git clone https://github.com/lukedunsmoto/mediafetch.git
cd mediafetch
cp .env.example .env
# Uses the published MediaFetch image
docker compose up -dIf you want to build from source locally instead:
docker compose up -d --buildThen open your browser at:
http://localhost:3002
- Mount a volume to
/data/downloadsto persist files - Set
PUBLIC_BASE_URLto your real domain when running behind a proxy - Works cleanly with Traefik, Dokploy, Coolify, or raw Docker
Starts a download job and streams logs via Server-Sent Events (SSE).
Body
{
"url": "https://example.com/video",
"mode": "video | audio",
"filename": "optional-custom-name"
}Simple health check.
Returns current version, latest known release version, and updateAvailable status for the UI update card.
If you encounter HTTP Error 403: Forbidden (common on YouTube) or need to download from premium sites that require a login, you can pass your browser cookies to MediaFetch.
1. Get your cookies
- Install a "Get cookies.txt LOCALLY" extension for Chrome or Firefox.
- Log into the site (e.g., YouTube) in your browser.
- Export the cookies and save the file as
cookies.txtin your project folder.
2. Enable them in Docker
- Add the volume line in
docker-compose.yml:volumes: - ./downloads:/data/downloads - ./cookies.txt:/app/cookies.txt
- Restart the container:
docker compose up -d
Security Warning Never share your
cookies.txtfile or commit it to Git. It contains your personal session data. MediaFetch is designed to read this file locally only.
MIT License
Core Power:
- yt-dlp
- ffmpeg
Happy fetching.
