amirvahedix/laravel-deploy-ftp

A Laravel package to deploy files modified in Git to an FTP server based on commits, tags, or git status.

Maintainers

Package info

github.com/AmirVahedix/laravel-deploy-ftp

pkg:composer/amirvahedix/laravel-deploy-ftp

Transparency log

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.3 2026-07-23 23:49 UTC

This package is auto-updated.

Last update: 2026-07-23 23:50:44 UTC


README

Latest Stable Version License

A lightweight Laravel package to deploy files modified in Git (plus compiled assets like public/build) to any shared hosting or server via FTP/FTPS.

Features

  • ๐Ÿš€ Git-based deployment: Deploy modified files based on Git commits, tags, or git status.
  • ๐Ÿ“ Asset inclusion: Automatically includes compiled frontend assets (public/build).
  • ๐Ÿ›‘ Exclusions: Automatically excludes sensitive .env files, .git/, vendor/, node_modules/, and custom specified paths.
  • โš™๏ธ Config & .env driven: Easily configured via config/deploy-ftp.php or .env variables.
  • ๐Ÿงช Dry-run mode: Preview files to be uploaded before performing actual transfer.

Installation

Install the package via Composer in any Laravel project:

composer require amirvahedix/laravel-deploy-ftp

(The package uses Laravel Service Discovery and will automatically register the deploy:ftp Artisan command).

Configuration

Publish the package configuration file to config/deploy-ftp.php:

php artisan vendor:publish --tag=deploy-ftp-config

Environment Variables (.env)

Add your FTP server details to your .env file:

FTP_DEPLOY_HOST=ftp.example.com
FTP_DEPLOY_USERNAME=your_username
FTP_DEPLOY_PASSWORD=your_password
FTP_DEPLOY_PORT=21
FTP_DEPLOY_SSL=false
FTP_DEPLOY_ROOT=/public_html
FTP_DEPLOY_TAG=deployed-latest

Usage

Run the deployment command:

php artisan deploy:ftp

Command Options

Option Description
--all Deploy all tracked files (useful for initial deployment)
--status Deploy modified and untracked files based on git status
--from=COMMIT Starting Git commit or tag reference to diff from
--to=COMMIT Ending Git commit (defaults to HEAD)
--dry-run Print list of files that would be uploaded without connecting/uploading
--host=HOST Override FTP host
--user=USER Override FTP username
--password=PASS Override FTP password
--port=PORT Override FTP port (default: 21)
--ssl Connect using SSL/TLS (FTPS)
--root=PATH FTP remote root folder (e.g. /public_html)
--tag=TAG Git tag to track the last deployed commit (default: deployed-latest)
--push Push the deployment Git tag to remote Git origin
--exclude=PATH Comma-separated list of additional files/directories to exclude

Examples

Simulate a full deployment (Dry Run):

php artisan deploy:ftp --all --dry-run

Deploy uncommitted / modified files from git status:

php artisan deploy:ftp --status

Deploy diff between HEAD~2 and HEAD:

php artisan deploy:ftp --from=HEAD~2 --to=HEAD

License

The MIT License (MIT). Please see License File for more information.