Skip to main content
The deploy script is the application-specific half of a deployment. Cloning the repository, linking the shared paths and moving the symlink are the deployer’s job, not the script’s, so editing this cannot break the release mechanics.

Where it runs

Inside the new release, in the application directory, as the site’s own account — never as root. A deploy script is written by whoever owns the site and should not be able to touch the machine beyond it. It cannot reach the live release, because the symlink has not moved yet. A script that fails leaves the running site untouched. It stops at the first failure. Without that, a failed composer install would run on into the commands after it and the real error would end up buried under whatever they produce for want of a vendor directory.

What is in the environment

What a new site starts with

Health check

The path the HTTP check asks for after the switch. Anything under 500 counts as alive, and a release that fails it is put back. A Laravel application from version 11 has /up for exactly this. It is worth using: a site’s root can be a redirect or a login page, and neither says anything about whether the application booted. Left empty, the root is used.

Releases to keep

How many release directories stay on disk after a deploy. Older ones are removed, and stop being offered for rollback. Each one you keep is another full copy of the application, vendor and built assets included.

Shared between releases

One path per line, relative to the release. Each is moved out of the application and linked back in, so it survives a deploy. storage and .env are always shared and do not go here — a site that stopped sharing them would lose its uploads on the next deploy. The first deploy takes whatever the repository shipped, so a directory with something already in it does not become an empty one. Paths are relative to the application, not the top of the checkout, because a shared path is something the application keeps: public/uploads means the application’s public directory wherever the application sits.