All Products
Search
Document Center

Elastic Compute Service:Purchase a Linux instance and set up a WordPress website from the console

Last Updated:Jun 02, 2026

WordPress is a popular open-source website builder. Deploy WordPress on ECS to quickly launch a site and start publishing content.

Procedure

Before you begin, make sure you have completed your account setup and linked a credit card or PayPal account.

Important

New ECS users who have completed their account setup can try ECS free for 3 months. For details, see the ECS Free Trial.

Step 1: Create an ECS instance

  1. Go to the ECS console - Instances page, click Create Instance.

  2. Choose Custom Launch and configure the instance.

    Configure the instance with the following example settings. Keep the defaults for any settings not listed here.

    Configuration item

    Example value

    Billing Method

    Pay-as-you-go

    Region

    US (Silicon Valley)

    Network and Zone

    VPC: Default VPC

    vSwitch: Select the default vSwitch in Availability Zone B.

    Instance

    ecs.c9i.large

    We recommend at least 2 vCPU and 4 GiB of memory for a smooth experience.

    Image

    Select Alibaba Cloud Linux 3.2104 LTS 64bit under Public Images.

    System Disk

    Type:  Enterprise SSD (ESSD)

    Size: 40 GiB

    Performance: PL0

    Public IP Address

    Select Assign Public IPv4 Address.

    Bandwidth Billing Method

    Pay-by-traffic

    We recommend selecting Upgrade to CDT for Data Transfer Billing. This provides 220 GB/month of free public traffic after upgrade: 20 GB/month for Chinese mainland regions, 200 GB/month for regions outside.

    Security Group

    Select New Security Group. Under the Basic Security Group settings, in the Open IPv4 ports/protocols section, select HTTP (TCP:80) and SSH (TCP:22) to allow external HTTP access.

    Logon Credential

    Select Set Later

  3. Review the estimated cost, read and accept the terms of service, and click Create Order.

Step 2: Connect to the ECS instance

  1. Return to the instance list. Wait until the instance status shows Running and Health Status shows Normal, then click Connect in the Actions column.

  2. In the dialog box, click Sign in now.

  3. Select Password-Free and click Log In.

    A remote connection session stays active for up to 6 hours. If idle for more than 6 hours, the session disconnects automatically and you must reconnect.

A command-line prompt indicates a successful connection.

Step 3: Set up WordPress

  1. Deploy the LNMP environment.

    Run the following script to install the LNMP stack (Linux + Nginx + MySQL + PHP) required by WordPress. Replace MYSQL_PASSWORD with a custom MySQL root password before running. You will need this password when configuring the WordPress database.

    The password must be 8 to 30 characters and include uppercase letters, lowercase letters, digits, and special characters. Supported special characters: ()` ~!@#$%^&*-+=|{}[ ]:;'<>,.?/.
    curl -fsSL https://help-static-aliyun-doc.aliyuncs.com/install-script/deploy-lnmp-acl3_2.sh | MYSQL_ROOT_PASS='MYSQL_PASSWORD' bash
    This script is designed for Alibaba Cloud Linux 3.2104 LTS 64bit only.
  2. Log in to MySQL and create a database and user for WordPress.

    • MYSQL_PASSWORD: MySQL root password you set in the previous step.

    • WORDPRESS_PASSWORD: A custom password for the WordPress database user.

      The password must be 8 to 30 characters and include uppercase letters, lowercase letters, digits, and special characters. Supported special characters: ()` ~!@#$%^&*-+=|{}[ ]:;'<>,.?/.
    mysql -u root -p'MYSQL_PASSWORD' <<EOF
    CREATE DATABASE wordpress;
    CREATE USER 'wordpress_user'@'localhost' IDENTIFIED BY 'WORDPRESS_PASSWORD';
    GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress_user'@'localhost';
    FLUSH PRIVILEGES;
    EOF

    This creates a database named wordpress and a user wordpress_user with full privileges on that database.

  3. Download and extract WordPress.

    cd /usr/share/nginx/html && sudo wget https://cn.wordpress.org/wordpress-6.4.4-zh_CN.zip && sudo yum install unzip -y && sudo unzip wordpress-6.4.4-zh_CN.zip
  4. Configure the database connection.

    1. Back up the default configuration.

      sudo cp /usr/share/nginx/html/wordpress/wp-config-sample.php /usr/share/nginx/html/wordpress/wp-config.php
    2. Edit wp-config.php to set the database credentials. Replace WORDPRESS_PASSWORD with the WordPress user password you set.

      sudo sed -i "s/database_name_here/wordpress/" /usr/share/nginx/html/wordpress/wp-config.php && \sudo sed -i "s/username_here/wordpress_user/" /usr/share/nginx/html/wordpress/wp-config.php && \sudo sed -i "s/password_here/WORDPRESS_PASSWORD/" /usr/share/nginx/html/wordpress/wp-config.php
  5. Update the Nginx site root directory and restart the service.

    sudo sed -i 's|root /usr/share/nginx/html;|root /usr/share/nginx/html/wordpress;|' /etc/nginx/conf.d/default.conf && sudo nginx -t && sudo systemctl restart nginx

Step 4: Install WordPress and publish your first article

  1. Install and log in to WordPress.

    1. Open a browser and go to http://<ECS public IP address> to access the WordPress installation page.

      You can find the public IP in the IP Address column of the instance list.
    2. Enter the site title, administrator username, password, and email, then click Install WordPress.

    3. After installation, click Log In and enter the credentials you just set.

  2. Publish an article to verify access.

    1. In the left navigation pane, go to Posts > Add New Post.

    2. Enter a title (for example, "Hello from Alibaba Cloud ECS") and click Publish in the upper-right corner. Click Publish again in the confirmation dialog.

    3. Copy and open the article URL. If the page displays your article, the website is live.

Billing

Billable items

  • System disk: 40 GiB (disk capacity) × disk unit price × billing duration

  • Public bandwidth (pay-by-traffic): Outbound traffic × per-GB price

    After upgrade to CDT for Data Transfer Billing, you will receive 220 GB/month of public network traffic (20 GB/month for Chinese mainland regions, 200 GB/month for regions outside).
  • Compute resources: Instance type unit price × billing duration

Refer to the ECS Pricing page for unit prices.

View billing details

Log on to the Expenses and Costs Console, and then choose Billing > Bill Details. Filter by Product Name and select Elastic Compute Service to view detailed charges.

Clean up resources

Release the instance when you no longer need it to stop incurring charges.

Important

Releasing an instance permanently deletes all its data. This action cannot be undone.

  1. In the instance list, click image > Instance Status > Release in the Actions column for the target instance.

  2. Choose Release Now and click Next.

  3. Confirm that no associated resources need to be retained, and click OK.

Related information