How to Download YouTube Videos on Linux

Save YouTube videos to your computer to watch them offline

YouTube homepage against a blue background
pressureUA / Getty Images

Download YouTube videos using Linux using tools like youtube-dl, Clipgrab, Nomnom, and Python-pafyYtd-gtk is often used along with youtube-dl since it provides a GUI for easier use. Downloading YouTube videos using youtube-dl is just one of many of our favorite Linux terminal commands.

To get the MP3 version of a YouTube video, listen to the YouTube video as an MP3 audio file on your computer, phone, or tablet.

Download 'youtube-dl'

Install youtube-dl From Ubuntu Software Centre

Download and install youtube-dl using the relevant package manager for your Linux distribution. If you're using Ubuntu, you can install youtube-dl from the Ubuntu Software Centre or with apt-get.

Download a Video Using 'youtube-dl'

Find A Youtube Video To Download

Before you can download a video, find its URL so that youtube-dl knows which video to get.

  1. Open YouTube and search for the video, or click the link to the video if you received the YouTube URL over an email or in some other application.
  2. Once you're on YouTube, go up to the very top of the page where the address is located, and select all of it so that it's highlighted.
  3. Use the Ctrl+keyboard shortcut to copy the location to the video.
  4. Open a terminal window and type youtube-dl.
  5. Put a space and then right-click the terminal window and paste the link.
  6. Press Enter to run the youtube-dl command and download the video.

What you should see in the terminal window before downloading the video might look something like this: 

youtube-dl https://www.youtube.com/watch?v=ICZ3vFNpZDE

If you get an error about anconv not being updated, run two commands to fix it then try the youtube-dl command again:

sudo add-apt-repository ppa:heyarje/libav-11 && sudo apt-get update sudo apt-get install libav-tools

Download and Install 'ytd-gtk'

GUI For Download Youtube Videos Using Linux

The same tool used to install youtube-dl can be used to get ytd-gtk, which is the program-like version of youtube-dl that might be easier to use for some people.

So, either use the graphical package manager supplied with your distribution or jump into the command line tool again.

How to Use the YouTube Downloader

Youtube Downloader

Start the YouTube download directly from the terminal window by typing the following:

ytd-gtk &

The ampersand at the end lets you run a process in the background so that control is returned to your terminal window.

Alternatively, run the YouTube downloader by using the menu system for your distribution.

The Youtube Downloader has three tabs: Download, Preferences, and Authentication. Here's what to do to get the YouTube video:

  1. From the Download tab, paste the video's URL into the URL box and press the plus symbol next to it.
  2. After the video is added to the queue, either add more so that you can download videos in bulk, or use the button on the bottom right to start the download.
  3. The video will save to whatever location is chosen in the Download Folder option in the Preferences tab.

The Preferences tab is important because when you click the download link for the first time you might get an error stating the requested format is not available. The reason for this is that the default video output type in this YouTube download program is Hi-def, but that format isn't available on all systems.

The Preferences tab allows you to change the output format to any of the following types, so pick a different one and try again if you get the format error:

  • Hi-def
  • Mobile
  • flv 240p
  • flv 360p
  • flv 480p
  • mp4 360p
  • mp4 720p

In addition to changing the output format, you can also change the output folder for the videos and supply proxy account details.

The authentication tab lets you enter a username and password for YouTube if you need to download private videos from a certain YouTube account.