PHPackages                             dgvirtual/deploy-via-ftp - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. dgvirtual/deploy-via-ftp

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

dgvirtual/deploy-via-ftp
========================

Simple script package for deploying PHP projects to a shared hosting server via FTP or FTPS.

11Shell

Since Jan 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/dgvirtual/deploy-via-ftp)[ Packagist](https://packagist.org/packages/dgvirtual/deploy-via-ftp)[ RSS](/packages/dgvirtual-deploy-via-ftp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Deploy via FTP
==============

[](#deploy-via-ftp)

This is a simple script package for deploying PHP projects to a shared hosting server via FTP or FTPS. It allows you to synchronize directories or upload individual files using `lftp` and `curl`.

Author
------

[](#author)

**Name**: Donatas Glodenis
**Email**:

Dependencies
------------

[](#dependencies)

This project has the following dependencies:

- **bash**: Used to run the deployment script itself;
- **lftp**: Used for synchronizing directories;
- **curl**: Used for uploading individual files;
- **composer**: Required for installing this package and updating the vendor directory before and after deployment.

**Note**: The project has been tested on **Ubuntu 24.04 LTS**.

Ensure that `bash`, `lftp`, `curl`, and `composer` are installed and accessible in your system's `PATH`.

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

[](#installation)

You can install this package via Composer by running these commands at the root of your project:

```
composer require dgvirtual/deploy-via-ftp:dev-master
```

**Note**: although the project will not be used on the production server, it should be installed using `composer require` and not `require-dev`, as the app **removes** all dev-only packages before deploying `vendor` directory, and it should not remove itself.

This will install the `deploy-via-ftp` package from your GitHub repository and make the deployment script available in your project.

Then you will be able to run the deploy script via command:

```
./vendor/dgvirtual/deploy-via-ftp/src/deploy.sh [options]
```

You can also add an entry to your project's composer.json scripts section:

```
    "scripts": {
        "deploy": "./vendor/dgvirtual/deploy-via-ftp/src/deploy.sh"
    }
```

to be able to run the script more conveniently as

```
composer deploy [options]
```

Usage
-----

[](#usage)

### Synchronizing Directories

[](#synchronizing-directories)

You can use the following commands to synchronize directories with your remote FTP server:

```
composer deploy app
composer deploy vendor
composer deploy public
composer deploy public dry-run
```

You can also combine multiple directories in a single command:

```
composer deploy app vendor
```

#### Available Arguments

[](#available-arguments)

- **app**: Synchronize the `app` directory only.
- **vendor**: Synchronize the `vendor` directory only.
- **public**: Synchronize the `public_html` directory only.
- **dry-run**: Perform dry run (without changing content on the server).

### Uploading a Single File

[](#uploading-a-single-file)

To upload a single file, use the following command:

```
composer deploy onefile [local_path]
```

**Example:**

```
composer deploy onefile app/Controllers/Test.php
```

This will upload `app/Controllers/Test.php` to the corresponding location on your FTP server. The remote path will be determined based on the local path.

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

[](#configuration)

Before you can use the deployment script, you need to configure your FTP settings.

1. On the first run, if the `.ftp_config` file is missing in the main project directory, the script will prompt you to create it by running an `install.sh` script.
2. The `install.sh` script will:
    - Copy `ftp-config.example` to `.ftp_config`.
    - Optionally add `.ftp_config` to your `.gitignore` file.
    - Instruct you to edit `.ftp_config` with your FTP credentials.

### Example `.ftp_config`:

[](#example-ftp_config)

```
# .ftp_config
USERNAME="myname"
PASSWORD="mySecretPass"
PROTOCOL="ftps"  # or "ftp"
PORT=21
SERVER="ftp.example.com"

# Remote directories
REMOTE_APP="/myproject/app"
REMOTE_VENDOR="/myproject/vendor"
REMOTE_PUBLIC_HTML="/public_html"

# Exclusion patterns
APP_EXCLUDE_GLOBS=""
VENDOR_EXCLUDE_GLOBS=""
PUBLIC_EXCLUDE_GLOBS="--exclude-glob='uploads/*' --exclude-glob='index.php'"

# Local directories
LOCAL_APP="app"
LOCAL_VENDOR="vendor"
LOCAL_PUBLIC_HTML="public"
```

Edit this file with your FTP credentials and paths as needed.

Notes
-----

[](#notes)

- The script assumes that your project follows a structure where directories like `app`, `vendor`, and `public_html` are located in the base directory, while the server you deploy to places `app` and `vendor` inside `myproject` directory, which, along with `public_html`, is at the root of the directory structure accessible to ftp.
- Make sure to review the exclusion patterns in the `.ftp_config` file and adjust them to suit your project.

If you have any issues or need further assistance, feel free to contact the author at .

---

This `README.md` file provides clear instructions for installing, configuring, and using the `deploy-via-ftp` script, tailored specifically for your needs.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![dgvirtual](https://avatars.githubusercontent.com/u/2669306?v=4)](https://github.com/dgvirtual "dgvirtual (13 commits)")

### Embed Badge

![Health badge](/badges/dgvirtual-deploy-via-ftp/health.svg)

```
[![Health](https://phpackages.com/badges/dgvirtual-deploy-via-ftp/health.svg)](https://phpackages.com/packages/dgvirtual-deploy-via-ftp)
```

###  Alternatives

[deployer/deployer

Deployment Tool

11.1k25.4M207](/packages/deployer-deployer)[appwrite/server-ce

End to end backend server for frontend and mobile apps.

55.3k84.2k](/packages/appwrite-server-ce)[pragmarx/health

Laravel Server &amp; App Health Monitor and Notifier

2.0k1.0M2](/packages/pragmarx-health)[felixfbecker/language-server-protocol

PHP classes for the Language Server Protocol

22476.7M6](/packages/felixfbecker-language-server-protocol)[heroku/heroku-buildpack-php

Toolkit for starting a PHP application locally, with or without foreman, using the same config for PHP and Apache2/Nginx as on Heroku

8161.3M10](/packages/heroku-heroku-buildpack-php)[tiamo/phpas2

PHPAS2 is a php-based implementation of the EDIINT AS2 standard

4674.7k](/packages/tiamo-phpas2)

PHPackages © 2026

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