cURL (Client URL) is the standard command-line tool for transferring data over HTTP, HTTPS, FTP, SFTP, and dozens of other protocols. Ubuntu ships curl in the main repository together with libcurl—the shared library behind the CLI and language bindings. Most tutorials, CI scripts, and installers (curl https://… | sh) assume the native apt package at /usr/bin/curl, not a sandboxed Snap build.
This guide shows how to install cURL on Ubuntu, verify the install, run a quick HTTPS test, fix common curl: command not found and libcurl4t64 dependency errors, and when a source build is worth the effort. Commands below were checked on Ubuntu 25.04.
Tested on: Ubuntu 25.04 (Plucky Puffin); kernel 6.14.0-37-generic; amd64.
sudo apt install curl on Ubuntu desktops and servers. The community curl Snap is optional and has sandbox limits (hidden paths under $HOME, some pipe-to-shell installers)—see favoring the native package.
Quick command summary
| Task | Command |
|---|---|
| Check if curl exists | command -v curl |
| Inspect apt candidate | apt-cache policy curl libcurl4t64 |
| Install (recommended) | sudo apt update && sudo apt install -y curl |
| Verify version | curl --version |
| Quick HTTPS test | curl -sI https://example.com |
| Download to file | curl -fsSLo page.html https://example.com |
| Remove package | sudo apt purge -y curl |
Prerequisites
- Ubuntu 22.04 LTS, 24.04 LTS, or newer (25.04 tested here) on amd64 for the package names below.
- sudo for system package installation.
- Working apt repositories (
mainat minimum). Cloud images with disabled mirrors needsudo apt updatebefore install. - Outbound network access for
curlHTTPS tests (proxies may requirehttps_proxy).
What you are installing
| Package | Role |
|---|---|
curl |
CLI binary—curl, curl-config |
libcurl4t64 |
Shared library on Ubuntu 24.04+ (replaces transitional libcurl4 naming) |
libcurl4 |
Library package name on Ubuntu 22.04 and older |
sudo apt install curl pulls the matching libcurl runtime automatically. You do not need a separate libcurl3 or libcurl3-dev step on current Ubuntu—the Ask Ubuntu era of libcurl3 is long obsolete.
Step 1: Install cURL from apt (recommended)
Refresh indexes and check the candidate version before installing:
sudo apt update
apt-cache policy curl libcurl4t64Example on Ubuntu 25.04:
curl:
Installed: 8.12.1-3ubuntu1
Candidate: 8.12.1-3ubuntu1
Version table:
*** 8.12.1-3ubuntu1 500
500 http://archive.ubuntu.com/ubuntu plucky/main amd64 Packages
libcurl4t64:
Installed: 8.12.1-3ubuntu1
Candidate: 8.12.1-3ubuntu1Install with apt:
sudo apt install -y curlUse the full command sudo apt install curl. Omitting install (sudo apt curl) produces E: Invalid operation curl—a common mistake from older tutorials (Ask Ubuntu).
sudo asks for your password because installing system packages requires administrator privileges; it is not specific to curl.
Verify:
curl --version
which curl
dpkg -l curl libcurl4t64curl 8.12.1 (x86_64-pc-linux-gnu) libcurl/8.12.1 OpenSSL/3.4.1 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 ...
Release-Date: 2025-02-13, security patched: 8.12.1-3ubuntu1
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
/usr/bin/curl
ii curl 8.12.1-3ubuntu1 amd64 command line tool for transferring data with URL syntax
ii libcurl4t64:amd64 8.12.1-3ubuntu1 amd64 easy-to-use client-side URL transfer library (OpenSSL flavour)That matches the standard apt workflow: update, install, curl --version, then fetch a URL.
Step 2: Verify with a live HTTPS request
Confirm TLS and DNS work outside apt:
curl -sI https://example.com | head -5HTTP/2 200
date: Thu, 25 Jun 2026 16:11:34 GMT
content-type: text/htmlDownload HTML to a file:
curl -fsSLo /tmp/example.html https://example.com
wc -c /tmp/example.htmlFor day-to-day usage patterns (headers, POST, auth), see the on-site curl command cheat sheet.
Step 3: Snap curl (optional—not recommended for scripts)
Snapcraft publishes a community curl snap (publisher Yuzukosho, experimental HTTP/3). Install only when you explicitly want that build:
sudo snap install curlThe Snap is sandboxed: it may not access hidden files or directories under $HOME (except .curlrc), which breaks installers that read ~/.some-config or pipe scripts from dot-directories (curl-snap issue discussion). For Whonix, cloud-init, and curl | bash bootstrap flows, stay on apt install curl.
Check which binary your shell resolves when both exist:
type -a curlPrefer /usr/bin/curl from apt for automation.
Step 4: Build cURL from source (advanced)
Compile from upstream only when you need a specific unreleased feature or custom TLS backend. Official instructions live at curl.se/docs/install.html.
Install build dependencies (install OpenSSL on Ubuntu covers libssl-dev):
sudo apt update
sudo apt install -y build-essential libssl-dev zlib1g-devDownload a current release (example 8.14.1—pick the version you need from curl.se/download):
cd /tmp
wget 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 ldconfigConfirm the new binary (may shadow apt if /usr/local/bin precedes /usr/bin on PATH):
/usr/local/bin/curl --versionRemove or rename /usr/local/bin/curl when you want to return to the distribution package.
Uninstall
APT:
sudo apt purge -y curl
sudo apt autoremove -ySnap:
sudo snap remove curlManual /usr/local build:
sudo rm -f /usr/local/bin/curl /usr/local/bin/curl-config
sudo ldconfigTroubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
curl: command not found |
Package not installed on minimal image | sudo apt update && sudo apt install -y curl |
E: Invalid operation curl |
Missing install subcommand |
Use sudo apt install curl, not sudo apt curl |
Package 'curl' has no installation candidate |
Stale apt indexes or broken sources.list |
sudo apt update; verify main mirror lines; fix typo mirrors (Ask Ubuntu #259681) |
curl : Depends: libcurl4t64 (= X) but Y is to be installed |
curl / libcurl4t64 version skew |
apt-cache policy curl libcurl4t64; sudo apt full-upgrade or sudo apt install --reinstall libcurl4t64=<matching version> (Ask Ubuntu #1526810) |
| Snap curl warns about sandbox / hidden folders | Community Snap confinement | sudo apt install curl; use /usr/bin/curl |
curl: (6) Could not resolve host |
DNS failure or typo in URL | Fix hostname; check /etc/resolv.conf and VPN |
| Wrong curl version after manual install | /usr/local/bin before /usr/bin |
which curl; remove custom build or adjust PATH |
wget works but tutorial requires curl |
Different tools | Install curl—wget is not a drop-in for all curl flags |
References
- curl.se — how to install curl and libcurl
- curl.se — download
- Ask Ubuntu: curl is currently not installed —
apt installvs missing candidate - Ask Ubuntu: what does sudo apt-get install curl do?
- Ask Ubuntu: libcurl4t64 dependency on 24.04
- Install cURL Snap (Ubuntu)
- On-site: apt command, wget command, curl cheat sheet
Summary
The reliable way to install cURL on Ubuntu is sudo apt update && sudo apt install -y curl. That places /usr/bin/curl on your path and installs the matching libcurl4t64 (or libcurl4 on 22.04) library. Confirm with curl --version and a quick curl -sI https://example.com.
Skip the community Snap for bootstrap scripts and tools that read hidden home-directory paths—apt curl is what Ubuntu documentation and security-focused workflows expect. Build from curl.se source only when apt’s security-patched build lacks a feature you truly need.

