{
  "id": 3494295,
  "title": "Mastering Zero-Downtime Deployments with Laravel Deployer",
  "url": "https://urgent.news/2026/08/26/mastering-zero-downtime-deployments-with-laravel-deployer",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-26T11:06:16.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/abbeymaniak/mastering-zero-downtime-deployments-with-laravel-deployer-18f3"
  },
  "original_language": "en",
  "account": "Zero-downtime deployments using PHP Deployer for Laravel apps don't require taking the site offline. A PHP-based deployment tool like Deployer makes this process incredibly easy. However, the author encountered issues with Deployer's Git caching and Laravel Horizon worker memory.\n\nGitHub Actions was used to automate the CI/CD pipeline, triggering Deployer to pull the latest code and deploy it to the server whenever changes were pushed to the main or beta branch. Deployer achieves zero-downtime by creating a new release folder, running composer install, npm build, and php artisan migrate in that folder, and then updating a symlink to point to the new release.\n\nThe author faced problems with Deployer's Git cache, which caused deployments to fail due to out-of-sync or corrupted cached repositories. To solve this, they bypassed the cache by forcing Deployer to perform a fresh clone of the repository every time. They added the line `set ( 'update_code_strategy', 'clone' );` to the deploy.php file.\n\nAnother issue was Laravel Horizon workers crashing with old code after a deployment. Laravel Horizon workers are long-running PHP daemon processes that continue executing old classes when new code is deployed. To fix this, the author told Horizon to gracefully terminate itself after a deployment finishes. They added a task in the deploy.php file that runs `php artisan horizon:terminate` right after the symlink is updated, which was then hooked to run automatically after the symlink update.",
  "summary": "How I achieved zero-downtime deployments using PHP Deployer for my Laravel app, and the critical caching and Horizon worker issues I had to solve. Deploying a Laravel application shouldn't mean taking your site offline. For a long time, I used simple git pull scripts or basic FTP, which often resulted in momentary downtime or broken states if a user visited exactly while composer install was…",
  "key_points": [
    "Zero-downtime deployments achieved without site downtime",
    "Deployer tool automates CI/CD pipeline for Laravel apps",
    "Issues resolved with Git cache bypass and Horizon worker termination"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}