How to install cURL in Ubuntu? [SOLVED]

Written By - Omer Cakmak

What is cURL?

cURL is a software project that provides a library and command line tool for data transfer using various protocols. The letter "c" in its name comes from the English word client.

The CURL project is divided into libcurl and cURL:

  • libcurl: A free client-side URL transport library that supports FTP, FTPS, Gopher, HTTP, HTTPS, SCP, SFTP, TFTP, Telnet, DICT, LDAP, LDAPS, IMAP, POP3, SMTP and RTSP protocols.
  • cURL: It is a command line tool for receiving or sending files using URL syntax. It uses the libcurl library. It supports the above mentioned internet protocols.

When cURL is installed, the libcurl package is also installed. Now let's see how to install the cURL package on Ubuntu.


How to install cURL?

Ubuntu repositories have the following version:

foc@ubuntu22:~$ sudo apt search curl

curl/jammy-updates,jammy-security,now 7.81.0-1ubuntu1.6 amd64 [installed,automatic]
  command line tool for transferring data with URL syntax

On the cURL official github page, the latest version is 7.86.0. Let's first explain the installation of curl from the Ubuntu repository and then from the source code.


Method-1: Install cURL From Repository

If you are using an older Ubuntu version, you can install with apt-get <package_name>. If you are using a new Ubuntu version, you can complete the installation with the following command:

foc@ubuntu22:~$ sudo apt install curl -y 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-data liblua5.3-0 ssl-cert
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
The following NEW packages will be installed:
The following packages will be upgraded:
Selecting previously unselected package curl.
Preparing to unpack .../curl_7.81.0-1ubuntu1.6_amd64.deb ...
Unpacking curl (7.81.0-1ubuntu1.6) ...
Setting up libcurl4:amd64 (7.81.0-1ubuntu1.6) ...
Setting up curl (7.81.0-1ubuntu1.6) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3) ...
Scanning processes...                                                   
Scanning linux images...

Installation completed successfully. Installed version:

foc@ubuntu22:~$ curl -V
curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.13
Release-Date: 2022-01-05
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 NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd


Method-2: Install cURL From Source Code


It is recommended to perform the following operations with root user.

In this step, pull the package from the download address to your server with the help of wget for installation. Go to the download address and copy the link.

install cURL


Then type the link after the wget command:

root@ubuntu22:/home/foc# wget
--2022-12-08 20:39:18--
Resolving (
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: [following]
--2022-12-08 20:39:18--
Resolving (,,, ...
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3118530 (3.0M) [application/octet-stream]
Saving to: ‘curl-7.86.0.tar.bz2’

curl-7.86.0.tar.b 100%[=============>]   2.97M  6.24MB/s    in 0.5s    

2022-12-08 20:39:19 (6.24 MB/s) - ‘curl-7.86.0.tar.bz2’ saved [3118530/3118530]

Unzip the downloaded compressed file to your current directory:

root@ubuntu22:/home/foc# tar -xvf curl-7.86.0.tar.bz2

Switch to the newly created directory:

root@ubuntu22:/home/foc# cd curl-7.86.0/

TLS type must be specified after the curl configure command. Some of them are listed below:

  • AmiSSL: --with-amissl
  • BearSSL: --with-bearssl
  • GnuTLS: --with-gnutls
  • mbedTLS: --with-mbedtls
  • NSS: --with-nss
  • OpenSSL: --with-openssl (also for BoringSSL and libressl)
  • rustls: --with-rustls
  • Schannel: --with-schannel
  • Secure Transport: --with-secure-transport
  • wolfSSL: --with-wolfssl

If no TLS is available --without-ssl should be used (Recommended). Configure with the following command:

root@ubuntu22:/home/foc/curl-7.86.0# ./configure --prefix=/usr/local --without-ssl

Then run "make" and "make install":

root@ubuntu22:/home/foc/curl-7.86.0# make
root@ubuntu22:/home/foc/curl-7.86.0# make install

Create necessary links and cache for newly added libraries with ldconfig:

root@ubuntu22:/home/foc/curl-7.86.0# ldconfig

Installation complete, check version:

root@ubuntu22:/home/foc/curl-7.86.0# curl -V
curl 7.86.0 (x86_64-pc-linux-gnu) libcurl/7.86.0
Release-Date: 2022-10-26
Protocols: dict file ftp gopher http imap mqtt pop3 rtsp smtp telnet tftp 
Features: alt-svc AsynchDNS IPv6 Largefile threadsafe UnixSockets

Curl package was installed with the latest version.


Basic Examples

You can find a few basic examples below. For more examples and information about curl, you can visit the article "15+ curl command examples in Linux [Cheat Sheet]".

To get up the homepage:

foc@ubuntu22:~$ curl

The output of this command will be the page content. If the specified address is not accessible or there is no address with this name, you will receive an error as follows:

foc@ubuntu22:~$ curl
curl: (6) Could not resolve host:

If you want to write the output to a file you can use the -o parameter:

foc@ubuntu22:~$ curl -o golinuxclou.html
foc@ubuntu22:~$ curl -o golinuxcloud.html
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0




Ubuntu usually comes with a curl package installed. If it is not installed, you can install the curl package from the repository with the installation step.

If you need a specific or current curl for a need or project, you can install it from the source code.


References - how to install curl and libcurl


Didn't find what you were looking for? Perform a quick search across GoLinuxCloud

If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.

Buy GoLinuxCloud a Coffee

For any other feedbacks or questions you can either use the comments section or contact me form.

Thank You for your support!!

Leave a Comment