SmartVPS - the complete multi-account hosting solution! Each individual account comes with free backups, addon domains, PHP-FPM with OPcache and server-side caching for lightning-fast sites. And all this at a great price!
75% OFF ALL NEW PLANS + 100-DAY MONEY-BACK GUARANTEE
75% OFF ALL NEW PLANS

The PostCreate script feature allows to you run a Bash script on your hosting accounts - either automatically on newly-created hosting accounts, or manually on existing accounts. You can create and save your Bash script at the "Productivity" > "PostCreate Script" of your Account Panel. To create such a script, you need to have some general knowledge in Bash.

To run the script automatically on newly-created accounts, you need to check the option "Enable automatic script execution for newly-created accounts", and press "Save". To run the script manually on some of your existing accounts, you need to choose the respective hosting account under "Manual script execution", and use the button "Execute".

This is an example Bash script that you can use to install Composer:

#!/bin/sh
cd ~/.composer
EXPECTED_CHECKSUM="$(GET https://composer.github.io/installer.sig)"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"

if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
fi

php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php

echo "alias composer='php ~/.composer/composer.phar'" >> ~/.bashrc

exit $RESULT

This script will install Composer to the ~/.composer directory, and it will also add an alias for "composer" in your ~/.bashrc file.