TechEarl

How to Download an Instagram Reel or Video with yt-dlp

Download an Instagram Reel or video free from the command line with yt-dlp. A public post can download logged out, but Instagram rate-limits anonymous requests and gates private ones, so plan on cookies: how to pass them, keep them fresh, and grab reels, feed videos, IGTV, or just the audio.

Ishan KarunaratnePublished ⏱️ 9 min readUpdated
Share thisCopied
Download an Instagram Reel or video free with yt-dlp. Public posts can work logged out, but plan on cookies: pass --cookies-from-browser firefox, keep them fresh, and save reels or audio.

The free, reliable way to download an Instagram Reel or video in 2026 is yt-dlp, the open-source command-line downloader, no shady website, no ads, no upload limits. The one thing that is different from YouTube: Instagram usually wants you logged in, so plan on handing yt-dlp your browser cookies. Paste a URL below, choose whether you want the video or the audio, and copy the command:

Build your yt-dlp command

Paste a Instagram URL, choose what to grab, and copy the command. It updates as you change the options.

Profile / bulk options

Resolution is a maximum, not a guarantee. yt-dlp grabs the best quality at or below your pick, capped by what was actually uploaded. Choose 8K on a 720p video and you get 720p, not an error and not an upscale.

Your command
bash
yt-dlp --merge-output-format mp4 "https://www.instagram.com/reel/Cabcd1234ef/"
AI CLI prompt

Paste this into your terminal AI and it runs the command for you, installing the tool first if you do not have it. Works with Claude Code, OpenAI Codex CLI, Gemini CLI, GitHub Copilot CLI, Aider, Cursor Agent, Warp, OpenCode, Cline and any other CLI coding agent.

prompt
Goal: download the video from this Instagram link.

Run this command in my shell:

    yt-dlp --merge-output-format mp4 "https://www.instagram.com/reel/Cabcd1234ef/"

First check whether `yt-dlp` is installed (run `command -v yt-dlp`). If it is not, install it with my system's package manager before running anything: macOS `brew install yt-dlp ffmpeg`, Debian/Ubuntu `sudo apt install yt-dlp ffmpeg`, Fedora `sudo dnf install yt-dlp ffmpeg`, Windows `winget install yt-dlp ffmpeg`. Then run the command above.

Show me any command that needs sudo before you run it, tell me where the output file landed when you are done, and do not run anything else.

You run this at your own risk. An AI agent can execute commands on your machine; review what it does before approving. TechEarl is not liable for the outcome, see the Terms of Service.

yt-dlp's Instagram extractor does have a logged-out path, so a public reel or post can download with no cookies at all. I do not rely on it: Instagram can rate-limit anonymous requests (yt-dlp then reports an empty media response or "You have exceeded the rate-limit for accessing posts anonymously"), and private, follower-only, and restricted posts are only served to a logged-in session. So every command on this page passes --cookies-from-browser; drop the flag if you want to try the anonymous route first. The rest of this page is the detail: which browser to pull cookies from, why they keep expiring, and how to cover reels, feed videos, IGTV, and audio.

Download only what you have the right to. Saving your own posts, content you have permission to use, or material the creator has released for reuse is fine; redownloading and redistributing someone else's reels is not, and bulk scraping violates Instagram's Terms of Service. This guide is for the legitimate cases. Respect the people who made the thing. What you do with the file is on you.

Cookies are mandatory

Strictly, cookies are mandatory only for private, follower-only, and restricted posts, and for any request Instagram has decided to rate-limit. A public reel can come down without them, but the anonymous route can be rate-limited at any point, so I treat cookies as required and pass them every time. The core command is short, and the --cookies-from-browser flag is doing the heavy lifting:

bash
# A reel or post video, fetched with your logged-in Firefox session
yt-dlp --cookies-from-browser firefox "https://www.instagram.com/reel/REEL_ID/"

Firefox is the cookie source that works on every platform, which is why the commands here use it. Chrome is the catch on Windows: starting with Chrome 127 (July 2024), Chrome on Windows protects its cookies with App-Bound Encryption, and --cookies-from-browser chrome fails there with a failed to decrypt with DPAPI error (yt-dlp issue #10927, still open). That change is Windows-only: on macOS and Linux, chrome is still a supported --cookies-from-browser source. Make sure you are actually logged in to Instagram in that browser profile first; yt-dlp reads the session cookie that the logged-in browser holds.

If you do not use Firefox at all, you can export a cookies.txt file with a browser extension and pass --cookies cookies.txt instead. But the live --cookies-from-browser firefox path is simpler and stays current automatically as long as you stay logged in.

One gotcha: if yt-dlp reports it cannot copy or read the cookie database (a "could not copy ... cookie database" or locked-database error), close the browser and run the command again. yt-dlp reads the cookie store from disk, and an open browser can hold a lock on it.

Keep the cookies fresh (the failure you will hit)

Instagram sessions expire fast, and this is the single most common reason a command that worked yesterday suddenly fails. If you get an HTTP 401, an "login required" error, or just an empty result with no download, your Instagram session cookie has gone stale.

The fix is to refresh it:

  1. Open instagram.com in Firefox.
  2. Confirm you are still logged in (Instagram logs you out more aggressively than most sites). Log back in if needed.
  3. Re-run the same yt-dlp command. It now reads the current cookie from the freshly authenticated session.

There is no flag that makes the cookie last longer; the lifetime is Instagram's to decide. When in doubt, re-authenticate in the browser and run again. If it still fails after fresh cookies, the next suspect is a stale yt-dlp (see below), not the cookies.

Reels, feed videos, and IGTV

The same command works across Instagram's video URL shapes, only the path segment changes:

  • Reels live on /reel/ URLs.
  • Feed videos (a video in a regular post) live on /p/ URLs.
  • IGTV clips live on legacy /tv/ URLs. Instagram retired the IGTV brand in 2022 and folded that video into the main app, so new uploads no longer get /tv/ links, but old /tv/ URLs still resolve and the extractor still handles them.
bash
yt-dlp --cookies-from-browser firefox "https://www.instagram.com/reel/REEL_ID/"
yt-dlp --cookies-from-browser firefox "https://www.instagram.com/p/POST_ID/"
yt-dlp --cookies-from-browser firefox "https://www.instagram.com/tv/IGTV_ID/"

There is no special flag to switch between them; yt-dlp's Instagram extractor reads the URL and figures out the type. A /p/ post that happens to be a photo carousel will return its images or videos as the extractor finds them.

Save it with a clean filename

By default the file is named with Instagram's internal ID, which is not memorable. An output template (-o) gives you something readable:

bash
# Clean filename
yt-dlp --cookies-from-browser firefox -o "%(uploader)s - %(id)s.%(ext)s" "URL"

%(uploader)s, %(id)s, and %(ext)s are output-template fields; there are dozens more (%(upload_date)s, %(title)s) for building a folder structure that suits your library. Keep %(id)s in there somewhere so two reels from the same account never collide on the same filename.

Just the audio

If it is only the sound you want (a reel's track, a voiceover), extract it directly instead of downloading the video and stripping it yourself:

bash
# Just the audio
yt-dlp --cookies-from-browser firefox -x --audio-format m4a "URL"

-x extracts the audio, and --audio-format m4a sets the target format. When the downloaded audio is already AAC, yt-dlp copies it into the M4A container without re-encoding; any other codec is converted to AAC, which is a lossy step. This needs ffmpeg installed, the same dependency yt-dlp uses everywhere for muxing and conversion. If you do not have it yet, brew install ffmpeg, sudo apt install ffmpeg, or winget install Gyan.FFmpeg depending on your platform.

Keep yt-dlp updated (more important here than most)

Instagram is one of yt-dlp's more fragile extractors. Instagram changes its private API and page structure often, and when it does, the extractor breaks until a new release ships, which usually happens within days. So when an Instagram download suddenly fails and your cookies are fresh, update yt-dlp before anything else:

bash
yt-dlp -U                 # standalone binary self-update
pipx upgrade yt-dlp       # if installed via pipx
brew upgrade yt-dlp       # if installed via Homebrew

Running a months-old yt-dlp against Instagram is the second most common cause of failure after stale cookies. Between the two (fresh cookies, current binary), almost every "it stopped working" report is covered.

FAQ

You do not always. yt-dlp can extract a public Instagram reel without a login, but Instagram can rate-limit anonymous requests, and private, follower-only, and restricted posts are only served to a logged-in session. When that happens yt-dlp stops with a login-required, rate-limit, or empty-response error, and --cookies-from-browser firefox is the fix. That is why the commands on this page pass cookies from the start.

Your Instagram session cookie has expired. Open instagram.com in Firefox, confirm you are still logged in (log back in if not), and re-run the same command so yt-dlp reads a current cookie. Instagram sessions expire quickly, so re-exporting fresh cookies is the first fix to try.

On macOS and Linux, yes: --cookies-from-browser chrome is a supported source. On Windows, not reliably: since Chrome 127 (July 2024), Chrome on Windows protects its cookies with App-Bound Encryption, and yt-dlp fails to decrypt them. There, use --cookies-from-browser firefox, or export a cookies.txt file with a browser extension and pass --cookies cookies.txt.

Yes. Reels are /reel/ URLs, feed-post videos are /p/ URLs, and IGTV is /tv/. The same yt-dlp --cookies-from-browser firefox URL command handles all three; the extractor reads the URL and works out the type, no extra flag needed.

Two usual causes. Either your cookies went stale (re-authenticate in Firefox and retry) or your yt-dlp is out of date. Instagram is one of the more fragile extractors and breaks when Instagram changes its site, so update with yt-dlp -U or pipx upgrade yt-dlp and try again.

Yes. yt-dlp is free and open source, with no ads, no paywall, no watermark, and no download limits. Unlike the "free Instagram downloader" websites that wrap a tool like this in ads and trackers, yt-dlp runs entirely on your own machine and costs nothing.

See also

Sources

Authoritative references this article was fact-checked against.

Tagsyt-dlpInstagramreel downloadinstagram video downloaderCLIcookiesfree instagram downloader

Found this useful? Pass it on.

Copied

Ishan Karunaratne

Systems and Network Architect · Chief Technology Officer

Systems and network architect and Chief Technology Officer with more than two decades designing, building, and running production software, cloud and network architecture, Linux systems, and the bare metal underneath them, and lately working AI into the stack. A US Army veteran who served in Operation Iraqi Freedom. What I write here is drawn from the full arc of that work, across architecture, engineering, and operations, not any single job.

Keep reading

Related posts

Download a Facebook video from the command line with yt-dlp: public watch and fb.watch links work without cookies, private and group videos use Firefox cookies, and you choose the resolution.

How to Download a Facebook Video with yt-dlp

Download a Facebook video free from the command line with yt-dlp: public watch links and fb.watch shorts need no cookies, private and group videos use --cookies-from-browser firefox, and you pick the resolution yourself.

Trim or cut a video from the command line with ffmpeg using -ss and -to or -t, the fast lossless stream-copy way and the frame-accurate re-encode.

How to Trim or Cut a Video with ffmpeg

Trim or cut a video from the command line with ffmpeg: the fast lossless -c copy way, the keyframe gotcha that makes your cut land early, and the frame-accurate re-encode. With -ss and -to/-t explained.

Download a single TikTok video or every video from a profile with yt-dlp, plus the photo slideshows it skips, using gallery-dl. Resumable and free.

Download Every Video From a TikTok Profile with yt-dlp

Download all TikTok videos from a user free with yt-dlp: point it at the profile URL, pass browser cookies (TikTok needs them for the full listing), and use a download archive so re-runs only grab new clips. Also covers single videos, short links, the watermark, and audio. For the photo slideshows yt-dlp skips, back up the images with gallery-dl.