Docs cipi.yml Web panel API MCP Guides Compare GitHub Telegram channel
  1. Docs
  2. Deploy
  3. Deploy & roll back

Deploy & roll back

cipi deploy, releases, rollback, status and logs.

Deploy

A deploy builds the new release next to the live one and switches traffic with a single atomic symlink. Visitors never see a half-deployed app, and the previous five releases stay ready for an instant rollback.

Deploy, list releases, roll back
$ cipi deploy shop
$ cipi deploy shop --releases
$ cipi deploy shop --rollback

The pipeline#

Step 1 of 7Stop workers

Queue workers stop first (each finishes its current job), so no job runs old code against a database the new release is about to migrate.

Deployer and Composer always use the app's PHP version, whatever started the deploy. Old releases beyond the last five are pruned. Octane apps reload Octane; apps with a front-end build run it before the swap.

Commands#

CommandDoes
cipi deploy myappDeploy the latest commit of the branch
cipi deploy myapp --rollbackBack to the previous release, instantly
cipi deploy myapp --statusIs a deploy running, queued or interrupted? (safe to poll)
cipi deploy myapp --historyPast deploys and rollbacks: result, release, duration, trigger
cipi deploy --lastThe last deploy of every app
cipi deploy myapp --releasesReleases on disk with date, duration, commit
cipi deploy myapp --log=200Timestamped deploy log
cipi deploy myapp --auditWho deployed what, from where (audit ledger)
cipi deploy myapp --snapshotDump the database first (safe deploy)
cipi deploy myapp --rollback-on-unhealthyUndo the release if the health check fails
cipi deploy myapp --key / --webhookShow the deploy key / webhook URL and token
cipi deploy myapp --unlockClear the lock of an interrupted deploy
cipi deploy myapp --trust-host=git.example.com:2222Trust a self-hosted Git server

Know whether it worked#

SignalDetail
Exit codeNon-zero on failure, so CI and scripts can react
Email / alertsSuccess and failure, with branch, release, commit, author, duration and health verdict (notifications)
Log~/logs/deploy.log: every line timestamped, each run framed by trigger, branch, release and duration
History--history reads rotated logs too, so last month's webhook deploy still shows how long it took

The success notice is sent only after the post-deploy health check, so it never announces a release that returns errors.

Status values#

--statusMeaning
runningBuilding (deploy) or verifying (post-deploy); shows trigger, branch and elapsed time
queuedA push arrived; the deploy starts within a minute
interruptedThe process died (reboot, kill); clear with --unlock
idleNothing running; shows how the last run ended

A failed deploy releases its own lock; only an interrupted one needs --unlock.

In the web panel#

Deploy, follow the release and read the audit from the browser. The web panel is optional; everything here also works from the CLI.

Common problems#

ProblemFix
Permission denied (publickey)Deploy key missing on the repository: cipi deploy myapp --key
Deploy lockedA previous deploy was interrupted: cipi deploy myapp --status, then --unlock
Composer fails on PHP versionAlign --php with what composer.lock needs
Migration failsThe old release keeps serving; fix the migration and deploy again

Questions#

QuestionAnswer
Does a failed deploy take the site down?No. The new release goes live only after every step succeeded.
How do I go back?cipi deploy myapp --rollback, instant.
Are migrations rolled back too?No: rollback restores code. Use a pre-deploy snapshot for data.