# Install Composer on Ubuntu Based on the official instruction here: https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md ## Install PHP CLI ``` sudo apt install --assume-yes php-cli unzip ``` ## Download the executable phar directly from the github commit You may replace the commit hash by whatever the last commit hash is on https://github.com/composer/getcomposer.org/commits/main ``` cd ~ wget https://raw.githubusercontent.com/composer/getcomposer.org/d3b829dc7a936a67d4fb9baf7e3502cb55d77548/web/installer -O - -q | php -- --quiet ``` ## Install the executable phar file to ubuntu ``` sudo mv composer.phar /usr/local/bin/composer ``` ## Try to run the composer ``` composer ```