Learn how to quickly deploy a Node.js environment on an Elastic Compute Service (ECS) instance.
Deploy with Terraform
Click one-click run to use Terraform to automatically deploy a Node.js environment on a new or existing instance.
-
To create a new instance: Set the
create = trueparameter, and then click Start Debugging > Preview and Execute. -
To use an existing instance: Set the
create = falseparameter, specify theinstance_id, and then click Start Debugging > Preview and Execute.
Deploy with an extension
Prerequisites
-
The instance has a static public IP address or an Elastic IP Address. For more information, see Enable public network access.
-
The ECS instance must be in the Running state.
-
Cloud Assistant is installed on the ECS instance and is Normal.
-
The operating system must be one of the following versions:
-
Alibaba Cloud Linux 3
-
Ubuntu 20.04 or later
-
CentOS 7.5, 7.7, 7.8, or 7.9
-
-
If you are a RAM user, follow the principle of least privilege and use the following custom policy to grant the necessary permissions.
Procedure
To install the extension on multiple instances, log on to the CloudOps Orchestration Service console. In the left-side navigation pane, choose , and then select Node.js.
-
Log on to the ECS Management Console, find the target ECS instance, and click the instance ID to open the instance details page.
-
Choose .
-
In the Install Extension dialog box, select Node.js from the Extension to Install list and click Next.
On the Public Extensions tab, select v8 for the Extension Version.
When the task status is Completed, Node.js is installed. After the installation is complete, on the Installation/Uninstallation History tab, you can see that the installation task status for Node.js is displayed as Completed.
Verification
Connect to the ECS instance and run the following command to verify the Node.js installation and version:
node -v
[root@xxx ~]# node -v
v20.16.0
[root@xxx ~]#