Skip to content

Start typing. Errors match on their exact yt-dlp output.

to move, to open esc to close

Install and Run yt-dlp on Android with Termux

Tested on yt-dlp 2026.07.28 Updated

Quick answer

yt-dlp runs natively on Android through Termux — no root, no PC. Install Termux from F-Droid rather than the Play Store, then four commands. The storage step is the one people skip and then cannot find their files:

in Termux
pkg update && pkg upgrade -y
pkg install -y python ffmpeg
pip install -U yt-dlp
termux-setup-storage

Get Termux from the right place

The Play Store build was abandoned in 2020 and its package repositories no longer resolve. It looks identical and fails at pkg install, which is why so many Termux problems turn out to be this.

Install from F-Droid or the GitHub releases. If you already have the Play Store one, uninstall it first — they cannot coexist.

Storage, and where files land

termux-setup-storage triggers Android's permission dialog and creates ~/storage. Without it, downloads land in Termux's private directory where no other app can see them:

bash
termux-setup-storage
ls ~/storage

~/storage/shared is the phone's normal storage — the one your gallery and file manager index. Download there:

bash
yt-dlp -P ~/storage/shared/Download/yt-dlp -o "%(title)s.%(ext)s" "URL"

A config file worth having

Typing long flags on a phone keyboard is its own punishment. Set them once:

~/.config/yt-dlp/config
-P ~/storage/shared/Download/yt-dlp
-o %(title)s.%(ext)s
--restrict-filenames
--embed-metadata
--embed-thumbnail
--no-playlist
--sleep-requests 1.5

Create it with mkdir -p ~/.config/yt-dlp && nano ~/.config/yt-dlp/config. The config guide covers precedence and what else is worth putting there.

Sharing a URL into Termux

Copying a link out of the YouTube app and typing it is miserable. Install Termux:API and make a shortcut instead:

bash
pkg install -y termux-api
mkdir -p ~/bin
cat > ~/bin/dl <<'EOF'
#!/data/data/com.termux/files/usr/bin/bash
url="$(termux-clipboard-get)"
yt-dlp "$url"
EOF
chmod +x ~/bin/dl

Copy a link in the YouTube app, switch to Termux, type dl. You will also need the Termux:API companion app from the same source as Termux itself.

Downloads stopping when the screen turns off

Android suspends background processes aggressively. Two things stop it:

bash
termux-wake-lock
# …run the download…
termux-wake-unlock

And exempt Termux from battery optimisation in Android's app settings. The wake lock alone is often not enough on Samsung and Xiaomi builds, which are more aggressive than stock Android.

Audio, for podcasts and music

The most common reason to run yt-dlp on a phone at all:

bash
yt-dlp -x --audio-format m4a --embed-thumbnail --embed-metadata \
  -P ~/storage/shared/Music \
  -o "%(artist,uploader)s/%(title)s.%(ext)s" \
  "URL"

m4a rather than mp3 because YouTube's audio is already m4a — extracting it needs no re-encoding, which on a phone means seconds instead of minutes and no second generation of loss. The audio guide covers when mp3 is worth it anyway.

Keeping it updated

bash
pip install -U yt-dlp
pkg upgrade -y

Termux's pip environment is yours, so there is no externally-managed-environment error here — unlike on a desktop Linux.

If it still fails

  • pkg install cannot resolve anything. The Play Store build. Reinstall from F-Droid.
  • Permission denied writing to storage. termux-setup-storage was never run, or the dialog was dismissed. Run it again.
  • Files download but no app can see them. They are in Termux's private directory. Use -P ~/storage/shared/....
  • ffmpeg missing. pkg install ffmpeg is a separate step from installing yt-dlp; without it everything caps at 360p.
  • Rate limited on mobile data. Carrier-grade NAT puts thousands of subscribers behind one address. See HTTP 429; wifi usually resolves it.

Frequently asked

Where do I get Termux?
F-Droid or the project's GitHub releases. The Play Store version was abandoned years ago and cannot install current packages — a large share of "pkg install fails" reports are that build.
Why can my gallery not see the downloads?
Termux's home directory is private application storage, which the media scanner does not index. Download into ~/storage/shared instead, which maps to the phone's normal storage.
Does it stop when the screen turns off?
It can — Android suspends background apps aggressively. termux-wake-lock holds a partial wake lock for the session, and exempting Termux from battery optimisation in system settings stops the rest.
Is there a GUI instead?
Seal is an Android app wrapping yt-dlp with a normal interface. Termux is the right choice when you want the actual flags — playlists, archives, output templates — which is most of what makes yt-dlp worth using.