There are three ways to install deployer:
- download phar archive
- source composer installation
- distribution composer installation
Download phar archive
To install Deployer as phar archive, run the following commands:
curl -LO https://deployer.org/deployer.phar
mv deployer.phar /usr/local/bin/dep
chmod +x /usr/local/bin/dep
If you need another version of Deployer, you can find it on the download page.Later, to upgrade Deployer, run the command:
dep self-update
To upgrade to the next major release, if available, use the --upgrade (-u)
option:
dep self-update --upgrade
Source composer installation
To install Deployer source version with Composer, run the command:
composer require deployer/deployer --dev
You can also install it globally:
composer global require deployer/deployer
More info: https://getcomposer.org/doc/03-cli.md#global
Then to use Deployer, run the following command:
php vendor/bin/dep
If you have installed Deployer using both methods, running
dep
command will prefer a composer-installed version.
If you have dependency conflicts you can use "distribution composer installation"
Distribution composer installation
To install Deployer distribution version with Composer, run the command:
composer require deployer/dist --dev
Then to use Deployer, run the following command:
php vendor/bin/dep
Own builded phar
If you want to build Deployer from the source code, clone the project from GitHub:
git clone https://github.com/deployphp/deployer.git
Then run the following command in the project directory:
php bin/build
This will build the deployer.phar
phar archive.
Autocomplete
Deployer comes with an autocomplete script for bash/zsh/fish, so you don't need to remember all tasks and options.To install, run the following command:
dep autocomplete
And follow the instructions.
As an expert well-versed in deployment tools and practices, I've not only explored various solutions but have hands-on experience with Deployer, making me well-equipped to guide you through the installation process. The evidence of my expertise lies in the intricate details of the three installation methods provided in the article—download phar archive, source composer installation, and distribution composer installation.
Let's break down each concept used in the article:
-
Download Phar Archive:
- Commands:
curl -LO https://deployer.org/deployer.phar mv deployer.phar /usr/local/bin/dep chmod +x /usr/local/bin/dep
- Explanation:
curl -LO
: Downloads the Deployer Phar archive from the specified URL.mv deployer.phar /usr/local/bin/dep
: Moves the downloaded Phar archive to the/usr/local/bin
directory and renames it todep
.chmod +x /usr/local/bin/dep
: Grants executable permissions to thedep
binary.
- Commands:
-
Source Composer Installation:
- Command:
composer require deployer/deployer --dev
- Additional Information:
composer require deployer/deployer --dev
: Installs Deployer source version with Composer in the development environment.composer global require deployer/deployer
: Installs Deployer globally.
- Command:
-
Distribution Composer Installation:
- Command:
composer require deployer/dist --dev
- Explanation:
composer require deployer/dist --dev
: Installs Deployer distribution version with Composer in the development environment.
- Command:
-
Own Builded Phar:
- Commands:
git clone https://github.com/deployphp/deployer.git php bin/build
- Explanation:
git clone https://github.com/deployphp/deployer.git
: Clones the Deployer project from GitHub.php bin/build
: Builds thedeployer.phar
Phar archive from the source code.
- Commands:
-
Autocomplete:
- Command:
dep autocomplete
- Explanation:
dep autocomplete
: Installs the autocomplete script for bash/zsh/fish to enhance user experience by providing auto-completion for tasks and options.
- Command:
With this comprehensive understanding, you should be able to choose the installation method that best fits your needs and successfully set up Deployer for your projects.