Configure an interpreter using SSH
Prerequisites
A ssh server should run on a remote host, since PyCharm runs remote interpreter via ssh-session.
If you want to copy your sources to a remote computer, create a deployment configuration, as described in the section Create a remote server configuration.
Configuring remote Python interpreter via SSH credentials
Create a new remote Python interpreter via SSH credentials
Ensure that you have downloaded and installed Python on your computer.
Do one of the following:
Click the Python Interpreter selector and choose .
Press Ctrl+Alt+S to open the project Settings/Preferences and go to . Then click the icon and select Add.
In the left-hand pane of the Add Python Interpreter dialog, click SSH Interpreter.
In the right-hand pane select New server configuration, then specify server information (host, port, and username).
In the next dialog window, provide the authentication details to connect to the target server.
Select Password or Key pair (OpenSSL or PuTTY) and enter your password or passphrase. If Key pair (OpenSSL or PuTTY) is selected, specify:
Private key file: location of the file with a private key
Passphrase: similar to a password, it serves to encrypt the private key.
Click Next to proceed with the final configuration step.
In the next dialog window, verify the path to the desired Python interpreter. You can accept default, or specify a different one. You have to configure the path mappings between your local project and the server. To do that, click next to the Sync folders field and enter the path to the local project folder and the path to the folder on the remote server.
You can also select the lowest checkbox to enable automatic upload of the local changes to the remote server.
Select the Execute code using this interpreter with root privileges via sudo checkbox to run an SSH interpreter using sudo. The root privileges will be enabled only for launching the remote interpreter. Files will be copied to the remote server with your current user privileges.
Click Finish to complete adding an interpreter.
Create a new a remote Python interpreter using an SSH configuration
Ensure that you have downloaded and installed Python on your computer.
Do one of the following:
Click the Python Interpreter selector and choose .
Press Ctrl+Alt+S to open the project Settings/Preferences and go to . Then click the icon and select Add.
In the left-hand pane of the Add Python Interpreter dialog, click SSH Interpreter.
In the right-hand pane Existing server configuration and choose any available SSH configuration from the list.
You can also create a new SSH configuration in the SSH Configurations dialog.
Click and fill the required fields. Once done, the newly created SSH configuration will appear in the list of available configurations. It will also become available in the SSH Deployment Configurations settings.
Click Next to continue configuring an interpreter.
In the next dialog window, verify the path to the desired Python interpreter. You can accept default, or specify a different one. You have to configure the path mappings between your local project and the server. To do that, click next to the Sync folders field and enter the path to the local project folder and the path to the folder on the remote server.
You can also select the lowest checkbox to enable automatic upload of the local changes to the remote server.
Select the Execute code using this interpreter with root privileges via sudo checkbox to run an SSH interpreter using sudo. The root privileges will be enabled only for launching the remote interpreter. Files will be copied to the remote server with your current user privileges.
Click Finish to complete adding an interpreter.
In case of adding an interpreter as a root user, you will be asked to provide your password.
Select Remember to keep using the password for this interpreter even you restart PyCharm. The interpreters added with root privileges are marked with sudo in the list of the available interpreters.