IntelliJ IDEA 2018.3 Help

Editing Individual Files on Remote Hosts

The functionality described on this page and in the whole Working with Web Servers: Copying Files chapter is available only in the Ultimate Edition of IntelliJ IDEA.

Once you've set up synchronization with a remote host, you can open individual files directly from the remote host and edit them in IntelliJ IDEA, without adding/downloading them to the local project. Note that for such files not included in a project, some IntelliJ IDEA features are not supported.

To take advantage of debugging, refactorings, and other advanced features, consider including the files into a project; see Accessing Files on Web Servers for details.

To edit a file on a remote host

  1. Open the Remote Host tool window by choosing Tools | Deployment | Browse Remote Host or View | Tool Windows | Remote Host from the main menu.

  2. Select the required deployment server from the list. The tool window shows a tree view of files and folders under the server root. If no relevant server is available in the list, click icons general ellipsis, and in the Deployment dialog that opens configure access to the required server.

  3. To start editing a file, double click its name or select the file name in the Remote Host Tool Window, and choose Edit Remote File from the context menu.

    Edit file on remote host

    The file opens in the IntelliJ IDEA editor, without being added or downloaded to the local project.

    Editing file on remote host

    When you work with a remote file, a special toolbar appears at the top of the editor, showing the editing status ("The file is identical to the remote one" or "The file has been changed. Upload?".

    Remote files can be distinguished from local ones by the annotation that includes the server name (in our case it is <MyServer>).

    Remote file annotation

  4. When you are done editing the file, do one of the following:

    • To upload the file to the remote host, click Upload current remote file.

    • To compare the currently opened file with the last uploaded version, click Diff with current icon. The files are opened in the standard IntelliJ IDEA Difference Viewer, see Differences Viewer for Files.

    • To discard the changes introduced to the file after the last upload, click Rollback icon.

Note that an individual file is not added to a project. As a result, all changes are discarded as soon as you close the file or the currently opened project unless these changes have been uploaded. To prevent losing your data, IntelliJ IDEA displays the following dialog when you attempt to close the edited file or the entire project.

Confirm uploading message

Last modified: 1 February 2019

See Also