Updated: 4 November 2026 · Applies to: yt-dlp 2026.08.19 with deno 2.9 and ffmpeg on Ubuntu 24.04 (tested end to end), AlmaLinux 9 and 10 (install tested); Debian 13 and Ubuntu 26.04 package versions checked

To download a YouTube video on Ubuntu or any Linux server, install yt-dlp and run yt-dlp "VIDEO_URL". yt-dlp is the maintained replacement for youtube-dl, whose last official release is 2021.12.17 and which no longer keeps up with YouTube. Almost every youtube-dl option works the same in yt-dlp, so old commands only need the new program name.

yt-dlp "https://www.youtube.com/watch?v=VIDEO_ID"

Only download videos you have the right to save, and respect each site's terms of use.

Install yt-dlp on Ubuntu and Debian

  1. Install Python 3, curl, unzip and ffmpeg (ffmpeg joins the separate video and audio streams that YouTube sends):
    sudo apt update
    sudo apt install python3 curl unzip ffmpeg
  2. Download the official program and make it executable:
    sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
    sudo chmod a+rx /usr/local/bin/yt-dlp
  3. Install deno, the JavaScript runtime yt-dlp uses for full YouTube support (it is the only one yt-dlp enables by default):
    curl -fsSL https://deno.land/install.sh | sudo env DENO_INSTALL=/usr/local sh -s -- -y
  4. Check both:
    $ yt-dlp --version
    2026.08.19
    $ deno --version
    deno 2.9.7 (stable, release, x86_64-unknown-linux-gnu)

Without deno, yt-dlp still runs but warns: WARNING: [youtube] No supported JavaScript runtime could be found. Only deno is enabled by default, and some formats may be missing. If Node.js 22 or later is already installed, you can use it instead with --js-runtimes node.

Install on AlmaLinux and Rocky Linux

ffmpeg comes from EPEL as ffmpeg-free. On version 9 it also needs the CRB repository; without it, dnf failed with nothing provides ladspa needed by rubberband.

sudo dnf install epel-release
sudo dnf config-manager --set-enabled crb      # version 9 only
sudo dnf install ffmpeg-free unzip

On AlmaLinux and Rocky 10 (Python 3.12), use the same yt-dlp download as above. Version 9 ships Python 3.9, which yt-dlp no longer supports (ImportError: You are using an unsupported version of Python. Only Python versions 3.10 and above are supported by yt-dlp), so download the standalone build there instead. It needs no Python:

sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux -o /usr/local/bin/yt-dlp
sudo chmod a+rx /usr/local/bin/yt-dlp

On ARM64 servers, use yt-dlp_linux_aarch64. For more on ffmpeg itself, see how to install FFmpeg on Linux.

Why not apt install yt-dlp?

The distribution packages lag behind: Ubuntu 24.04 offers 2024.04.09, Debian 13 2025.04.30 and Ubuntu 26.04 2026.03.17. YouTube changes often, and in our test the Ubuntu 24.04 package could no longer read a video at all:

WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
ERROR: [youtube] jNQXAC9IVRw: No video formats found!

It also cannot update itself (ERROR: As yt-dlp has been installed via apt, you should use that to update.). If you installed it, remove it with sudo apt remove yt-dlp and use the official download.

Download a video

Put the address in quotes, because characters such as & in it would otherwise be read by the shell. By default yt-dlp picks the best video and the best audio and merges them:

$ yt-dlp "https://www.youtube.com/watch?v=jNQXAC9IVRw"
[youtube] Extracting URL: https://www.youtube.com/watch?v=jNQXAC9IVRw
[youtube] jNQXAC9IVRw: Downloading webpage
[info] jNQXAC9IVRw: Downloading 1 format(s): 395+251
[download] Destination: Me at the zoo [jNQXAC9IVRw].f395.mp4
[download] 100% of  218.53KiB in 00:00:00 at 428.09KiB/s
[download] Destination: Me at the zoo [jNQXAC9IVRw].f251.webm
[download] 100% of  246.27KiB in 00:00:00 at 483.35KiB/s
[Merger] Merging formats into "Me at the zoo [jNQXAC9IVRw].webm"

(Progress lines shortened.) The file name follows the default template %(title)s [%(id)s].%(ext)s, and the file lands in the current directory.

Useful yt-dlp commands

yt-dlp -F "URL"                              # list all available formats
yt-dlp -t mp4 "URL"                          # MP4 (H.264 and AAC), plays everywhere
yt-dlp -f "bv*[height<=1080]+ba/b" "URL"     # best quality up to 1080p
yt-dlp -t mp3 "URL"                          # audio only, as MP3
yt-dlp -x --audio-format m4a "URL"           # audio only, other format
yt-dlp -o "%(title)s.%(ext)s" "URL"          # your own file name
yt-dlp -P ~/Videos "URL"                     # save into another folder
yt-dlp --restrict-filenames "URL"            # ASCII names without spaces
yt-dlp "https://www.youtube.com/playlist?list=PLAYLIST_ID"   # a whole playlist
yt-dlp --no-playlist "URL"                   # only this video, not its playlist
yt-dlp -a urls.txt                           # every URL in a file, one per line
yt-dlp --write-subs --sub-langs en "URL"      # with English subtitles

In our test, -t mp4 picked H.264 video and AAC audio and merged them into one .mp4; -t mp3 downloaded the audio and converted it to .mp3. Both need ffmpeg. yt-dlp also works with many sites besides YouTube; for a direct link to a video file, plain wget or curl is enough (see download files to a folder with wget).

Old youtube-dl commands

Replace youtube-dl with yt-dlp: youtube-dl -f best URL becomes yt-dlp -f best "URL", and -x, -o, -F and -a work as before. One difference is the default file name, which now includes the video ID; --compat-options filename restores the old %(title)s-%(id)s.%(ext)s pattern. For scripts that still call youtube-dl, a symbolic link is the quickest fix:

sudo ln -s /usr/local/bin/yt-dlp /usr/local/bin/youtube-dl

Keep it working

Update yt-dlp whenever downloads start to fail:

$ sudo yt-dlp -U
Latest version: stable@2026.08.19 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2026.08.19 from yt-dlp/yt-dlp)

According to the yt-dlp documentation, the nightly channel (yt-dlp --update-to nightly) gets fixes first and is recommended for regular users. Update deno with sudo deno upgrade.

Common problems

  • "Sign in to confirm you're not a bot" or HTTP 403: the message comes from YouTube, not from yt-dlp. Update yt-dlp first; if it continues, yt-dlp can send your browser login: --cookies-from-browser firefox on a desktop, or --cookies cookies.txt with a Netscape-format cookie file on a server.
  • Video and audio saved as two files (for example .f395.mp4 and .f251.webm): ffmpeg is missing, and yt-dlp says so: WARNING: You have requested merging of multiple formats but ffmpeg is not installed. The formats won't be merged. Install ffmpeg and download again.
  • "yt-dlp: command not found": run it as /usr/local/bin/yt-dlp, or add /usr/local/bin to your PATH.
  • Long downloads on a server: start them inside tmux so they keep running after you log out.

Official documentation: yt-dlp on GitHub and Installing deno.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $135 a month.

Was this answer helpful?

Still stuck? Open a ticket