Deploy artifacts from Flow pipelines to Alibaba Cloud ECS instances, public hosts, or free trial hosts. This guide covers host connection, deployment job creation, configuration, and rollback.
Workflow
Connect a new host: Create a host group and add a host.
Add a host deployment job: Create or add a deployment job to a pipeline.
Configure a host deployment job: Set deployment parameters.
Manage deployment jobs: View deployment details and roll back a deployment.
Connect a host
On the Flow homepage, click Global Settings > Host Group Management.
On the Host Group Management page, select a host group and click Add New Host. Flow supports the following connection methods.
If no host group exists, Create a host group first.
Manually install runner
NoteThis method works for all host types, including Alibaba Cloud ECS instances and non-Alibaba Cloud hosts.
On the Add New Host page, select Manually Install Runner as the connection method.
Copy the Runner installation command and run it on the target host. The host must have public network access. Select Linux for Operating System Type. In the Connect Host section, copy the installation command and run it on the target host. The command contains temporary parameters (Runner version, token, and AccessKey) and expires after a limited time. After the command completes, click I Understand.
The following terminal output indicates a successful connection.
INFO[2025-04-29T13:34:12+08:00] service type linux-systemd, user , realUser root INFO[2025-04-29T13:34:12+08:00] Aliyun yunxiao runner-v0.3.1-be-d5zh**** service started INFO[2025-04-29T13:34:12+08:00] Aliyun yunxiao runner-v0.3.1-be-d5zh**** service status runningAfter the Runner is installed, the host is automatically added to the current host group. Refresh the host list to verify.
Deploy to non-Alibaba Cloud hosts
You can deploy applications to your own hosts (non-Alibaba Cloud) with Flow. An enterprise edition is not required.
To deploy to a non-Alibaba Cloud host:
Install the Runner on the target host using the Manually Install Runner method described above.
When you create a pipeline, select a template that supports host deployment, such as the Java · Test, Build, and Deploy to Alibaba Cloud ECS/Your Own Host template.
NoteThe Execute Shell step does not support passwordless connections to hosts. To run commands on a remote host without entering credentials, use the VM Deploy step with a pre-installed Runner.
Alibaba Cloud ECS
On the Add New Host page, select Alibaba Cloud ECS as the connection method.
Select a service connection. If none exists, click Add Service Connection to create one.
Select a region and a host.
Click Save.
NoteDeployment permissions are described in Permission management.
Hybrid cloud hosting
To use this method, first register your non-Alibaba Cloud host as an Alibaba Cloud managed instance. After registration, the host can access Alibaba Cloud online services.
Select a service connection. If none exists, click Add Service Connection to create one.
Select the region of the managed host and the host to add.
Click Save.
Free trial host
On the Add New Host page, select Free trial host as the connection method.
Click Alibaba Cloud Experience Lab to apply for free trial resources.
Click Start Now to go to the resource application page.
Flow provides three types of trial resources: Trial resources (5 hours), Claim free trial credits, and Personal account resources. Refer to the trial resource descriptions on the page. This example uses Trial resources (5 hours).
Select Trial resources (5 hours) and click Confirm and start trial.
After the trial resources are created, view the resource information in the Cloud product resources list. Note the AccessKey ID, AccessKey Secret, ECS instance ID, and region — these are required to import the host.
The resource list also includes RAM user name, RAM user password, ECS public address, ECS logon name, logon password, and IP whitelist. Click the copy icon next to each field to copy its value.
Return to Flow. Enter the AccessKey ID, AccessKey Secret, ECS instance ID, and region of the trial resources, and then click Save.
Click Save. Flow installs the agent on the trial host, which takes about
15s. Refresh the host group page to view the connected host.After refreshing, the Runner Status shows Normal and the Installation Progress shows Successful, confirming that the agent is installed.
Add a host deployment job
You can add a host deployment job in either of the following ways.
From a template
When creating a pipeline, select a language and a template that includes a VM Deploy job.
For example, select Java as the language and then select the Java · Test, Build, and Deploy to Alibaba Cloud ECS/Your Own Host template.
Add to a pipeline
In an existing pipeline, click New Task and select VM Deploy.
Multi-environment and multi-region deployment
Deploy across regions
To deploy to hosts in different regions (for example, the US and Japan) in a single pipeline, create a separate host group for each region. Add a VM Deploy job for each host group in the pipeline.
Orchestrate multiple microservices
To deploy multiple microservices to multiple hosts, you can use a single pipeline with separate build and deployment jobs for each service, or create individual pipelines per service for independent maintenance. You do not need a separate pipeline for each host — configure parallel deployment within host groups.
Select a deployment environment at runtime
Flow does not support dynamically selecting a deployment environment during a pipeline run. To control which environments to deploy to:
Create a separate host group for each environment (for example, staging and production).
Add a VM Deploy job for each host group in the pipeline.
Insert a Manual Confirmation node between deployment jobs to control the execution flow.
Choose the correct deployment component
When deploying to Alibaba Cloud ECS instances, use the VM Deploy component instead of the ECS Application component. The VM Deploy component connects to hosts through the Runner agent and correctly associates with your host instances.
Configure a host deployment job
This section uses a Java sample code project to demonstrate configuration. For the test and build stage, refer to Test and build. When uploading artifacts, include the deploy.sh file from the repository.
Select Download Artifacts During Deployment. This option is selected by default.
Select an Artifact Name.
Select the Host Group to deploy to. To create a new one, click New Host Group. Host group management.
ImportantA host group manages deployment resources and configurations. All hosts in the group must have a Java runtime environment.
Specify the Deployment Configuration parameters.
Parameter
Description
Download path
The path on the host where the artifact is downloaded to.
Execute user
The user account that runs the deployment commands, for example, root.
Deployment script
In this example, the deployment script extracts the package and runs it.
mkdir -p /home/admin/application tar zxvf /home/admin/app/package.tgz -C /home/admin/application/ sh /home/admin/application/deploy.sh restartdeploy.sh is a shell script that starts a JAR package. Replace it with your own deployment script in production.
ImportantDuring deployment, Flow starts processes with names beginning with
rdc_deploy_command_. Do not operate on these processes in your deployment script, or the deployment may fail.Configure a Deployment Strategy.
To deploy to multiple hosts at once, use batched releases. Specify a deployment strategy in the host deployment job. For example, with four hosts and two batches, Flow deploys to two hosts per batch.
Pause strategy
Description
FirstBatchPause
After the first batch completes, verify the result. Click Continue to deploy subsequent batches.
No Pause
All batches deploy automatically without pausing.
EveryBatchPause
Each batch requires manual approval before the next batch starts.
Batch number: The total number of deployment batches. Hosts are divided into the specified number of batches.
To use environment variables in deployment, refer to Environment variables.
Refer to the parameter descriptions above for the complete configuration.
Deployment script usage
The Deployment Script field is optional. If you leave it empty, Flow only downloads the artifact to the host without performing any deployment actions. No error is reported. Write the extraction, configuration, and startup logic in the deployment script to complete the deployment.
The inline deployment script has a character length limit. If your script exceeds the limit, upload the shell script file to a Git repository or the target host, and call it in the Deployment Script field. For example:
sh /home/admin/deploy.shDeploy multiple services independently on a single host
If you deploy multiple services to the same host and want to release them independently, create a separate host group for each service. The host groups can contain the same host. Configure a separate deployment job for each host group in the pipeline, and specify different download paths and startup scripts to isolate each deployment.
Run scripts in parallel
To run multiple scripts in parallel on a single host, add an additional VM Deploy component to the pipeline without selecting Download Artifacts During Deployment. Write your script commands directly in this component. The scripts in different VM Deploy components run in parallel with the main deployment.
Deployment mechanism and artifact transfer
Full artifact download
Each host deployment downloads the complete artifact package. Incremental updates are not supported.
Build stage vs. deployment stage
The "install" step in the build configuration installs dependencies such as JDK and Maven on the Flow build cluster, not on your host. The "upload artifact" step packages and uploads files to the artifact repository. The artifact is downloaded to your host only during the deployment stage.
Deploy static resources to a host
To deploy HTML or other static files to a host:
In the build stage, package the source files into an artifact.
In the deployment script, extract the files to the target directory:
mkdir -p /home/admin/www/html tar zxvf /home/admin/app/package.tgz -C /home/admin/www/html/
Deploy artifacts to a custom directory
To deploy a JAR file or other artifact to a custom directory such as /app/jar/zh:
mkdir -p /app/jar/zh
tar zxvf /home/admin/app/package.tgz -C /app/jar/zh/
cd /app/jar/zh && sh start.shYou can also place the startup script on the target host in advance.
Deploy with Docker Compose
Flow supports deploying applications with Docker Compose. Execute docker-compose commands in the Deployment Script.
Prerequisites
Docker and Docker Compose must be installed on the target host before deployment.
Synchronize the docker-compose.yml file
The pipeline does not automatically transfer the docker-compose.yml file from the code repository to the target host. Use one of the following methods to make the file available on the target host:
Package the
docker-compose.ymlfile into the build artifact during the build stage. The file is downloaded to the host with the artifact during deployment.Transfer the file in the deployment script using
scp,wget, orgit clone.
Example deployment script:
cd /home/admin/app
tar zxvf package.tgz
docker-compose up -dDeploy Python or other code-based projects
For Python or similar projects, upload the code to the artifact repository during the build stage, then download and extract it during deployment. Alternatively, pull the code from Git in the deployment script.
Manage deployment jobs
View deployment details
After configuring the deployment job, run the pipeline. During deployment, click deployment details to view the status. On the pipeline run details page, find the VM Deploy job and click deployment details to open the details page.
Deployment status | Description |
Deploying | You can Stop the deployment or view the logs. |
To be deployed | No actions available. |
Succeeded | You can view the deployment logs. |
Failed | Click Retry in the card view to restart the deployment. You can also view deployment logs or refer to FAQ for troubleshooting. |
Skipped | This deployment job was skipped. |
Roll back a deployment
In the pipeline's Deployment History, find the deployment to roll back and click Roll Back.
A rollback re-executes the deployment using the historical artifact and deployment script. It is equivalent to running a new deployment with a previous version — not a simple state revert. If no historical artifact is available, rollback is not possible.
Deployment packages are retained for 30 days only. You cannot roll back deployments older than 30 days.
Troubleshoot deployment failures
Application not running after deployment succeeds
If the pipeline shows a successful deployment but the application is not running on the host, the most likely cause is a missing startup command in the deployment script. Host deployment only transfers the artifact and runs the deployment script. It does not automatically start applications. Ensure your deployment script includes commands to extract the artifact and start the application process. For example:
tar zxvf /home/admin/app/package.tgz -C /home/admin/application/
sh /home/admin/application/deploy.sh restartManage SLB traffic during deployment
To remove and restore Server Load Balancer (SLB) traffic during deployment, add traffic management commands to the deployment script. Best practices:
Create a host group that contains a single host.
Add the following steps in sequence within the deployment script: remove the host from the SLB, deploy the application, verify the deployment, and restore the host to the SLB.
Running all steps on the same host group prevents inconsistencies that occur when traffic removal and restoration target different hosts.