Configs2026年5月19日·1 分钟阅读

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.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Deployer Overview
通用 CLI 安装命令
npx tokrepo install f44a6cc3-53c0-11f1-9bc6-00163e2b0d79

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

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产