Installing Composer in Digital Ocean droplet

Install the php common extensions:

sudo apt update
sudo apt install openssl php-common php-curl php-json php-mbstring php-mysql php-xml php-zip

Installing Composer through APT:

sudo apt install composer

Installing Composer manually with FileZilla:

FTP into droplet with FileZilla before proceeding. To install composer in our droplet we have to download the composer.phar file. Scroll down to "Manual Download" and click the latest version to start the download.

Note where the file downloads (mine downloaded to my desktop). Make sure to remove the .phar extension (composer.phar -> composer). On FileZilla change the "Local Site" to the directory where composer downloaded and the "Remote Site" to /usr/local/bin. Drag and drop the composer file from the local site to the remote.

SSH into your droplet and run


if permission denied run

chmod 777 /usr/local/bin/composer

then run composer once more. Now you have composer installed in your droplet. If you run into any errors make sure to check the common errors post.

Comments (0)

Search Here