PHPackages                             mentosmenno2/sftp-deploy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. mentosmenno2/sftp-deploy

ActiveLibrary

mentosmenno2/sftp-deploy
========================

Package to deploy projects to an SFTP server

v1.1.1(5y ago)11271[1 PRs](https://github.com/mentosmenno2/sftp-deploy/pulls)MITPHPPHP &gt;=7.1

Since Apr 20Pushed 4y ago1 watchersCompare

[ Source](https://github.com/mentosmenno2/sftp-deploy)[ Packagist](https://packagist.org/packages/mentosmenno2/sftp-deploy)[ RSS](/packages/mentosmenno2-sftp-deploy/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

[![GitHub Actions status](https://github.com/mentosmenno2/sftp-deploy/workflows/Build%20%26%20test/badge.svg)](https://github.com/mentosmenno2/sftp-deploy/actions)

Mentosmenno2 SFTP Deploy
========================

[](#mentosmenno2-sftp-deploy)

Build and deploy PHP applications via (S)FTP, with a simple command!

Requirements
------------

[](#requirements)

- PHP 7.1+

Installation
------------

[](#installation)

Install this dependency with composer as dev-dependency.

```
composer require mentosmenno2/sftp-deploy --dev
```

Add the commands to the Composer scripts by adding this in the `composer.json` file.

```
"scripts": {
	"sftp-deploy" : [
		"sftp-deploy"
	],
	"deploy": [
		"@sftp-deploy deploy"
	]
}
```

Configuration
-------------

[](#configuration)

Use the `init` command to generate a configuration file. See the Commands section below.

Open the generated `sftp-deploy.config.json` file, and edit the properties following the specification below.

### Configuration file properties

[](#configuration-file-properties)

PropertyTypeDefaultDescription**builds\_directory**string`"deployments"`The path where the the build will be created. Relative to your project directory.**builds\_use\_subdirectory**boolean`true`Will make a separate subdirectory inside the `builds_directory` for your build.**builds\_keep\_revisions**integer`5`Revisions of builds to keep when cleaning up builds.**run\_before**\[\] string`[]`Commands to run before cloning your project from git**repo\_url**string / null`null`Repository url to use for cloning your project from git.**repo\_clone\_directory**string`"."`Path to clone the repo in. Relative to the `builds_directory` (with subdirectory if enabled).**repo\_checkout**string`"master"`Default branch or tag to checkout when cloning the repo.**run\_after**\[\] string`[]`Commands to run after cloning your project from git.**deploy\_directory**string`"."`Directory to upload to (S)FTP. Relative to the `builds_directory` (with subdirectory if enabled).**sftp\_adapter**string`"sftp"`Options: `sftp`, `ftp`. Adapter to choose for deploying.**sftp\_host**string`"example.com"`(S)FTP host.**sftp\_port**integer`22`(S)FTP port. SFTP usually uses `22`. FPT usually uses `21`.**sftp\_username**string`"username"`(S)FTP username.**sftp\_password**string`"password"`(S)FTP password.**sftp\_root**string`"/path/to/root"`Path where files from `deploy_directory` should be placed. Absolute path from (S)FTP root.**sftp\_passive**boolean`true`Use a passive connection. Only works when `ftp` is selected as `sftp_adapter`.**sftp\_ssl**boolean`true`Use a SSL connection. Only works when `ftp` is selected as `sftp_adapter`.**sftp\_ignore\_passive\_address**boolean`false`Don't use passive address. Useful when connection is blocked by firewall. Only works when `ftp` is selected as `sftp_adapter`.**sftp\_private\_key\_file**string / null`null`Path to private key file. Absolute path. Only works when `sftp` is selected as `sftp_adapter`.**sftp\_private\_key\_password**string / null`null`Private key password. Only works when `sftp` is selected as `sftp_adapter`.**sftp\_directory\_permission**integer`0755`Set directory permission of `sftp_root`.You can also use a custom configuration file. To do so, you can specify your custom configuration file, using the `config` operand. If you do so, you should also change the current deploy command (see installation section), or create a new one.

```
"scripts": {
	"deploy": [
		"@sftp-deploy deploy -- --config=\"custom-config-filename.json\""
	]
}
```

Commands
--------

[](#commands)

All commands can be run in the following way:

```
composer run sftp-deploy COMMAND_NAME
```

### Init

[](#init)

Generate a configuration file. This file will be called `sftp-deploy.config.json`.

```
composer run sftp-deploy init
```

### Build

[](#build)

Build the application.

```
composer run sftp-deploy build [checkout]
```

#### Arguments

[](#arguments)

ArgumentRequiredDefaultDescriptioncheckoutNomasterThe branch or tag you would like to checkout with git. Overwrites `repo_checkout` configuration parameter.### Deploy

[](#deploy)

Build and deploy the application to a (S)FTP server.

> **Does these actions:**
>
> - First builds your app with the `build` command.
> - Then deploys that build to the (S)FTP server.
> - Finally cleans up old builds with the `cleanup` command.

```
composer run sftp-deploy deploy [checkout]
```

#### Arguments

[](#arguments-1)

ArgumentRequiredDefaultDescriptioncheckoutNomasterThe branch or tag you would like to checkout with git. Overwrites `repo_checkout` configuration parameter.### Cleanup

[](#cleanup)

Cleanup old builds.

> **Notes:**
>
> - This only works when `builds_use_subdirectory` is enabled in the configuration.
> - Keeps up to `builds_keep_revisions` intact. See configuration.

```
composer run sftp-deploy deploy
```

Contributing
------------

[](#contributing)

You are free to contribute on this project. I want this project to become better, just like you do.

If you want to contribute, please create a fork, and make a pull request.

Please note that your pull request needs to comply to these rules:

- It has to contain a description of why it's required or uesful.
- It has to contain a description of what the fix does.
- If some code could be unclear for other developers, please add comments.
- The code must pass the automatic Github action checks. You can test that locally by running `composer run test`.

### Local installation

[](#local-installation)

```
git clone git@github.com:mentosmenno2/sftp-deploy.git
composer install
composer dump-autoload
```

### Code checks

[](#code-checks)

Code must pass code checks to be used in this project.

```
composer run test
```

You can also let the code checker try to fix problems by itself.

> **Note:**This only fixes common problems. You may need to still fix some yourself.

```
composer run fix
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~10 days

Total

3

Last Release

2189d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d2a105fd60766a6621ec8921360195f40fb4718b2025e05cabbaf3c152ec5d15?d=identicon)[mentosmenno2](/maintainers/mentosmenno2)

---

Top Contributors

[![mentosmenno2](https://avatars.githubusercontent.com/u/12169252?v=4)](https://github.com/mentosmenno2 "mentosmenno2 (60 commits)")

### Embed Badge

![Health badge](/badges/mentosmenno2-sftp-deploy/health.svg)

```
[![Health](https://phpackages.com/badges/mentosmenno2-sftp-deploy/health.svg)](https://phpackages.com/packages/mentosmenno2-sftp-deploy)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M17.0k](/packages/laravel-framework)[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M187](/packages/spatie-laravel-backup)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M788](/packages/league-flysystem-aws-s3-v3)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k12.2M45](/packages/knuckleswtf-scribe)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M73](/packages/unisharp-laravel-filemanager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
