cURL, short for “Client URL”, is a command-line tool used to transfer data with URLs. It supports a multitude of protocols, including HTTP, HTTPS, FTP, and many more. With cURL, developers can make requests and interact with servers seamlessly, making it an essential tool for web development and server management tasks.

Many Linux distributions, including Ubuntu, do not come with cURL installed by default. It is, however, installed on Ubuntu Server. That is logical as curl is commonly used for system administration and by power users, whereas normal desktop users would not need it installed on their systems.

The tool is available in the default repositories and can be quickly set up using the system's package manager. curl package is available on both snap and apt for Ubuntu. Depending on your preference, you can install curl on your system using any of the two methods.

Steps to install curl on Ubuntu:

  1. Launch terminal.
  2. Update apt package list.

    $ sudo apt update
    [sudo] password for user:
    Hit:1 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
    Hit:2 http://ports.ubuntu.com/ubuntu-ports jammy-proposed InRelease    
    Hit:3 http://us.ports.ubuntu.com/ubuntu-ports jammy InRelease          
    Hit:4 http://us.ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
    Hit:5 http://us.ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    All packages are up to date.
  3. Install curl package using apt.

    $ sudo apt install --assume-yes curl
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    The following NEW packages will be installed:
      curl
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 190 kB of archives.
    After this operation, 436 kB of additional disk space will be used.
    Get:1 http://us.ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 curl arm64 7.81.0-1ubuntu1.4 [190 kB]
    Fetched 190 kB in 2s (84.5 kB/s)
    Selecting previously unselected package curl.
    (Reading database ... 206724 files and directories currently installed.)
    Preparing to unpack .../curl_7.81.0-1ubuntu1.4_arm64.deb ...
    Unpacking curl (7.81.0-1ubuntu1.4) ...
    Setting up curl (7.81.0-1ubuntu1.4) ...
    Processing triggers for man-db (2.10.2-1) ...

    Install using snap if that's your preference.

    $ sudo snap install curl
    curl 7.84.0 from Wouter van Bommel (woutervb) installed
  4. Start using curl form the terminal.

    $ curl --help
    Usage: curl [options...] <url>
     -d, --data <data>          HTTP POST data
     -f, --fail                 Fail silently (no output at all) on HTTP errors
     -h, --help <category>      Get help for commands
     -i, --include              Include protocol response headers in the output
     -o, --output <file>        Write to file instead of stdout
     -O, --remote-name          Write output to a file named as the remote file
     -s, --silent               Silent mode
     -T, --upload-file <file>   Transfer local FILE to destination
     -u, --user <user:password> Server user and password
     -A, --user-agent <name>    Send User-Agent <name> to server
     -v, --verbose              Make the operation more talkative
     -V, --version              Show version number and quit
    
    This is not the full help, this menu is stripped into categories.
    Use "--help category" to get an overview of all categories.
    For all options use the manual or "--help all".