When I previously installed Composer on my dev server, I made the mistake of doing so while logged in as root. This caused all sorts of permissions-related problems.
I recently decided it was time to sort this out by re-installing Composer properly. Although this should be a no-brainer, I decided to research best practices all the same. I’m glad that I did.
The best tutorial I could find was from DigitalOcean: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-composer-on-ubuntu-16-04. What I like most about their approach, is that it includes instructions for a security check on the installer file.
I also found a lot of very good guidance on the Sitepoint website: