All Products
Search
Document Center

Resource Orchestration Service:Deploy a WordPress environment with phpMyAdmin

Last Updated:Sep 16, 2026

This solution uses an Alibaba Cloud Resource Orchestration Service (ROS) public template to create, with one click, a WordPress blog cluster and a phpMyAdmin database management environment that provide high availability (HA) and elastic scaling.

Solution overview

With one click, this pre-built ROS public template deploys a WordPress blog cluster and a phpMyAdmin database management environment that provide HA and elastic scaling. It applies to website deployment scenarios that require automatic scaling, load balancing, and an independently hosted database.

What are WordPress and phpMyAdmin?

  • WordPress: An open source blog and content management system (CMS) platform developed with PHP and MySQL. More than 40% of websites worldwide are built with WordPress.

  • phpMyAdmin: A PHP-based web tool for managing MySQL databases. It lets you manage MySQL databases through a browser interface, for example, viewing table schemas, running SQL statements, and importing or exporting data.

List of resource types to be created

No.

Resource name

ROS resource type

Quantity

Purpose

1

Virtual Private Cloud (VPC)

ALIYUN::ECS::VPC

1

Provides an isolated network environment.

2

vSwitch

ALIYUN::ECS::VSwitch

1

Divides the VPC into subnets and specifies a zone.

3

Elastic Compute Service (ECS) instance

ALIYUN::ECS::Instance

1

Serves as the initial WordPress node on which WordPress and phpMyAdmin are installed.

4

ApsaraDB RDS for MySQL instance

ALIYUN::RDS::DBInstance

1

Hosts WordPress data. All ECS nodes share this database.

5

Elastic IP address (EIP)

ALIYUN::VPC::EIP

2

Used for Internet access to the ECS instance and for outbound access through the NAT Gateway, respectively.

6

NAT Gateway

ALIYUN::VPC::NatGateway

1

Provides public network access (source network address translation (SNAT)) for the ECS nodes in the scaling group.

7

Server Load Balancer (SLB)

ALIYUN::SLB::LoadBalancer

1

Distributes HTTP traffic to multiple WordPress nodes.

8

Scaling group

ALIYUN::ESS::ScalingGroup

1

Automatically adds or removes WordPress ECS nodes based on traffic loads.

Results after deployment

After the template runs successfully, you get:

  • A complete VPC network environment (VPC + vSwitch)

  • An ECS instance on which WordPress and phpMyAdmin are installed, with a public IP address for direct access

  • An ApsaraDB RDS for MySQL instance, with the WordPress database and account created

  • An SLB instance that serves as the public access point for WordPress

  • A scaling group that automatically adds or removes WordPress ECS nodes based on load

  • A NAT Gateway that provides public network access for the ECS instances newly created in the scaling group

  • The WordPress access URL and the phpMyAdmin management address in the stack Outputs

Architecture diagram

User access
                          ↓
                          Classic Load Balancer (CLB) ←──  Internet (yum repositories, etc.) ←── NAT Gateway
                     ↙     ↓     ↘
               ECS-1    ECS-2    ECS-N    ← Automatically managed by the scaling group
               (WordPress + phpMyAdmin)
                     ↘     ↓     ↙
                    ApsaraDB RDS for MySQL (shared database)

Prerequisites

Before you use this template, make sure that the following conditions are met:

  • Account permissions: Your Alibaba Cloud account has permissions to create ECS, ApsaraDB RDS, VPC, SLB, and Auto Scaling (ESS) resources.

  • Basic knowledge: You understand the basic syntax and structure of ROS templates. For more information, see Get started with ROS templates.

Solution design

Why is elastic scaling required?

A single ECS instance that hosts WordPress works well when traffic is low. However, a traffic spike, such as when a popular article is shared, can cause the website to respond slowly or even become unavailable. The scaling group does the following:

  1. Monitors the CPU utilization or network traffic of the existing ECS instances

  2. When the load exceeds a threshold, automatically creates ECS instances based on the scaling configuration template

  3. Automatically registers new ECS instances as SLB backend servers so that they start sharing traffic

  4. When the load decreases, automatically releases excess ECS instances to reduce costs

Why use ApsaraDB RDS instead of local MySQL on ECS?

  • Data persistence: ECS instances are created and released during scaling, so data in a local MySQL database is lost. An ApsaraDB RDS instance exists independently and stores the data persistently.

  • Multi-node sharing: Multiple WordPress ECS nodes read and write the same data and therefore require a centralized database.

  • Professional operations and maintenance (O&M): ApsaraDB RDS provides enterprise-grade database features such as automatic backup, primary/secondary replication, monitoring, and alerting.

Why is a NAT Gateway required?

For security reasons, the ECS nodes newly created in the scaling group have no public IP address, but they need Internet access to:

  • Install WordPress and dependency packages from yum or apt repositories

  • Download WordPress plug-ins and themes

    A NAT Gateway uses an SNAT rule to let all nodes in the VPC share one EIP for outbound access, so you do not need to assign a public IP address to each ECS instance.

How SLB works with a scaling group

Component

Responsibility

CLB

Receives user HTTP requests and distributes them to the backend ECS instances based on policies.

ESS ScalingGroup

Manages the number of ECS nodes and automatically creates or releases instances.

ESS ScalingConfiguration

Defines the specification template for new ECS instances, including the image, instance type, and initialization script.

SLB BackendServer

The scaling group automatically registers newly created ECS instances as SLB backend servers.

Deployment

Parameter settings

Required input parameters (must be specified during deployment)

Parameter name

Type

Description

Constraints

Zone ID

String

The zone of the vSwitch. The ECS instance and the ApsaraDB RDS instance are deployed in this zone.

Dynamically selected in the console

Instance Type

String

ECS instance type: it is recommended to use at least 2 vCPUs and 4 GB of memory.

For example, ecs.g6.large

Image Id

String

The operating system image of the ECS instance.

For example, centos_7_04_64_20G_alibase_201701015.vhd

System Disk Type

String

The system disk type.

For example, cloud_efficiency (ultra disk)

Instance Password

String

The ECS logon password.

8 to 30 characters in length, and must contain uppercase letters, lowercase letters, digits, and special characters

Specifications

String

The SLB instance type.

For example, slb.s1.small

Category

String

Category of The ApsaraDB RDS,valid value:

  • Basic Edition

  • High_availability Edition

  • Cluster Edition for MySQL

Basic Edition

RDS.Instance Type

String

The ApsaraDB RDS instance type.

For example, rds.mysql.s1.small

Engine Version

String

The MySQL version number.

For example, 5.7

Instance Storage

Number

The ApsaraDB RDS storage capacity (GB).

5 to 2000, in increments of 5

Database Name

String

The name of the database that WordPress uses.

For example, wordpress

User Name

String

The ApsaraDB RDS database account.

For example, wpuser

User Password

String

The ApsaraDB RDS database password.

8 to 30 characters in length, and must contain uppercase letters, lowercase letters, digits, and special characters

Optional configuration parameters

This public template has no optional parameters. All parameters must be specified during deployment, and none of them have default values. For your first deployment, use the example values in the Constraints column of the preceding table.

Deployment methods

Method 1: Deploy by using a ROS public template (recommended)

  1. Log in to the ROS console.

  2. In the left-side navigation pane, choose Templates > Public Templates > Getting Started templates.

  3. In the top menu bar, select the region where the stack will reside.

  4. Search for the template named Create a Scalable WordPress Cluster Based on Resources Such as ApsaraDB for RDS.

  5. Click Create Stack.

  6. On the Configure Parameters page, enter the Stack Name and specify the deployment parameters described in the preceding section.

  7. Click Next: Check and Confirm, and then click Create.

  8. Wait until the stack status changes to CREATE_COMPLETE.

  9. Click the Outputs tab of the stack to view the WordPressUrl access address.

Method 2: Deploy by using ROS IaC Code

IaC Code is an AI infrastructure-as-code assistant for cloud infrastructure. It generates ROS templates from natural language descriptions and deploys them. For more information, see IaC Code quick start.

# Prompt
Create a WordPress cluster that provides high availability (HA) and elastic scaling.
Requirements:
1. Create a VPC and a VSwitch as the basic network.
2. Create an ApsaraDB RDS for MySQL 5.7 instance as the WordPress database. Set the database name to wordpress.
3. Create an ECS instance and install WordPress and phpMyAdmin on it.
4. Create an SLB instance as the website access point.
5. Create an ESS scaling group and use the same configuration template as the initial ECS instance.
6. Create a NAT Gateway and an SNAT rule to provide public network access for the ECS instances in the scaling group.
7. Open port 80 (HTTP) and port 22 (Secure Shell) in the security group.
8. Include the WordPress access URL in the stack Outputs.

Post-deployment operations

Access WordPress

  1. Get WordPressUrl from the Outputs tab of the stack.

  2. Open the URL in a browser.

  3. The first time you open the URL, the WordPress installation wizard starts. Configure the site title, the administrator account, and other settings.

  4. After completion, you can log in to the WordPress admin dashboard at /wp-admin to publish content.

FAQ

Q1: The deployment fails and returns "The specified InstanceType is not available"

Cause: The selected ECS or ApsaraDB RDS instance type is out of stock in the specified zone.

Solutions:

Q2: The WordPress page loads slowly or times out

Troubleshooting steps:

  1. Check the SLB status: Confirm that the SLB health check is normal (SLB console > Instances > Backend Servers). If the health check of an ECS instance fails, SLB does not forward traffic to that ECS instance.

  2. Check the ApsaraDB RDS connection: Log on to the ECS instance and run mysql -h<RDS internal endpoint> -u<username> -p to test database connectivity.

  3. Check ECS resources: Run top or free -m to check whether CPU and memory usage is saturated. If it is, the cluster needs to scale out.

Q3: The scaling group does not scale out automatically

Causes and troubleshooting:

  1. Go to the Auto Scaling console, and confirm that the scaling group is in the Enabled state.

  2. Check whether a scaling rule and an alert task, such as an alert triggered based on CPU utilization, are configured.

  3. This public template creates a scaling group and a scaling configuration, but you need to manually add a scaling rule:

    • Go to the Auto Scaling console, find the target scaling group, click the Scaling Rules and Event-triggered Tasks tab.

    • Add rules: add 1 instance when CPU > 70%, and remove 1 instance when CPU < 30%.

      For more information, see Configure scaling rules.

To learn more about resource deployment issues, see FAQ collection.

References