Skip to content

Instantly share code, notes, and snippets.

@StephanWagner
Last active May 18, 2020 08:27
Show Gist options
  • Save StephanWagner/aa52da28f0db9460a759c651f818b089 to your computer and use it in GitHub Desktop.
Save StephanWagner/aa52da28f0db9460a759c651f818b089 to your computer and use it in GitHub Desktop.
Setting up Deployer on Debian with Plesk

Setting up Deployer on Debian with Plesk

Instructions of how to set up Deployer on a Server with Debian and Plesk.

More info at https://deployer.org


Install Deployer

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.


Install git

Add the git extension in Plesk > Extensions.


Install composer

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

Update default PHP version

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

Authorize github or bitbucket

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


Install node.js and npm

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment