PHPackages                             leozhang989/laravel-remote - 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. leozhang989/laravel-remote

ActiveLibrary

leozhang989/laravel-remote
==========================

Execute Artisan commands on remote servers, support for php &lt; 8.0

1.0.2(5y ago)17MITPHPPHP ^8.0

Since Mar 9Pushed 4y agoCompare

[ Source](https://github.com/leozhang989/laravel-remote)[ Packagist](https://packagist.org/packages/leozhang989/laravel-remote)[ Docs](https://github.com/spatie/laravel-remote)[ GitHub Sponsors](https://github.com/spatie)[ RSS](/packages/leozhang989-laravel-remote/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (9)Versions (7)Used By (0)

Execute Artisan commands on remote servers
==========================================

[](#execute-artisan-commands-on-remote-servers)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1a52566d2e0061383522e45b28e1eeaa2367da3f2c460ec416628d1896acf6e4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f6c61726176656c2d72656d6f74652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-remote)[![GitHub Tests Action Status](https://camo.githubusercontent.com/f7f264dc663889c858584dbdbf0204213912d9c66c2b7d53ef6b10e2fd689cc3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7370617469652f6c61726176656c2d72656d6f74652f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/spatie/laravel-remote/actions?query=workflow%3ATests+branch%3Amaster)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/7a923e32fbd37d2a32c4f63f41b5196f249f00d2beac5f85cd31671fd2de9f99/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7370617469652f6c61726176656c2d72656d6f74652f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/spatie/laravel-remote/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/6921f41e66c5a8eb76f462056456358690b3534b16ceccfbc8f2891af594a4b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6c61726176656c2d72656d6f74652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-remote)

This package provides a command to execute Artisan command on a remote server.

Here's an example that will clear the cache on the remote server.

```
php artisan remote cache:clear
```

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/c8d9df30fbdc7bc7cb97402cf8f4b2f6c1b5893fc5a46faeefd9d712dcaa3286/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d72656d6f74652e6a70673f743d32)](https://spatie.be/github-ad-click/laravel-remote)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

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

[](#installation)

You can install the package via composer:

```
composer require spatie/laravel-remote
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Spatie\Remote\RemoteServiceProvider" --tag="remote-config"
```

This is the contents of the published config file:

```
return [
    /*
     * This host will be used if none is specified
     * when executing the `remote` command.
     */
    'default_host' => 'default',

    /*
     * Here you can define the hosts where the commands should be executed.
     */
    'hosts' => [
        'default' => [
            'host' => env('REMOTE_HOST'),

            'port' => env('REMOTE_PORT', 22),

            'user' => env('REMOTE_USER'),

            /*
             * The package will cd to the given path before executing the given command.
             */
            'path' => env('REMOTE_PATH'),
        ]
    ],
];
```

Usage
-----

[](#usage)

To execute a command on the remote server use the `remote` Artisan command. You can pass any artisan command that you would like to execute on the server.

Here's an example where we clear the cache.

```
php artisan remote cache:clear
```

### Executing raw commands

[](#executing-raw-commands)

If you want to execute a bash command, use the `--raw` option.

Here we will get a list of files on the server.

```
php artisan remote ls --raw
```

### Using another host

[](#using-another-host)

You can define hosts in the config file. By default, the `default` host is used. To execute a command on another host use the `--host` option.

```
php artisan remote cache:clear --host=my-other-host
```

### Using options in remote commands

[](#using-options-in-remote-commands)

If you need to use flags or options in the command you're trying to execue, you can wrap the entire command in quotes:

```
php artisan remote --raw "ls -a"
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 81% 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 ~4 days

Total

6

Last Release

1867d ago

Major Versions

0.0.3 → 1.0.02021-03-10

### Community

Maintainers

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

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (34 commits)")[![chapeupreto](https://avatars.githubusercontent.com/u/834048?v=4)](https://github.com/chapeupreto "chapeupreto (4 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (2 commits)")[![majidalaeinia](https://avatars.githubusercontent.com/u/11965368?v=4)](https://github.com/majidalaeinia "majidalaeinia (2 commits)")

---

Tags

spatielaravel-remote

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/leozhang989-laravel-remote/health.svg)

```
[![Health](https://phpackages.com/badges/leozhang989-laravel-remote/health.svg)](https://phpackages.com/packages/leozhang989-laravel-remote)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k89.8M1.0k](/packages/spatie-laravel-permission)[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M191](/packages/spatie-laravel-backup)[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-honeypot

Preventing spam submitted through forms

1.6k6.0M60](/packages/spatie-laravel-honeypot)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[spatie/laravel-pdf

Create PDFs in Laravel apps

9963.4M12](/packages/spatie-laravel-pdf)

PHPackages © 2026

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