You will need to install a web server before installing anything else. You can do that by installing a LAMP server directly using the following command:
$ sudo tasksel
If the preceding command says
tasksel is not found, you would need to install tasksel using the following command:
$ sudo apt-get install tasksel
Tasksel will show you different packages that you can install; select the LAMP server from the list and install the package. Once you install it, you can install Composer using the following command:
$ curl -sS https://getcomposer.org/installer | php
Or if you don't have curl installed, use the following command:
$ php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
This will ...