Laravel Git Deployment and Release Boundaries
Git can identify exactly which source revision you intend to release, but a commit alone is not a deployment. Production also depends on dependency versions, built assets, configuration, database state, uploaded files and long-running processes. A reliable release makes each boundary explicit and records what changed, who approved it and how the team can recover.

Pin the source and build inputs
Select an immutable commit identifier for the release rather than asking a production server to follow a moving branch. Record the repository, commit, build identifier and destination together. Tie review and automated checks to that exact commit. If a new commit arrives while approval is pending, treat it as a different release rather than silently changing what the approver agreed to ship.
Include the dependency lock files and relevant runtime and build-tool versions in the release record. Composer's command documentation says installation uses exact versions from composer.lock when it exists. Build in a clean, controlled environment and record the resulting artifact's digest. A pinned dependency graph improves traceability, but build scripts, platform differences and external downloads can still affect the result; test the artifact that will actually be deployed.
Build frontend assets using the project's locked toolchain and capture the resulting manifest with the application. Do not mix assets from one release with templates from another. Review build scripts and package installation hooks as code: they execute with the build identity's permissions. Limit network access and credentials to what the build needs, and do not assume a successful source checkout guarantees a successful application boot.
The package download chart below offers context about two tools used to coordinate PHP deployment tasks, not a recommendation or a measure of deployment safety. The numbers are changing Packagist totals observed on 29 November 2026. Automated installs, dependency use and project age all affect totals; they are neither unique users nor production deployments. Teams can implement the boundaries in other tooling as well.
Packagist downloads of PHP deployment tools
Cumulative package downloads, snapshot 29 November 2026
- deployer/deployer31,067,216
- laravel/envoy6,639,406
View chart data
| Item | downloads | Note |
|---|---|---|
| deployer/deployer | 31,067,216 | |
| laravel/envoy | 6,639,406 |
Separate releases from mutable state
A practical layout keeps each built application release in its own directory and places environment-specific secrets and durable files in separately managed locations. The web server points at the active release's public directory. The Deployer getting-started guide illustrates a current link, release directories and a shared environment file. This is one possible layout, not a guarantee that all files should be shared.
Classify each path before implementing it. User uploads and other durable application data need persistent storage and backup. Logs need retention and access controls. Configuration caches often belong to a particular release and can contain secrets. Sessions and queues may live outside the filesystem entirely. Never let a cleanup operation remove shared user data simply because it is reachable from a release directory.
| Boundary | Typical contents | Operational rule |
|---|---|---|
| Source and artifact | Application code, locked dependencies, built assets | Identify and retain the tested artifact |
| Environment | Keys, database and service credentials | Restrict access; do not commit or print secrets |
| Shared state | Uploads, logs, sessions and queues | Protect independently from release cleanup |
| Database | Schema and business records | Review compatibility and recovery separately |
| Live processes | Web, workers and scheduled tasks | Switch or restart deliberately and verify |
Use a dedicated deployment identity with only the permissions required for the application and release paths. Keep secret values outside Git and avoid sending them in shell history, workflow output or artifacts. Rotation must account for the application key and other secrets whose replacement affects existing encrypted state. Restrict who can inspect generated caches as well as the original secret store.
Make approval and database changes explicit
Define a production gate after tests and before release activation. Protect the deployment environment with review rules appropriate to your provider and verify that the actual production environment has those safeguards configured. Audit which workflow changes can access production and who can approve a release.
Separate the authority to prepare an artifact from the authority to activate it. Record the approver, exact artifact, destination, migration plan and rollback constraints. Prevent overlapping releases from racing to update the same active path or database. A pipeline should stop on a failed step and preserve enough evidence to determine whether that step made a partial change.
Review each migration before it runs. The Laravel migration guide explains how to inspect status and preview SQL, and warns that some operations are destructive. Plan a compatible transition so old and new application versions can coexist during the release window. Adding a new representation, migrating data and removing the old representation can be separate changes, with validation between them. Estimate locks and test against representative data; a preview does not measure production lock behavior.
For multiple application servers, designate an owner for running migrations once. Laravel's isolated migration option uses a shared atomic lock, but a competing invocation can exit successfully without executing migrations; verify resulting migration state rather than equating a successful exit with completion. Never automatically reverse a migration just because an application health check fails. A down method can remove data created after the release.
Activate the tested release
Prepare dependencies, assets and configuration for the candidate release before it receives traffic. Confirm the runtime can read the files it needs, the web process can write only to intended paths, and the application points to production dependencies without printing their credentials. Laravel's deployment guide specifies the public document root, writable directories, production debug setting and configuration caching considerations.
Switch the active pointer or load-balancer target using the documented behavior of your deployment system and filesystem. A filesystem rename may make one pointer update atomic, but it does not make a database migration, a multi-server rollout, open requests and worker restarts one atomic transaction. Check that requests already being served can finish, and design backward-compatible changes for the period in which different processes use different versions.
Keep the previous artifact and its identifying metadata until the rollback window is over. Confirm it can still boot with the current runtime, configuration and database state before presenting it as an available fallback. Do not delete old releases before understanding whether a running worker, upload link or diagnostic process still refers to them. Ensure retention rules cannot follow links into shared storage.
Restart processes and prove the outcome
Laravel queue workers are long-running processes. Laravel deployment guidance notes that long-running services must be restarted to pick up deployed changes. Arrange graceful termination, configure a process monitor to start replacements, and check the running release and job processing afterward. Consider jobs already in flight, serialized payload compatibility and side effects such as external payments. Coordinate schedulers and other long-lived services too; changing a web root does not change an existing process's loaded code.
Verify the candidate using a protected pre-switch check if your architecture allows it. After activation, test application boot, representative authenticated behavior and a safe database interaction, then inspect errors, queue depth and scheduled execution. Do not confuse a green process status or HTTP response with end-to-end business success. Give the release owner an explicit acceptance decision and defined thresholds for stopping or rolling back.
If verification fails, stop the pipeline and assess the database and writes made since activation. Switching back to an old artifact is safe only if it is compatible with the resulting schema and data. A forward fix, traffic pause or data recovery may be preferable; use the rollback decision guide. The broader VPS deployment checklist covers runtime and operational readiness beyond the Git boundary.
After activation, record the artifact digest and deployment time beside the approval. Make the release record accessible to the incident team without exposing secrets. Rehearse the procedure in a non-production environment with the same release layout, then verify that the recovery path still works after changes to infrastructure or credentials.
For each activation, define who watches the rollout and who can stop it. Include a clear decision about whether to pause incoming writes if the release behaves unexpectedly. Record any partial activation so the next operator can distinguish the intended state from what is actually serving traffic. This evidence is particularly useful when a deployment spans more than one host or a restart has not completed everywhere.
Sora Panel is not released yet. Read how it works on the homepage and explore the Guides library.
Frequently asked questions
Does a Git commit capture production configuration?
No. Secrets, database contents, uploads and other environment state require separate management.
Is a symlink switch a complete zero-downtime deployment?
No. It changes a path, but requests, workers, multiple hosts and database changes still need coordination.
Can I automatically reverse migrations after a failed deployment?
Not safely in general. Review compatibility and new writes first; reversing a migration may destroy data.
Do Packagist download totals rank deployment tool safety?
No. They include automated installs and do not measure unique users, deployment success or security.
Sources
- Composer CLI and lock files (viewed 2026-11-29)
- Deployer getting started (viewed 2026-11-29)
- Laravel migrations (viewed 2026-11-29)
- Laravel deployment (viewed 2026-11-29)
- Packagist Deployer statistics (viewed 2026-11-29)
- Packagist Envoy statistics (viewed 2026-11-29)
Sora Panel is not released yet. Read how it works on the homepage.