Getting started
ECI-Client is a command-line interface (CLI) client built on Alibaba Cloud SDKs. Use it to create, view, and release elastic container instances directly from your terminal—with the same command syntax as Docker.
In three steps, you install and configure ECI-Client, then run your first elastic container instance and verify it is running.
Prerequisites
Before you begin, ensure that you have:
A Linux or macOS machine (ECI-Client does not support Windows)
An Alibaba Cloud AccessKey pair (AccessKey ID and AccessKey Secret)
A VPC, vSwitch, and security group in the target region—or use
--initto create them automatically
Step 1: Install ECI-Client
Open a terminal and run:
sudo bash -c "$(curl -s https://eci-docs.oss-cn-beijing.aliyuncs.com/eci-client/1.0/install.sh)"Step 2: Configure ECI-Client
Set your credentials and network context:
eci config set-context \
--access-key-id <your-access-key-id> \
--access-secret <your-access-secret> \
--region-id cn-beijing \
--security-group-id <your-security-group-id> \
--v-switch-id <your-vswitch-id>Passing credentials directly on the command line stores them in your shell history as plain text. Store your AccessKey ID and AccessKey Secret in environment variables and reference them in your commands instead.
Replace the placeholders with your actual values:
| Placeholder | Description |
|---|---|
<your-access-key-id> | Your Alibaba Cloud AccessKey ID |
<your-access-secret> | Your Alibaba Cloud AccessKey Secret |
<your-region-id> | Region where your resources are located (e.g., cn-beijing) |
<your-security-group-id> | ID of your security group (e.g., sg-xxx) |
<your-vswitch-id> | ID of your vSwitch (e.g., vsw-xxx) |
If you don't have a VPC, vSwitch, or security group, use --init to create them automatically:
eci config set-context \
--access-key-id <your-access-key-id> \
--access-secret <your-access-secret> \
--initNetwork access requirements:
To reach the Internet from within a VPC, associate a NAT (Network Address Translation) gateway with the VPC. See Enable Internet access.
To access an elastic container instance from the Internet, add inbound security group rules. See Add a security group rule.
Step 3: Run your first container
ECI-Client uses the same syntax as Docker—replace docker with eci.
Run a CentOS container:
eci run -t centos bash -c "while true; do sleep 5; date; done"The instance ID is returned after the command is run.
List all running instances to confirm the container is up:
eci psThe output shows the ID, name, creation time, and status of each instance.
What's next
Explore the full ECI-Client command reference: eci-client-doc