In a remote server configuration, the server runs on another computer (a remote host). To access files on the remote server, use FTP/SFTP/FTPS/WebDAV protocols.
To create a remote server configuration in PyCharm, you need to:
Configure mapping between the PyCharm project and the project folder on the host and its corresponding URL path.
1. Specify the name, type, and visibility of a server configuration
Press CtrlAlt0S to open settings and then select Build, Execution, Deployment | Deployment.
Alternatively, go to Tools | Deployment | Configuration... in the main menu.
In the left-hand pane that lists all the existing server configurations, click and select the server configuration type depending on the protocol you are going to use to exchange the data with the server.
FTP: choose this option to have PyCharm access the server via the FTP file transfer protocol.
SFTP: choose this option to have PyCharm access the server via the SFTP file transfer protocol.
FTPS: choose this option to have PyCharm access the server via the FTP file transfer protocol over SSL (the FTPS extension).
WebDAV: choose this option to have PyCharm access the server via the WebDAV file transfer protocol (the WebDAV extension).
In the Create New Server dialog that opens, type the name of the connection to the server and click OK. The Create New Server dialog closes and you return to the Connection tab of the Deployment node.
Clear the Visible only for this project checkbox to enable reuse of this server access configuration in other projects.
tip
The server configuration settings are stored in the .idea directory together with the project, which allows sharing them between team members through a VCS.
2. Set up connection to the remote host and its server
In the Connection tab (CtrlAlt0S| Build, Execution, Deployment | Deployment), specify settings for the remote host access, files transfer parameters, and the web server configuration:
Specify the host address, port, and user credentials to access it. The required fields differ depending on the used protocol type.
SFTP
FTP, FTPS, WebDav
SSH configuration: select one of the previously created SSH configurations from the list, or click and create a new configuration as described in Create SSH configurations.
Use Rsync for download/upload/sync: select the checkbox to have PyCharm use Rsync for uploading and downloading files, which can increase file transfer speeds.
Host: specify the host name of the server to exchange data with.
Port: specify the port to which this server listens. The FTP/FTPS, the default value is 21. For WebDAV, the default value is 6180.
User name and Password: provide the user name and password specified during registration on the host.
Select the Save password checkbox to store the password in PyCharm permanently (otherwise, it will only be stored until the IDE restart).
Or, alternatively, select the Login as anonymous checkbox to enable anonymous authentication with the server and use email address as a password.
Set up connection to the remote host's web server:
Root path: specify the folder used as the remote directory root for browsing the remote file system and setting the server path mappings and excluded paths.
Do one of the following:
Accept the default / path, which points at the root folder on the server.
Type the path manually or click and select the desired folder in the Choose Root Path dialog that opens.
Click Autodetect. PyCharm detects the user home folder settings on the FTP/SFTP server and sets up the root path according to them. The button is only enabled when you have specified your credentials.
Web server URL: specify the URL address configured for the folder specified in Root path. Both HTTP and HTTPS are supported.
Click Browse in the right-hand corner of the field to open and check the provided web server URL.
(Optional) Expand the Advanced section to configure more settings as described in:
3. Map project folder to a server folder and URL path
In the Mappings tab (CtrlAlt0S| Build, Execution, Deployment | Deployment), specify:
Local path: the absolute path to the local project folder. PyCharm automatically fills out this field with the path to the currently opened project.
Deployment path: a folder under the server root where PyCharm will upload the contents of the project folder specified in the Local path field.
tip
Deployment path is relative to the Root path specified in the Connection tab.
If a folder with the specified name does not yet exist on the server, PyCharm will create it when you trigger project upload.
Web path: the URL path configured for the folder specified in Deployment path. You can use a slash (/) to point to the root folder, or leave the field blank if the directory is not accessible from the web.
tip
Web path is relative to the Web server URL specified in the Connection tab.
note
There are cases when you might want to add several mappings per project. For example, you can overwrite the destination folder on the server for a specific nested-folder in the PyCharm project by adding a separate mapping for it:
In this case, Users/John.Smith/demo-project/nested-folder will be uploaded to /root-path/nested-folder on the server, while all other folders and files from /demo-project will still map to /root-path/my-site.
Now that you have the server configuration added, you can access the server's files and folders in the Remote Host tool window. Go to Tools | Deployment | Browse Remote Host in the main menu, and in the tool window that opens, select the configured server from the drop-down list.
Our website uses some cookies and records your IP address for the purposes of accessibility, security, and managing your access to the telecommunication network. You can disable data collection and cookies by changing your browser settings, but it may affect how this website functions. Learn more.
With your consent, JetBrains may also use cookies and your IP address to collect individual statistics and provide you with personalized offers and ads subject to the Privacy Notice and the Terms of Use. JetBrains may use third-party services for this purpose. You can adjust or withdraw your consent at any time by visiting the Opt-Out page.