IntelliJ IDEA 2024.1 Help

Create a remote server configuration

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.

Enable the FTP/SFTP/WebDAV Connectivity plugin

This functionality relies on the FTP/SFTP/WebDAV Connectivity plugin, which is bundled and enabled in IntelliJ IDEA by default. If the relevant features aren't available, make sure that you didn't disable the plugin.

  1. Press Ctrl+Alt+S to open the IDE settings and then select Plugins.

  2. Open the Installed tab, find the FTP/SFTP/WebDAV Connectivity plugin, and select the checkbox next to the plugin name.

To create a remote server configuration in IntelliJ IDEA, you need to:

  1. Authenticate with the remote host and set up connection between the web server installed on it and IntelliJ IDEA.

  2. Configure mapping between the IntelliJ IDEA project and the project folder on the host and its corresponding URL path.

1. Specify the name, type, and visibility of a server configuration

  1. Press Ctrl+Alt+S to open the IDE settings and then select Build, Execution, Deployment | Deployment.

    Alternatively, go to Tools | Deployment | Configuration... in the main menu.

  2. In the left-hand pane that lists all the existing server configurations, click Add item 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 IntelliJ IDEA access the server via the FTP file transfer protocol.

    • SFTP: choose this option to have IntelliJ IDEA access the server via the SFTP file transfer protocol.

    • FTPS: choose this option to have IntelliJ IDEA access the server via the FTP file transfer protocol over SSL (the FTPS extension).

    • WebDAV: choose this option to have IntelliJ IDEA access the server via the WebDAV file transfer protocol (the WebDAV extension).

  3. 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.

  4. Click the Use as default button on the toolbar to mark the server as default.

  5. Clear the Visible only for this project checkbox to enable reuse of this server access configuration in other projects.

2. Set up connection to the remote host and its server

In the Connection tab (Ctrl+Alt+S | Build, Execution, Deployment | Deployment), specify settings for the remote host access, files transfer parameters, and the web server configuration:

  1. Specify the host address, port, and user credentials to access it. The required fields differ depending on the used protocol type.

    Create remote host SFTP connection
    • SSH configuration: select one of the previously created SSH configurations from the list, or click the Browse button and create a new configuration as described in Create SSH configurations.

    • Use Rsync for download/upload/sync: select the checkbox to have IntelliJ IDEA use Rsync for uploading and downloading files, which can increase file transfer speeds.

      Click Rsync Settings to open the Rsync settings page and configure Rsync.

    Create remote host FTP, FTPS, WebDav connection
    • 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 IntelliJ IDEA 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.

  2. Set up connection to the remote host's web server:

    • Root path: specify the folder used as the remote directory 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 Browse button and select the desired folder in the Choose Root Path dialog that opens.

      • Click Autodetect. IntelliJ IDEA 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 corresponding to the folder specified in Root path. This is the base URL for your application's web address. Both HTTP and the HTTPS protocols are supported.

      Click Browse in the right-hand corner of the field to open and check the provided web server URL.

  3. (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 (Ctrl+Alt+S | Build, Execution, Deployment | Deployment), specify:

  1. Local path: the absolute path to the local project folder. IntelliJ IDEA automatically fills out this field with the path to the currently opened project.

  2. Deployment path: a folder under the server document root where IntelliJ IDEA will upload the contents of the project folder specified in the Local path field.

    If a folder with the specified name does not exist yet, IntelliJ IDEA will create it when you trigger project upload.

    The easiest way is to map the entire project root folder to a folder under the server document root. The project folder structure in this case will be recreated on the server.

  3. Web path: the URL path to the folder specified in Deployment path. In most cases, it's the same as the value provided in the Deployment path field or a slash (/) pointing to the root folder.

Overwriting the deployment destination by configuring nested mappings

You can configure separate mappings for a specific folder under your project root to have the contents of this folder synchronized with another location on the remote host.

Suppose you have configured the mappings as follows:

Local Path

Deployment Path

<project_root>

ftp://.../htdocs/my_project

<project_root>/my_folder

ftp://.../htdocs/my_folder

Then the files in your project will be uploaded as follows:

Local Path

Deployment Path

<project_root>/file1.js

ftp://.../htdocs/my_project/file1.js

<project_root>/my_folder/file2.js

ftp://.../htdocs/my_folder/file2.js

instead of ftp://.../htdocs/my_project/my_folder/file2.js

Last modified: 12 April 2024