# Deployer — Zero-Downtime PHP Deployment Tool > Deployer is a deployment tool for PHP projects that provides zero-downtime atomic deployments with built-in recipes for Laravel, Symfony, and other popular frameworks. ## Install Save in your project root: # Deployer — Zero-Downtime PHP Deployment Tool ## Quick Use ```bash composer require deployer/deployer --dev vendor/bin/dep init vendor/bin/dep deploy production ``` ## Introduction Deployer automates PHP application deployments over SSH with atomic symlink releases. It eliminates downtime by preparing new releases in a separate directory and switching a symlink only after all tasks succeed. ## What Deployer Does - Executes zero-downtime deployments via atomic symlink switching - Provides built-in recipes for Laravel, Symfony, WordPress, and more - Manages multiple servers and deployment stages - Supports parallel deployment to multiple hosts simultaneously - Rolls back to previous releases on failure automatically ## Architecture Overview Deployer connects to remote servers via SSH (using phpseclib or native SSH). Each deployment creates a new release directory, runs build tasks (composer install, asset compilation), and atomically switches the `current` symlink. A configurable number of past releases are kept for rollback. Recipes are PHP files defining tasks, and custom tasks can hook into any stage of the pipeline. ## Self-Hosting & Configuration - Install globally with `composer global require deployer/deployer` or per-project - Initialize config with `dep init` which generates `deploy.php` - Define hosts with SSH credentials or agent forwarding - Set shared files and directories that persist across releases - Configure the number of releases to keep with `set('keep_releases', 5)` ## Key Features - Atomic deployments with instant symlink switching - Built-in recipes for 20+ PHP frameworks and CMSes - Parallel execution across multiple servers - Automatic rollback on task failure - Provisioning support for setting up fresh servers ## Comparison with Similar Tools - **Capistrano** — Ruby-based deployer; Deployer offers the same model in PHP - **Envoyer** — Laravel-hosted deployment SaaS; Deployer is open source and self-managed - **Kamal** — Docker-based deployment; Deployer works with traditional PHP hosting without containers - **Ansible** — general infrastructure automation; Deployer is specialized for PHP deployment workflows - **GitHub Actions** — CI/CD platform; Deployer handles the deployment stage specifically with rollback support ## FAQ **Q: Does Deployer require root access on the server?** A: No. It works with a regular SSH user that has write access to the deployment directory. **Q: Can Deployer run database migrations during deployment?** A: Yes. You can add migration commands as tasks in the deployment recipe. **Q: How does rollback work?** A: Deployer keeps previous releases on disk and switches the `current` symlink back to the last working release with `dep rollback`. **Q: Does Deployer support Docker-based deployments?** A: Deployer is designed for traditional server deployments but can run Docker commands as custom tasks. ## Sources - https://github.com/deployphp/deployer - https://deployer.org/docs --- Source: https://tokrepo.com/en/workflows/asset-f44a6cc3 Author: AI Open Source