Instructions of how to set up Deployer on a Server with Debian and Plesk.
More info at https://deployer.org
Add the packages deployer/deployer
and deployer/recipes
to your project:
composer require deployer/deployer deployer/recipes --dev
More info of how to install composer: https://getcomposer.org/download/
Download Deployer to your local machine and make it a global command:
curl -LO https://deployer.org/deployer.phar
mv deployer.phar /usr/local/bin/dep
chmod +x /usr/local/bin/dep
Alternatively, you can use php vendor/bin/dep
instead of dep
.
Add the git extension in Plesk > Extensions.
Log in via SSH as root user, then download composer.phar
: https://getcomposer.org/download/
Execute following commands where you just downloaded composer.phar
:
mv composer.phar /usr/local/bin/composer
chmod +x /usr/local/bin/composer
Plesk comes with a default PHP version in bash. Some projects might require a specific version.
Execute following commands via SSH as hosting user (not root user) to have Deployer tasks use a specific PHP version (adjust 7.4
accordingly):
echo "export PATH=/opt/plesk/php/7.4/bin:\$PATH;" >> ~/.bashrc
source ~/.bashrc
If the .bashrc
is not automatically executed when you log in via SSH, add a file .profile
to the users home directory with following content:
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
Add your public key to GitHub or Bitbucket and the ~ /.ssh/autorized_keys
files on your server. More info at https://deployer.org/docs/advanced/deploy-and-git.html and https://gist.github.com/zhujunsan/a0becf82ade50ed06115
This step is optional. Log into your server via ssh as root user and check for node
and npm
versions:
node -v
npm -v
To install node
and npm
, execute following commands via SSH as root user (adjust setup_14.x
accordingly):
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y build-essential
sudo apt-get install -y nodejs
sudo apt-get install -y npm
If you don't have sudo
installed, use following command first: apt-get install sudo -y