# How to install yt-dlp and ffmpeg on Mac, Windows, and Linux

Install yt-dlp and ffmpeg together with Homebrew, winget, or apt on macOS, Windows, and Linux - the exact commands, version checks, and the PATH mistakes that trip people up.

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](/install) 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.

```bash
yt-dlp --version
ffmpeg -version
```

## macOS

```bash
brew install yt-dlp ffmpeg

yt-dlp --version
ffmpeg -version
```

Homebrew is the simplest path. If yt-dlp downloads basic files but audio extraction fails later, ffmpeg is usually the missing piece.

## Windows

```bash
winget install --id yt-dlp.yt-dlp -e
winget install --id Gyan.FFmpeg -e

yt-dlp --version
ffmpeg -version
```

If 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

```bash
python3 -m pip install -U "yt-dlp[default]"
sudo apt install ffmpeg

yt-dlp --version
ffmpeg -version
```

Package-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:

```bash
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:

```bash
yt-dlp -v --simulate "URL" 2>&1 | grep "JS runtimes"
# [debug] JS runtimes: deno-2.9.8
```

`JS 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](/guides/yt-dlp-docker-js-runtime). If the warning persists with a runtime installed, see [fix nsig extraction failed](/guides/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:

```dockerfile
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](/guides/update-yt-dlp) covers scheduling it). A current install can still be blocked from datacenter IPs, which the [server guide](/guides/run-yt-dlp-server) covers. If the downloads are part of an app and you'd rather not maintain this image, [Importly](https://www.importly.io/?utm_source=ytdlp.org&utm_medium=referral&utm_campaign=doc-cta&utm_content=install-server&utm_term=%2Fguides%2Finstall-yt-dlp) 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"](/guides/fix-ffmpeg-not-found).

## Fast install sanity check

```bash
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.

<Faq />

<DocCta variant="default" />

## Related guides

- [Install & update yt-dlp (quick per-OS reference)](/install)
- [Update yt-dlp](/guides/update-yt-dlp)
- [Fix ffmpeg not found](/guides/fix-ffmpeg-not-found)
- [Fix common yt-dlp errors](/guides/fix-yt-dlp-errors)
- [Browse commands](/guides/yt-dlp-commands)
- [yt-dlp vs youtube-dl](/guides/yt-dlp-vs-youtube-dl)