How to install Composer in Ubuntu 18.04

In this tutorial, we will learn on how to install Composer in Ubuntu 18.04 and to use it for your Development Purposes
(Di tutorial ini, kami akan belajar cara untuk memasang composer di Ubuntu 18.04 yang bisa siap dipaka)

Step 1:

Install dependencies or requirements to get Composer up and running (pertama kita akan memasang aplikasi atau libraries kebutuhan untuk Composer) :

# apt-get update
# apt-get install unzip php-cli

Download Composer installer file by using curl or wget in the shell (Silahkan unduh Composer Installer dengan memakai curl atau wget di shell)

Using 'curl':

# curl -sS -o composer-setup.php

Using 'wget':

# wget -O composer-setup.php

Step 2:

We want to install composer into a directory called /usr/local/bin (sekarang kita mau pasang composer di dalam directory /usr/local/bin)

# sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
The output of the above command:

All settings correct for using Composer

Composer (version 1.10.6) successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer

Now we can test the installation by running the composer command:

# composer
The result of the command:

  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
Composer version 1.10.6 2020-05-06 10:28:10

  command [options] [arguments]

  -h, --help                     Display this help message
  -q, --quiet                    Do not output any message
  -V, --version                  Display this application version
      --ansi                     Force ANSI output
      --no-ansi                  Disable ANSI output

Once we have seen the above output, we know that composer has been installed sucessfully in the system.
(Waktu kita sudah lihat output seperti diatas, kita sudah tahu bahwa composer sudah siap dipakai)

Need more Support?

If you cannot find an answer in the knowledgebase, you can contact us for further help.
Popular Tags

Ready to Make Something Big?

Deploy in Cloud Raya