This document explains how to deploy and run application artifacts for different programming languages (Java, Go, Python, C++, and Node.js) on an Alibaba Cloud ECS instance.
The role of manual deployment in CI/CD
Manual deployment serves several purposes in automation:
Baseline for automation: Exposes efficiency bottlenecks and quality issues to drive optimization.
Bridge to automation: Enables gradual script development and integration into CI/CD tools.
Emergency fallback: Acts as a temporary replacement for a failed automated process.
Gatekeeper for critical steps: Allows for manual approval and data validation for high-risk operations.
Training tool: Helps teams understand underlying logic through manual server configuration and failure recovery.
Strengthen error handling during the transition phase. After an emergency operation, update the automation configuration accordingly. Limit manual intervention to high-risk scenarios. Supplement training with documentation to prevent knowledge gaps.
Pros and cons of manual deployment
Pros:
Low barrier to entry: You can quickly validate small project prototypes without setting up a complex automation toolchain.
Flexibility: Developers can adjust the process, such as by skipping test steps or directly accessing the server to respond to urgent changes.
Control and visibility: Full manual control ensures transparent and manageable operations, making it easier to troubleshoot issues.
Fallback mechanism: Serves as an emergency solution when automation fails. It is especially useful for systems with infrequent deployments or strict security and compliance requirements, such as in finance or government.
Cons:
Inefficient and hard to scale: Repetitive manual tasks are slow and difficult to adapt across multiple environments.
Prone to errors: Environmental differences, such as local dependency versions, and human errors, like configuration mistakes or missed tests, can lead to unstable deployments and even production issues.
Difficult to track and roll back: The lack of version history and a rollback mechanism makes it hard to trace deployments. It can also create knowledge silos in team collaboration, cause resource conflicts in parallel tasks, and hinder continuous delivery.
Manual deployment practices
Transfer files to an ECS instance
Before deploying your application, transfer your code or build artifacts to an ECS instance. ECS offers several methods for file transfer. For more information, see Select a method to transfer files.
Build practices for multiple languages
Java
Environment configuration
Configure the Java environment. For instructions, see Deploy a Java environment.
Install a build tool.
For Java web projects, we recommend using Maven or Gradle as your build tool.
Go to the Maven official website to download the Maven installation package. Then, extract it and configure the environment. For more information, see the Maven configuration documentation.
Go to the Gradle official website to download the Gradle installation package. Then, configure and test Gradle. For instructions, see the Gradle Quick Start.
Deploy and run
This example uses the demo-template-thymeleaf module from the open-source project spring-boot-demo.
Clone the project by using Git:
sudo git clone https://github.com/xkcoding/spring-boot-demo.gitBuild the project by using Maven:
sudo cd spring-boot-demo/demo-template-thymeleaf sudo mvn clean packageThe build is complete when you see the following output.

Start the project in the background by using
nohup:sudo nohup java -jar target/demo-template-thymeleaf.jar > app.log 2>&1 &nohup: Prevents the process from receiving a hang-up (HUP) signal when the terminal is closed.> app.log: Redirects the standard output to theapp.logfile.2>&1: Redirects the standard error to the same location as the standard output, which isapp.log.&: Runs the process in the background.
View the logs:
sudo tail -f app.logThe service starts successfully when you see the following output in the logs.

In a web browser, open
http://<your_ecs_public_ip>:8080/demoto view the project page.
Go
Environment configuration
Note: This project requires Go 1.24 or later. Run the following commands to install the Go compiler.
# The following commands use Go 1.24.0 as an example. # Download the Go installation package. sudo wget https://go.dev/dl/go1.24.0.linux-amd64.tar.gz # Extract the package. sudo tar -zxvf go1.24.0.linux-amd64.tar.gz -C /usr/local/ # Configure the environment variable. sudo echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bash_profile && source ~/.bash_profileVerify the Go version:
go versionThe Go environment is configured when you see the following output.

Build and run
This example uses the open-source project go-admin, a permission management system boilerplate built with Gin, Vue, Element UI, Arco Design, and Ant Design, featuring a decoupled frontend and backend.
Create a development directory:
# Create a development directory. mkdir goadmin && cd goadminClone the source code for the frontend and backend.
ImportantThe two projects must be in the same directory.
# Get the backend code. sudo git clone https://github.com/go-admin-team/go-admin.git # Get the frontend code. sudo git clone https://github.com/go-admin-team/go-admin-ui.git
Start the backend
Update project dependencies and build the project:
# Go to the go-admin backend project directory. cd ./go-admin # Update and tidy dependencies. sudo go mod tidy # Compile the project. sudo go buildDeploy a MySQL database. For instructions, see Deploy a MySQL database.
Create a new database named
go_admin:sudo create database go_admin;Modify the configuration file:
# Modify the configuration. # File path: go-admin/config/settings.yml sudo vim ./config/settings.ymlIn the configuration file, you can change the service port and database-related parameters.

Initialize the database:
sudo ./go-admin migrate -c config/settings.ymlWhen the console displays the message
数据库基础数据初始化成功(Database basic data initialized successfully), the database initialization is complete.
Start the
go-adminservice:sudo ./go-admin server -c config/settings.yml -a trueThe service starts successfully when the console displays the service URL.

Start the frontend
Install dependencies:
sudo npm install --registry=https://registry.npmmirror.comStart the frontend service:
sudo npm run devThe service starts successfully when you see the following output in the console.

In a web browser, open
<your_ecs_public_ip>:9527. The service is deployed successfully when the following page appears. Follow the on-screen instructions to configure the system.
C++
Environment configuration
Install the build tools for C++ compilation:
# For Ubuntu/Debian
sudo apt update
sudo apt install build-essential
# For CentOS/RHEL
sudo yum groupinstall "Development Tools"Create a C++ source file
Use a text editor such as nano or vim to create a new C++ file. For example, create a simple Hello World program.
// hello.cpp
#include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}Compile and run
Compile the program:
sudo g++ hello.cpp -o helloThis command generates an executable file named
hello.Run the compiled program:
sudo ./helloThe program runs successfully when you see the following output.

For larger projects, consider using a build system like
MakefileorCMaketo manage the compilation process.Create a file named
Makefileand add the following content.all: hello hello: hello.cpp g++ hello.cpp -o hello clean: rm -f helloUse the
makecommand to compile and generate the executable file.
Python
Deploy and run
This example uses the open-source project Qexo, a fast, powerful, and elegant online static blog editor.
Configure the Python environment. For instructions, see Deploy a Python environment.
Clone the
Qexosource code by using Git:sudo git clone https://github.com/Qexo/Qexo.gitInstall the required project dependencies:
sudo pip3 install -r requirements.txtDeploy a MySQL database. For instructions, see Deploy a MySQL database.
Create a new database for
Qexonamedqexo_ecs:create database qexo_ecs;In the project's root directory, open the configuration file:
sudo cp configs.example.py configs.py sudo vim configs.pyAdd the following configuration to the file. Replace the database IP address, username, and password with your actual information.
import pymysql pymysql.install_as_MySQLdb() DOMAINS = ["127.0.0.1", "yoursite.com", "localhost"] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'qexo', 'USER': 'root', 'PASSWORD': '', 'HOST': '127.0.0.1', 'PORT': '3306', 'OPTIONS': { "init_command": "SET sql_mode='STRICT_TRANS_TABLES'" } } }Start the service:
sudo python3 manage.py makemigrations sudo python3 manage.py migrate sudo python3 manage.py runserver 0.0.0.0:8000 --noreloadAllow traffic on port
8000in the security group of the instance. For instructions, see Add security group rules.In a web browser, open
<your_ecs_public_ip>:8000. The service is deployed successfully when the following page appears. Follow the on-screen instructions to configure the system.
Node.js
This example uses the open-source project vue-naive-admin, a lightweight admin template built with Vue3, Vite, Pinia, Unocss, and Naive UI. Both the frontend and backend of the project are built with Node.js.
Backend
Configure the Node.js environment. For instructions, see Deploy a Node.js environment.
Clone the backend source code for the project:
sudo git clone https://github.com/zclzone/isme-nest-serve.gitInstall dependencies:
sudo npm iDeploy a MySQL database. For instructions, see Deploy a MySQL database.
Create a new database named
isme:create database isme;Initialize the project's database:
mysql -u -p isme < init.sqlOpen the configuration file and modify the database connection information:
sudo vim .envIn the configuration file, modify the service port and database-related parameters.
# Service port APP_PORT=8085 # DB DB_HOST=localhost DB_PORT=3306 DB_USER= DB_PWD= DB_DATABASE=isme DB_SYNC=true # Specifies whether to enable synchronization. Set to false in a production environment. # Redis REDIS_URL=redis://default:123456@localhost:6379 # JWT JWT_SECRET="d0!doc15415B0*4G0`" # Specifies whether it is a preview environment. IS_PREVIEW=falseStart the service:
sudo npm run start:devThe service starts successfully when the running logs are displayed in the console.

Frontend
Clone the frontend source code for the project:
sudo git clone -b 2.x https://github.com/zclzone/vue-naive-admin.gitInstall the project dependencies:
sudo cd vue-naive-admin/ sudo npm iStart the project:
sudo npm run devThe project starts successfully when the access URL is displayed in the console.

In a web browser, open
http://<your_ecs_public_ip>:3200. The project is deployed successfully when the following page appears.
System monitoring and log analysis
After you configure and build your system, monitor system metrics and perform log collection, analysis, and alerting. Alibaba Cloud offers a comprehensive solution for system monitoring and log analysis. For details on configuring system monitoring, alerting, and log analysis, see the following documents:







