Download the PHP package 4msar/laravel-deployer without Composer
On this page you can find all versions of the php package 4msar/laravel-deployer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download 4msar/laravel-deployer
More information about 4msar/laravel-deployer
Files in 4msar/laravel-deployer
Package laravel-deployer
Short Description Zero-downtime deployment tool for Laravel applications from GitHub releases
License MIT
Homepage https://github.com/4msar/laravel-deployer
Informations about the package laravel-deployer
Laravel Deployer
A powerful zero-downtime deployment tool for Laravel applications built with Laravel Zero. Deploy your Laravel applications from GitHub releases with confidence using an easy-to-use CLI tool.
Features
- 🚀 Zero Downtime Deployment - Symlink-based deployments ensure your application stays online
- 📦 GitHub Releases Integration - Automatically fetch and deploy from GitHub releases
- 🔄 Automatic Rollback - Rolls back to previous version if deployment fails
- 🗂️ Release Management - Keep multiple releases and easily cleanup old ones
- 🔐 Preserve Important Files - Automatically preserves
.env, storage, and other critical files - ⚡ Laravel Optimization - Runs cache optimization commands automatically
- 🔍 Health Checks - Verifies deployment success before finalizing
- 🎨 Beautiful CLI - Clean, colored output with progress indicators
- ⚙️ Highly Configurable - Configure via
.env, config file, or command options
Installation
Via Composer (Recommended)
Via Download
Download the latest laravel-deployer PHAR file from the releases page:
One click install script
Build from Source
Configuration
Using .env File
Copy the example configuration:
Edit .env with your settings:
Using Command Options
You can override configuration using command-line options:
Usage
Basic Deployment
Advanced Options
Full Example
Rollback
Overview
The rollback command allows you to revert to the previous release if something goes wrong. It automatically switches the symlink to point to the previous version and runs health checks.
Basic Usage
How Rollback Works
The rollback process is straightforward and safe:
- Validates Installation - Checks if installation exists and is properly set up
- Reads Current Version - Gets the current version from
version.txt - Finds Releases - Discovers all available releases and identifies the previous one
- Displays Options - Shows all releases with their status (Current/Previous)
- User Confirmation - Asks for confirmation before rolling back
- Switch Release - Updates symlink to point to the previous release
- Optimize - Runs Laravel cache clearing and caching commands
- Update Version - Updates
version.txtwith the previous version - Health Check - Verifies the application is working after rollback
Example Rollback Scenario
Release Requirements
- Minimum Releases: At least 2 releases must exist to perform a rollback
- Release Directory: Release directories must follow the naming pattern:
{app-name}-v* - Symlink: The install directory must be a symlink pointing to the current release
How It Works
- Fetch Release: Downloads the latest release from GitHub
- Prepare: Extracts the release to a temporary directory
- Preserve Files: Copies important files from current installation (
.env, storage, etc.) - Deploy: Creates a new release directory and copies files
- Optimize: Runs Laravel optimization commands (config, route, view cache)
- Migrate: Optionally runs database migrations
- Switch: Updates symlink to point to new release
- Health Check: Verifies the application is working
- Cleanup: Removes old releases (optional)
- Rollback: Automatically rolls back on failure
Directory Structure
After deployment, your directory structure will look like:
Requirements
- PHP ^8.4
- Composer
- Git
curl,unzipcommand-line tools- Proper file permissions on target server
GitHub Token
For private repositories or to avoid rate limiting, create a GitHub Personal Access Token:
- Go to https://github.com/settings/tokens
- Click "Generate new token (classic)"
- Select scopes:
repo(for private repos) orpublic_repo(for public repos) - Copy the token and use it with
--github-tokenoption or in.env
Deployment Best Practices
- Test Locally: Always test your release locally before deploying
- Backup Database: Backup your database before running migrations
- Use Releases: Tag your code with semantic versioning (v1.0.0, v1.1.0, etc.)
- Preserve Files: Ensure all important files are listed in config
- Health Checks: Verify your application after deployment
- Keep Releases: Keep at least 2 previous releases for quick rollback
Troubleshooting
Permission Denied
Run with sudo or ensure your user has write permissions:
GitHub Rate Limiting
Use a GitHub token to increase rate limits:
Migration Failures
Skip migrations and run them manually:
Rollback Manually
Use the built-in rollback command:
Or manually create the symlink (requires knowing the previous release name):
Self Update
To update laravel-deployer to the latest version, run:
It will download and replace the current PHAR with the latest release.
License
This project is open-sourced software licensed under the MIT license.
Credits
Built with Laravel Zero - The PHP framework for console applications.
All versions of laravel-deployer with dependencies
ext-zip Version *
guzzlehttp/guzzle Version ^7.8
illuminate/http Version ^12.17
laravel-zero/phar-updater Version ^1.4