If you're using a Mac or Linux machine, there are two ways to install composer on your system: the official way, which is safer but longer, and a faster way with only one command.
Officially recommended way
The last step is optional and you can skip it if you don't want to install composer globally.
This method is safer, because it verifies SHA-384 checksums for downloaded installer. Note that the checksum in this example is for version 2.4.0; you can find an up-to-date checksum here.
Fast way
Use this option if you need to install Composer more quickly. However, the installer will not verify the checksum, so use it with caution. It will install composer in /usr/local/bin
directory and make it globally available, but if you don't want to - you can change that by removing the --install-dir
option from the command line.