How to Install curl on Debian

Install curl on Debian 11, 12, or 13 with sudo apt install curl, verify with curl --version and an HTTPS request, fix curl command not found and libcurl4t64 dependency errors, install php-curl when PHP needs libcurl, and prefer apt over the community Snap.

Published

Updated

Read time 8 min read

Reviewed byDeepak Prasad

curl is the standard command-line client for HTTP, HTTPS, FTP, SFTP, and many other URL schemes. On Debian it ships as the curl package in main, backed by libcurl. Install scripts, CI jobs, and docs that run curl https://… | sh expect the native apt binary at /usr/bin/curl—not a sandboxed Snap build.

This guide covers install curl on Debian for Debian 11 (Bullseye), 12 (Bookworm), and 13 (Trixie): install from apt, verify with HTTPS, optional Snap and source paths, PHP curl when you need the language binding, and fixes for the errors that show up most often in support threads (command not found, broken dependencies, EOL mirrors, DNS). I ran these steps on Debian 13 and kept real terminal output below. For Ubuntu packaging notes, see install curl on Ubuntu.

Tested on: Debian 13 (trixie); kernel 6.12.94+deb13-amd64; amd64; curl 8.14.1-2+deb13u3 with libcurl4t64; HTTP/2 and HTTP/3 features enabled.

NOTE
curl is not guaranteed on minimal Debian images (containers, netinst without extras). Scripts should use command -v curl || { echo "install curl: sudo apt install curl"; exit 1; } before downloading.

Choose an install method

Method Best for Result
apt install curl Servers, desktops, automation (recommended) /usr/bin/curl + libcurl4t64
Community Snap Experimental HTTP/3 curiosity only Sandboxed snap run curl
Build from source Unreleased upstream feature or custom TLS /usr/local/bin/curl
php-curl PHP apps needing curl_*() in code PHP module—not the shell CLI

Use sudo apt install curl unless you have a specific reason not to.


What you are installing

Package Role on Debian 13
curl CLI—curl, wcurl wrapper
libcurl4t64 Shared library (OpenSSL flavour) pulled in automatically
php-curl Metapackage → php8.4-curl for PHP only
libcurl4-openssl-dev Headers for compiling against libcurl (developers)

sudo apt install curl does not install PHP bindings. For PHP, add php-curl separately (see PHP curl extension).

On Bullseye, the library package is typically libcurl4 without the t64 suffix—apt still resolves dependencies when you install curl.


Prerequisites

  • Debian 11, 12, or 13 with working apt mirrors in /etc/apt/sources.list or sources.list.d/.
  • sudo for package installation.
  • Outbound network for apt update and HTTPS tests (set https_proxy behind corporate proxies).
  • ca-certificates for TLS (usually already installed; install it if HTTPS fails with certificate errors).

Check whether curl is already present:

bash
. /etc/os-release && echo "$PRETTY_NAME"
command -v curl || echo "curl not installed"
apt-cache policy curl libcurl4t64
text
Debian GNU/Linux 13 (trixie)
/usr/bin/curl
curl:
  Installed: 8.14.1-2+deb13u3
  Candidate: 8.14.1-2+deb13u3
libcurl4t64:
  Installed: 8.14.1-2+deb13u3
  Candidate: 8.14.1-2+deb13u3

Refresh indexes and inspect versions:

bash
sudo apt update
apt-cache policy curl libcurl4t64

Install:

bash
sudo apt install -y curl
text
curl is already the newest version (8.14.1-2+deb13u3).

Use the full subcommand—install is required:

bash
apt curl
text
Error: Invalid operation curl

Verify the binary and library:

bash
curl --version
which curl
dpkg -l curl libcurl4t64
text
curl 8.14.1 (x86_64-pc-linux-gnu) libcurl/8.14.1 OpenSSL/3.5.6 zlib/1.3.1 brotli/1.1.0 zstd/1.5.7 ...
Release-Date: 2025-06-04, security patched: 8.14.1-2+deb13u3
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd
/usr/bin/curl
ii  curl           8.14.1-2+deb13u3 amd64        command line tool for transferring data with URL syntax
ii  libcurl4t64:amd64  8.14.1-2+deb13u3 amd64    easy-to-use client-side URL transfer library (OpenSSL flavour)

Dependency chain:

bash
apt-cache depends curl
text
curl
  Depends: libc6
  Depends: libcurl4t64
  Depends: zlib1g
  Recommends: bash-completion

Upgrade with normal system updates:

bash
sudo apt update && sudo apt install --only-upgrade curl

Verify with a live HTTPS request

Confirm DNS and TLS outside apt:

bash
curl -sI https://example.com | head -5
text
HTTP/2 200
date: Mon, 29 Jun 2026 10:11:13 GMT
content-type: text/html

Download a file:

bash
curl -fsSLo /tmp/example.html https://example.com
wc -c /tmp/example.html
text
559 /tmp/example.html

For flags (-X POST, -H, -u, proxies), see the curl command cheat sheet. When a tutorial uses wget instead, both tools can fetch URLs—but curl is what most bootstrap scripts call.


Install curl from Snap (optional)

The curl Snap (publisher Yuzukosho) advertises experimental HTTP/3. It is not the official Debian package:

bash
sudo apt install -y snapd
sudo snap install snapd
sudo snap install curl

Snap metadata warns about sandbox limits:

text
With the security nature of snap, the curl snap is only allowed to access
any non-hidden files (files or directory starting with '.', except .curlrc)
under the /home/$USER/ directory.

That breaks installers reading ~/.config/… or hidden paths. For install eza on Debian, install Temurin on Debian, install Git, and curl | bash flows, use /usr/bin/curl from apt:

bash
type -a curl
text
curl is /usr/bin/curl
curl is /bin/curl

Build curl from source (advanced)

Compile only when Debian’s curl package lacks a feature you need. Official steps: curl.se — install.

bash
sudo apt install -y build-essential libssl-dev zlib1g-dev
cd /tmp
curl -fsSLO https://curl.se/download/curl-8.14.1.tar.bz2
tar -xjf curl-8.14.1.tar.bz2
cd curl-8.14.1
./configure --prefix=/usr/local --with-openssl
make -j"$(nproc)"
sudo make install
sudo ldconfig
/usr/local/bin/curl --version

Remove /usr/local/bin/curl when you want to return to the apt build. Pick one channel—custom /usr/local binaries can shadow apt if /usr/local/bin comes first on PATH.


PHP curl (not the same as the curl CLI)

Forum posts often mix up sudo apt install curl with PHP’s curl extension. For PHP apps:

bash
sudo apt install -y php-curl

Dry-run on the test host pulled:

text
Inst php8.4-curl (8.4.21-1~deb13u1 ...)
Inst php-curl (2:8.4+96 ...)

Confirm in PHP:

bash
php -m | grep -i curl

That enables curl_*() functions in PHP. Shell scripts and install Android Studio on Debian tarball downloads still need the curl package.


curl on end-of-life Debian releases

When a Debian release moves to archive.debian.org, live security.debian.org URLs for that codename stop working. Point both archive and archive security at the frozen mirrors—for example Stretch:

bash
echo "deb http://archive.debian.org/debian stretch main" | sudo tee /etc/apt/sources.list.d/stretch-archive.list
echo "deb http://archive.debian.org/debian-security stretch/updates main" | sudo tee /etc/apt/sources.list.d/stretch-security-archive.list

You may need:

bash
echo 'Acquire::Check-Valid-Until "false";' | sudo tee /etc/apt/apt.conf.d/99archive
sudo apt update
sudo apt install curl

Use this only on unsupported releases you cannot upgrade. Supported systems should keep normal deb.debian.org and debian-security entries.


Uninstall curl

APT:

bash
sudo apt purge -y curl
sudo apt autoremove -y

libcurl4t64 may remain if other packages need it:

bash
apt-cache rdepends libcurl4t64 | head -10

The curl CLI itself is not marked Essential in Debian—reverse dependencies include tools like steam-launcher and abi-monitor, but minimal images often omit it until you install the package explicitly (Server Fault — curl on Debian/Ubuntu).

Snap:

bash
sudo snap remove curl

Manual /usr/local build:

bash
sudo rm -f /usr/local/bin/curl /usr/local/bin/curl-config
sudo ldconfig

Troubleshooting

Symptom Likely cause Fix
curl: command not found / Command 'curl' not found Package missing on minimal image sudo apt update && sudo apt install -y curl — see bash curl command not found
Error: Invalid operation curl Omitted install sudo apt install curl, not sudo apt curl
Package 'curl' has no installation candidate Stale indexes or wrong sources.list sudo apt update; verify main mirror lines; on EOL releases use archive.debian.org
curl : Depends: libcurl4t64 (= X) but Y is to be installed curl / libcurl version skew apt-cache policy curl libcurl4t64; sudo apt full-upgrade or reinstall matching versions
E: Unable to correct problems, you have held broken packages Conflicting pins or mixed suites apt-mark showhold; align all sources to one Debian release
apt update / Could not resolve host for mirrors DNS or proxy failure Fix /etc/resolv.conf; test ping deb.debian.org; set https_proxy
curl: (6) Could not resolve host DNS on client side Fix resolver; check VPN and typo in URL
curl: (60) SSL certificate problem Missing or outdated CA certs sudo apt install ca-certificates; check system clock
Snap curl cannot read ~/.hidden paths Snap confinement sudo apt install curl; use /usr/bin/curl
dpkg -l | grep curl matches libcurl only Library installed, CLI not command -v curl; install curl package
Installed php-curl but shell has no curl Different packages sudo apt install curl for CLI
Wrong version after manual build /usr/local/bin before /usr/bin which curl; remove custom build or fix PATH

References


Summary

Install curl on Debian with sudo apt update && sudo apt install -y curl. That places /usr/bin/curl on your path and installs matching libcurl4t64 (8.14.1-2+deb13u3 here, with HTTP/2 and HTTP/3 features). Confirm with curl --version and curl -sI https://example.com.

Skip the community Snap for bootstrap scripts that touch hidden home-directory paths. Install php-curl only when PHP needs the extension—not for shell downloads. On EOL releases, use archive.debian.org mirrors before apt install curl.


Frequently Asked Questions

1. How do I install curl on Debian?

Run sudo apt update && sudo apt install -y curl. The curl package pulls in libcurl4t64 on Debian 13 and Bookworm. Verify with curl --version and command -v curl (typically /usr/bin/curl).

2. Is curl installed by default on Debian?

Not on minimal images. Debian netinst and Docker slim variants often ship without curl until you install it. Desktop systems may have curl indirectly as a dependency. Run command -v curl; if empty, install from apt.

3. What is the difference between curl and libcurl on Debian?

curl is the CLI at /usr/bin/curl. libcurl4t64 is the shared library the binary links against. apt install curl installs both automatically. php-curl is a separate PHP extension package—not the same as the curl command.

4. Why does Debian say curl command not found?

The curl package is not installed, or /usr/bin is not on PATH. Install with sudo apt install curl. Do not confuse libcurl4t64 (library) or php-curl (PHP module) with the curl CLI.

5. Should I install curl from Snap on Debian?

Prefer sudo apt install curl. The community curl Snap is sandboxed and cannot read most hidden paths under $HOME, which breaks some curl pipe-to-sh installers. Use /usr/bin/curl from apt for scripts.

6. How do I fix libcurl dependency errors when installing curl?

Run apt-cache policy curl libcurl4t64 and install matching versions from the same suite with sudo apt full-upgrade or sudo apt install --reinstall libcurl4t64=. Avoid mixing EOL archive mirrors with current security suites.

7. How do I install PHP curl on Debian?

Install the PHP extension: sudo apt install php-curl (metapackage) or php8.4-curl for a specific PHP version. That enables curl_* functions in PHP—it does not replace apt install curl for shell scripts.

8. How do I install curl on old unsupported Debian releases?

Point apt at archive.debian.org for the release and matching debian-security archive paths—not the live security.debian.org URLs for EOL suites. Example for Stretch: deb http://archive.debian.org/debian stretch main and deb http://archive.debian.org/debian-security stretch/updates main, then apt update and apt install curl.
Omer Cakmak

Linux Administrator

Highly skilled at managing Debian, Ubuntu, CentOS, Oracle Linux, and Red Hat servers. Proficient in bash scripting, Ansible, and AWX central server management, he handles server operations on …