Cloud Toolkit supports deploying applications to servers that use the standard Secure Shell (SSH) protocol. You can quickly deploy applications by selecting a target server in the graphical user interface without having to switch between different tools. This topic describes how to deploy a local application to a Linux server using Cloud Toolkit in IntelliJ IDEA.
Prerequisites
You have installed and configured Cloud Toolkit. For more information, see Install and configure Cloud Toolkit in IntelliJ IDEA.
You have a Linux server that supports the standard SSH protocol.
Deploy an application to a Linux server
You can deploy a local application. The steps are as follows:
Import your local application into IntelliJ IDEA.
Add a server.
In the IntelliJ IDEA menu bar, choose .
On the Host tab, click Add Host.
In the Add Host dialog box, set parameters such as Host List, Username, and Password, and then click Add.
NoteAfter you set the parameters, you can click Test Connection to verify the connection to the server.
Deploy the application.
In the IntelliJ IDEA menu bar, choose .
In the Deploy to Host dialog box, set the deployment parameters and then click Run.
The following table describes the deployment parameters.
Parameter
Description
File
Maven Build: If the current project is a Maven project, you can build and deploy it directly.
Upload File: If the current project is not a Maven project, or if a packaged deployment file already exists on your computer, select and upload the local deployment file.
Gradle Build: If the current project is a Gradle project, select this option to build and deploy it.
Target Host
From the drop-down list, select a tag, and then select the server where you want to deploy the application.
Target Directory
Enter the deployment path on the server, such as
/root/tomcat/webapps.Command
Enter the application start command, such as
sh /root/restart.sh.
Result Verification
After the deployment starts, the Console pane in IntelliJ IDEA displays the deployment logs. You can check the deployment result based on the log information.
You can also log on to the remote server using the built-in terminal. After you log on, use the cd command to go to the deployment path and then run the ls command to check if the deployment was successful. To log on to the remote server, perform the following steps:
At the bottom of the IntelliJ IDEA editor, click the Alibaba Cloud View tab, and then click the Host tab.
On the Host tab, click Terminal in the Actions column for the target remote server to log on to the server.
For more information about how to view application deployment logs, see Use Cloud Toolkit to view daily rolling log files on a remote server.