Cloud Toolkit lets you upload one or more files or folders to Linux or Windows servers. This topic describes how to upload files to a remote server using Cloud Toolkit in IntelliJ IDEA.
Prerequisites
You have installed and configured Cloud Toolkit in IntelliJ IDEA. For more information, see Install and configure Cloud Toolkit in IntelliJ IDEA.
To upload files to a Windows server, ensure that the server supports OpenSSH. For more information, see Preparations.
Step 1: Add a server
Cloud Toolkit provides two ways to add a remote server. If you have a server that supports the Secure Shell (SSH) protocol, you can add it directly. If you do not have a server, you can purchase and add an Alibaba Cloud ECS instance.
Add an existing remote server
- In the IntelliJ IDEA menu bar, choose .
- On the Host tab, click Add Host.
- In the Add Host dialog box, enter the host information. Then, click Test Connection. If the connection is successful, click Add.
After the server is added, it appears on the Host tab.
Parameter Description Upload Upload a single file, multiple files, or a folder to the remote server. Terminal Log on to the remote server terminal. Command Add a command for the remote server. More Properties View the information about the remote server. Remove Remove the remote server. Diagnostic Diagnose the remote server.
Purchase an Alibaba Cloud ECS instance
- In the IntelliJ IDEA menu bar, choose .
- In the upper-right corner of the Alibaba Cloud ECS tab, click Create Instance. You are redirected to the Alibaba Cloud ECS purchase page.
After the purchase is complete, the ECS instance in the virtual private cloud (VPC) appears on the Alibaba Cloud ECS tab.
Step 2: Upload files
- On the Host or Alibaba Cloud ECS tab, click Upload in the Actions column of the target server.
- In the Upload dialog box, select the files or folders to upload and set the deployment parameters. Then, click Upload.
Parameter Description File Select the files to upload. You can select local files or a remote file URL. For local files, you can select a single file, multiple files, or a folder. Location The path on the remote server where you want to upload the files or folders. Command (Optional) The command to execute on the remote server after the files or folders are uploaded. For example, a command to decompress a compressed file or a start command. If you are only uploading files or folders, you can leave this field empty. If you are deploying an application, enter the start command for the application. Note On a Windows server, the Command field supports all PowerShell commands by default. DOS commands are not directly supported. To use DOS commands, run them from a batch script (.bat/.cmd).
Verify the result
After the deployment starts, deployment logs appear in the Console panel of IntelliJ IDEA. Check the logs to verify the upload. You can also log on to the remote server using the built-in terminal. Navigate to the upload path and run the `ls` command to check if the files were uploaded successfully.