Mkdir: cannot create directory `/var/www': Permission denied

You can always just do:

SSHKit.command_map[:composer] = '/path/to/composer.phar'.

See Deploying WordPress with Capistrano screencast