vincent15000's avatar

How to use Envoy with an SSH port other than 22 ?

Hello,

I'm searching how to use envoy with an SSH port other than 22.

Any idea ?

Thanks for your help.

V

0 likes
4 replies
LaryAI's avatar
Level 58

Certainly! When using Laravel Envoy with a custom SSH port, you can specify the port number in your server declaration in the Envoy.blade.php file.

Solution:

You can define the host with a port in the @servers directive. For example, if your custom SSH port is 2222, use the following format:

@servers(['web' => '[email protected]:2222'])

Alternatively, you can use SSH configuration aliases or pass extra SSH options.

Using SSH Options:

You may also include SSH options (such as port) using the --option parameter in the @task directive:

@task('deploy', ['on' => 'web', '--port' => 2222])
    cd /path/to/project
    git pull origin master
@endtask

But the most common and recommended way is to include the port directly after the host using a colon : as shown above.

Summary:
Just append :port to your server definition:

@servers(['web' => '[email protected]:2222'])

Now Envoy will connect using SSH on port 2222 instead of the default 22.

Reference:

vincent15000's avatar

Should the AI suggestions work ?

I have tested, but it doesn't work.

Please or to participate in this conversation.