Package and deploy the Spring Boot project to the Alibaba Cloud linux server

First of all, you must ensure that you have a java environment on your server.
If not, you can refer to my article
to install java JDK1.8 version in the linux server.
Then we open our Spring Boot project,
double-click the package life cycle to package and
insert image description here
package. After we find the target, there will be A jar package, then we right-click it to operate as shown in the figure below,
insert image description here
the system will help you open the directory where it is located,
insert image description here
then we open the terminal in this directory
insert image description here
, and then we execute

scp -r ./WebDom-0.0.1-SNAPSHOT.jar 用户名(如果之前没设置过就是 root)@服务器公网地址:/

You need to find the corresponding information here.
Here you need to enter the password.
insert image description here
Finally, if you can output the following content, it means success.
insert image description here
Then we come to the linux server and
enter

cd /

Go back to the top-level directory
insert image description here
and enter

ll

View the file to see our file and
insert image description here
then we execute

java -jar WebDom-0.0.1-SNAPSHOT.jar

Run this program
insert image description here
and the project will start

Guess you like

Origin blog.csdn.net/weixin_45966674/article/details/131783131