Skip to content

Use Deployment in IntelliJ IDEA to automatically synchronize code to a remote server ​

IntelliJ IDEA Code Folding Configuration Guide Cover Image

During development, we often need to sync local code to a remote server for testing or deployment. IntelliJ IDEA provides powerful Deployment (Deployment) This feature enables automatic code upload through protocols such as SFTP and FTP. This article will explain in detail how to configure and use this feature.

What is Deployment ​

Deployment is a built-in file synchronization tool in IntelliJ IDEA, supporting:

  • Connect to remote servers through protocols such as SFTP, FTP, and FTPS

  • Manually or automatically upload/download files

  • Mapping between local and remote directories

  • File difference comparison and synchronization

Detailed Configuration Steps ​

1. Open the Deployment configuration ​

In the IDEA top menu bar, click in sequence:

  • Tools→Deployment→Configuration...

Deployment entry

2. Add new server ​

In the pop-up Deployment window:

  • Click Add Insert(+ sign)

  • Select connection type:SFTP(This article uses SFTP as an example)

  • Enter the server name, for example:drivers

Create new server

3. Configure SFTP connection ​

On the connection configuration screen, enter the following information:

Configuration itemDescriptionExample value
TypeConnection ProtocolSFTP
SSH configurationSSH connection configurationClick to create a new configuration
Root pathRemote root path/(Auto-detect)
Web server URLWeb server addresshttp://(Can be left blank)

SFTP connection configuration

Create SSH configuration ​

Click SSH configuration on the right side ... Button, create SSH connection:

  • Click Add Insert(+ sign)

  • Fill in the SSH connection information:

Configuration itemExplanationExample value
HostServer IP address172.16.3.2
PortSSH port22
UsernameLogin usernameroot
Authentication typeAuthentication methodPassword or Key pair
  • Click Test Connection Verify whether the connection is successful

SSH configuration

After the connection is successful, it will display Successfully connected! Hint.

4. Configure directory mappings (Mappings) ​

This is the most critical step: you need to associate the local directory with the remote directory:

Configuration itemDescriptionExample value
Local pathLocal project pathC:\Users\go\src\github.com\kubernetes-csi\drivers
Deployment pathRemote deployment path/root/workspace/go/src/github.com/kubernetes-csi/drivers
Web pathWeb access path (optional)Leave blank or enter a relative path

Directory mapping configuration

Path description

  • Deployment path is relative to Root path path

  • If the Root path is set to /, then the Deployment path is an absolute path

  • It is recommended to first create the target directory on the remote server.

5. Create a remote directory ​

Before configuring the mapping, it is recommended to first log in to the server via SSH and create the target directory:

bash
mkdir -p /root/workspace/go/src/github.com/kubernetes-csi/drivers

6. Perform the first upload ​

After configuration is complete, you can upload files in the following ways:

  • Right-click on the project root directory

  • Select Deployment → Upload to drivers

Upload menu

Confirm Upload dialog box:

Confirm upload

7. View upload progress ​

Upload progress and results can be found at the bottom.File Transfer Window view:

File transfer status

8. Verify the upload result ​

Log in to the server and check whether the file was uploaded successfully:

bash
ll /root/workspace/go/src/github.com/kubernetes-csi/drivers

服务器文件列表

Advanced configuration options ​

Automatic upload ​

In the Deployment configuration, you can enable automatic upload:

  • Enter Tools → Deployment→Options...

  • Check Upload changed files automatically to the default server

Exclude file ​

at Excluded Paths In the tab, you can configure files or directories not to upload:

  • For example:.git,node_modules,*.log Wait

Use Rsync ​

For a large number of files, you can enable Rsync to improve transfer efficiency:

  • Check in the connection configuration.Use Rsync for download/upload/sync

  • Configure Rsync parameters

Common operation shortcuts ​

OperationMenu pathExplanation
UploadDeployment → Upload to...Upload the current file/directory to the server
DownloadDeployment → Download from...Download files from the server
SyncDeployment → Sync with Deployed to...Synchronize local and remote files
Browse Remote HostDeployment → Browse Remote HostBrowse remote server files

Notes ​

  • Before first upload, ensure the remote directory has been created

  • File permissions: After uploading, be sure to check whether the file permissions are correct.

  • Large file transfer: Suggest using Rsync or uploading in batches.

  • configuration file:.git It is recommended to exclude files that do not need to be uploaded, such as directories, in Excluded Paths.

  • Network stability: Keep the network connection stable during upload

Summary ​

With IDEA's Deployment feature, we can:

  • ✅ One-click upload code to remote server

  • ✅ Implement mapping between local and remote directories

  • ✅ Automatically sync modified files

  • ✅ Supports multiple transport protocols

This feature greatly simplifies the development process and is especially suitable for development scenarios that require frequent testing on remote servers. After configuration is complete, you only need to focus on writing local code; file synchronization is handled automatically by IDEA.

Related links:

Last updated on11/07/2026, 02:16 PM
@fishfinal | @fishfinals | [email protected]