Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I have remote ssh terminal access in PhpStorm?

I develop locally using PhpStorm, Git and VirtualBox on my local machine. I use Git to handle the process of moving work to staging or production environments. Currently I'm using MobaXterm (an excellent free tabbed ssh client for windows) to have terminal access to do things on staging and production servers. PhpStorm has a local terminal built in, but how would I use it to have multiple ssh terminal access? (This way I can have local, remote staging, and remote production terminal access all from within my IDE)

like image 608
prograhammer Avatar asked Oct 16 '25 09:10

prograhammer


2 Answers

Figured it out!

On a fresh copy, PhpStorm will have Tools > Terminal to bring up the local terminal. To have additional ssh terminal access, this is what I did...

  1. Setup servers
1.1) File > Settings > (Type: "Deployment" into the search box)
1.2) Hit the + button and fill in the necessary fields into the connection tab.
1.3) Click on the "Mappings" tab and clear the field "Local path"
     since we will only be using the terminal.
1.4) Repeat Steps 1.2 and 1.3 for each server you want a terminal tab for.
1.5) Don't set any of these as default, so that you will be prompted to choose
     a server in Step #2 below...

enter image description here

  1. Start a remote terminal tab (this will also open up local terminal)
2.1) Tools > Start SSH session (this option doesn't appear until Step #1 is   
     completed)
2.2) You will be prompted to select a server from Step #1.
     The terminal window appears and a new tab appears next to "local" in the
     terminal window.

enter image description here

EDIT: (Thanks to Dan Dascalescu) you may want to also ensure the SSH Remote Run plugin is enabled. It's enabled by default in PhpStorm 8 (not sure about earlier versions).

like image 130
prograhammer Avatar answered Oct 19 '25 05:10

prograhammer


PhpStorm has a plugin called "SSH Remote Run".

Remote SSH

See also the built-in terminal.

like image 30
Dan Dascalescu Avatar answered Oct 19 '25 06:10

Dan Dascalescu