Install guide
How to install yt-dlp and ffmpeg on Mac, Windows, and Linux
A clean yt-dlp install is simple: install yt-dlp, install ffmpeg, verify both commands work, and only then move on to actual downloading. Skipping those checks is how people end up debugging the wrong problem for an hour.
Just want the shortest install or update command for your OS? The install & update page is the quick per-OS reference. This guide goes further: ffmpeg, the verification step, and the gotchas that bite later.
Quick answer
Install yt-dlp and ffmpeg together, then verify both.
yt-dlp --version
ffmpeg -versionmacOS
brew install yt-dlp ffmpeg
yt-dlp --version
ffmpeg -versionHomebrew is the simplest path. If yt-dlp downloads basic files but audio extraction fails later, ffmpeg is usually the missing piece.
Windows
winget install --id yt-dlp.yt-dlp -e
winget install --id Gyan.FFmpeg -e
yt-dlp --version
ffmpeg -versionIf the command is not recognized, restart your terminal. A lot of Windows install issues are just PATH updates not appearing in the current shell yet.
Linux
python3 -m pip install -U "yt-dlp[default]"
sudo apt install ffmpeg
yt-dlp --version
ffmpeg -versionPackage-manager versions can lag. If you need the latest extractor fixes, pip is often the safer yt-dlp install path.
YouTube also needs a JavaScript runtime
Current yt-dlp runs JavaScript to solve YouTube's challenges, and it only uses Deno by default. Without a runtime and the solver scripts, YouTube downloads come back with formats missing and a warning that says n challenge solving failed. With pip, one line installs yt-dlp, the solver scripts and Deno into the same environment:
python3 -m pip install -U "yt-dlp[default,deno]"With Homebrew or winget, install Deno next to yt-dlp (brew install deno or winget install --id DenoLand.Deno -e). Then check that yt-dlp found it. The verbose log names the runtime on its first lines:
yt-dlp -v --simulate "URL" 2>&1 | grep "JS runtimes"
# [debug] JS runtimes: deno-2.9.8JS runtimes: none means Deno isn't on the PATH yt-dlp sees. Using Node or Bun instead, and the "challenge solver script was skipped" warning, are covered in the JavaScript runtime guide. If the warning persists with a runtime installed, see fix nsig extraction failed.
On a server or in Docker
A server install needs the same three pieces: yt-dlp with its solver scripts, Deno and ffmpeg. In a Docker image:
FROM python:3.12-slim
# Deno binary from the official image; yt-dlp enables deno by default
COPY --from=denoland/deno:bin /deno /usr/local/bin/deno
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir -U "yt-dlp[default]"Rebuild the image often: an old yt-dlp is the most common reason a server stops downloading (update yt-dlp covers scheduling it). A current install can still be blocked from datacenter IPs, which the server guide covers. If the downloads are part of an app and you'd rather not maintain this image, Importly is a hosted API that takes the link from your backend and returns the file, transcript or metadata. It's free to try, no card required.
Why you install ffmpeg for yt-dlp
yt-dlp downloads streams; ffmpeg is what stitches them together. YouTube serves the highest quality as separate video and audio streams, and yt-dlp needs ffmpeg to merge them into one file. It's also required for extracting audio to MP3/M4A and for embedding thumbnails or subtitles. That's why every command above installs both in one go. If downloads work but come out video-only or audio-only, a missing ffmpeg is almost always the reason — see Fix "ffmpeg not found".
Fast install sanity check
yt-dlp -F "https://www.youtube.com/watch?v=BaW_jenozKc"If this returns format information, your install is basically working. If not, the problem is usually PATH, environment mismatch, or missing ffmpeg.
The mistake to avoid
Do not move straight into platform-specific troubleshooting before confirming the install itself works. If version checks and the basic format listing fail, fix the install first.
Frequently asked questions
Does yt-dlp need ffmpeg?
For basic downloads of a single pre-merged file, no. But you need ffmpeg for most real use: merging the separate high-quality video and audio streams YouTube serves, extracting or converting audio (MP3/M4A), and embedding thumbnails or subtitles. Install it alongside yt-dlp and you avoid a whole class of 'it downloaded but the audio is missing' problems.
How do I install ffmpeg for yt-dlp?
Use the same package manager as yt-dlp. On macOS: brew install yt-dlp ffmpeg. On Windows: winget install Gyan.FFmpeg. On Linux: sudo apt install ffmpeg (or your distro's equivalent). Then run ffmpeg -version to confirm it's on your PATH - yt-dlp finds ffmpeg automatically when it is.
What's the one-line way to install yt-dlp and ffmpeg with Homebrew?
brew install yt-dlp ffmpeg installs both in a single command on macOS. Homebrew keeps them on your PATH, so yt-dlp --version and ffmpeg -version should both work immediately in a new terminal.
Why does my terminal say 'yt-dlp' is not recognized as a command?
The install worked but the binary isn't on your PATH yet, or the current shell started before the install finished. Close and reopen the terminal first. If it still fails, check where the binary landed (which yt-dlp on macOS/Linux, where yt-dlp on Windows) and make sure that directory is on your PATH.
For builders
Using yt-dlp inside an app or script?
Paste a link to see what a managed media-import API returns — no install, no signup.
Building this into an app? See the API your backend calls instead