Run SSH terminal
Add SSH configurations: Settings | Tools | SSH Configurations
Start an SSH session from the main menu: Tools | Start SSH Session
Configure SSH terminal: Settings | Tools | SSH Terminal
You can launch an SSH Session right from PhpStorm. By running commands in a dedicated SSH terminal, you can access data on a remote Web server or a Vagrant instance (virtual machine) via an SSH tunnel, mainly upload and download files.
Make sure an SSH server is available in the destination environment: a remote Web server or a Vagrant instance (virtual machine).
Register an account on the SSH server in the destination environment and generate a pair of SSH keys or a password, depending on the server policy.
For more information about working with SSH keys, refer to the Generating a new SSH key and adding it to the ssh-agent tutorial.
Appoint the destination environment and specify the settings to establish connection with it:
In the Settings dialog () , go to Tools | SSH Terminal.
In the Connection settings area, appoint the destination environment:
Current Vagrant: select this option to have the commands in the SSH Terminal executed on the currently running Vagrant virtual machine.
Default remote interpreter: select this option to have commands in the SSH terminal executed on the same host, where the default remote interpreter runs.
SSH configuration: select this option to have the commands in the SSH Terminal executed on the local or remote Web server accessible through one of the SSH configurations.
Select SSH configuration on every run: if this option is selected, you will have to choose the desired configuration from the popup, every time you choose Tools | Start SSH Session from the main menu.
If the desired SSH configuration does not appear in the list, click the Set up configurations link, and define one in the SSH Configurations page.
From the Default encoding list, select the desired encoding to be used in the SSH terminal.
In the main menu, go to Tools | Start SSH Session. Alternatively, invoke the Help | Find Action dialog, search for start ssh.., and select Start SSH Session.
Depending on the connection settings, defined in on the Tools | SSH Terminal page of the Settings dialog () , the following types of behavior are possible:
If the Default remote interpreter option has been selected, the SSH terminal will provide access to the same host, where the default remote interpreter runs.
If the Current Vagrant option has been selected, the SSH Terminal will provide access to the currently running Vagrant virtual machine.
For more information, refer to Vagrant.
If the SSH configuration option has been selected, the SSH Terminal will provide control over the data on the server accessible through the SSH configuration selected from the list. For more information, refer to Create SSH configurations.
If the Select SSH configuration on every run option has been selected, PhpStorm will show a list to choose the desired SSH configuration from.
SSH connections in PhpStorm run via OpenSSH, which maintains comprehensive logs both on the client and on the server. The exact location depends on your operating system.
For example, in Linux distributions that are based on Fedora, you should be able to see the logs by running journalctl -u ssh
.