Installing cURL on Ubuntu enables scripted HTTP requests, API checks, and automated file transfers directly from a terminal, which simplifies integration tasks and repeatable workflows. The tool is widely used in deployment pipelines, health checks, and diagnostics where lightweight HTTP and other protocol clients are required.

On Ubuntu, the curl binary is provided as a standard apt package and links against system libraries such as OpenSSL and libz, inheriting the distribution’s certificate store and proxy configuration. A separate snap variant exists as a confined package, mounting into locations like /snap/bin and receiving automatic updates through the snapd service.

Choice of installation method influences path resolution and confinement, so scripts that assume fixed locations such as /usr/bin/curl must account for which package is active. Package installation requires access to sudo, and network connectivity, DNS resolution, and a correctly configured certificate store are necessary for successful outbound HTTPS requests.

Steps to install cURL on Ubuntu:

  1. Open a terminal on the Ubuntu system with access to sudo.
    $ whoami
    root

    Any unprivileged account that belongs to the sudo group can perform the installation.

  2. Refresh the Ubuntu package index using apt before installing cURL.
    $ apt update
    
    WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
    
    Hit:1 http://ports.ubuntu.com/ubuntu-ports noble InRelease
    Hit:2 http://ports.ubuntu.com/ubuntu-ports noble-updates InRelease
    Hit:3 http://ports.ubuntu.com/ubuntu-ports noble-backports InRelease
    Hit:4 http://ports.ubuntu.com/ubuntu-ports noble-security InRelease
    Reading package lists...
    Building dependency tree...
    Reading state information...
    14 packages can be upgraded. Run 'apt list --upgradable' to see them.

    Refreshing the package index ensures the latest metadata for the curl package and its dependencies.

  3. Install the cURL package from the official Ubuntu repositories.
    $ apt install --assume-yes curl
    
    WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
    
    Reading package lists...
    Building dependency tree...
    Reading state information...
    curl is already the newest version (8.5.0-2ubuntu10.6).
    0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.

    The curl package installs the curl binary into the system path, typically at /usr/bin/curl.

  4. Inspect the installed cURL location and version to confirm that the correct binary is in place.
    $ command -v curl
    /usr/bin/curl
    $ curl --version
    curl 8.5.0 (aarch64-unknown-linux-gnu) libcurl/8.5.0 OpenSSL/3.0.13 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.7 libpsl/0.21.2 (+libidn2/2.3.7) libssh/0.10.6/openssl/zlib nghttp2/1.59.0 librtmp/2.3 OpenLDAP/2.6.7
    Release-Date: 2023-12-06, security patched: 8.5.0-2ubuntu10.6
    Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
    Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd

    The reported version, protocol list, and features confirm a functional build linked against the expected libraries.

  5. Optionally install the cURL snap package when a confined, auto-updated variant is preferred.
    $ snap install curl
    bash: line 1: snap: command not found

    snapd is not installed on minimal images by default; installing both apt and snap variants can also cause ambiguity if scripts rely on explicit paths such as /usr/bin/curl or /snap/bin/curl, so only one toolchain location should be assumed in automation.

  6. Request a test page over HTTP to confirm that cURL operates correctly with DNS and networking.
    $ curl --silent "http://api.example.net/"
    <!doctype html><html><title>Mock API</title><h1>OK</h1></html>

    Receiving HTML content without DNS, TLS, or timeout errors indicates a working installation and outbound network connectivity.

Tested on Ubuntu:

Version Code Name
22.04 LTS Jammy Jellyfish
23.10 Mantic Minotaur
24.04 LTS Noble Numbat