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
sudo apt install composer
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.