Skip to content

Instantly share code, notes, and snippets.

@mohokh67
Last active February 10, 2018 13:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohokh67/36ddc9b0bfd1598d8784c820e828003a to your computer and use it in GitHub Desktop.
Save mohokh67/36ddc9b0bfd1598d8784c820e828003a to your computer and use it in GitHub Desktop.
Install Composer in Ubuntu

How to install composer in Ubuntu

In this short article we are going to install composer php packages manager in Ubuntu 16 and above.

  • Make sure php is installed by typing php -v in terminal. otherwise install PHP with this command:
sudo apt-get update
sudo apt-get install php
  • Download the composer file from the official website with this command:
wget https://getcomposer.org/composer.phar
  • Rename the composer.phar to composer in order to be shorter and more handy.
mv composer.phar composer
  • Make the composer executable and run it once to make sure it works.
sudo chmod +x composer
./composer
  • Last step. Move the file to /usr/local/bin/ directory in order to be accessible from everywhere in system.
sudo mv composer /usr/local/bin/

After this step you should be able to run the composer command from any direcotry in your system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment