WordPress is a free, open-source content management system (CMS) for building websites such as blogs, news sites, e-commerce stores, and social media platforms. This topic describes how to deploy WordPress on an Elastic Compute Service (ECS) instance running Windows Server by setting up a WIMP environment (Windows, IIS, MySQL, PHP), installing WordPress, and optionally configuring a custom domain name.
Prerequisites
Before you begin, make sure that you have:
Windows Server 2022 (or another supported version). The graphical interface may vary depending on the operating system version.
A public IP address automatically assigned to the instance, or an elastic IP address (EIP) associated with it. For instructions, see Enable public bandwidth.
Inbound security group rules that open the following ports: For instructions, see Add a security group rule.
Port
Purpose
80
HTTP traffic for the WordPress website
3389
RDP access to the Windows instance
Open ports only as needed. For example, to connect to a MySQL database on the instance, add an inbound rule to open port 3306 (the default MySQL port).
Step 1: Set up the WIMP environment
WIMP stands for Windows, Internet Information Services (IIS), MySQL, and PHP. Install each component before you proceed.
Each WordPress version requires specific PHP and MySQL versions. Incompatible versions may cause installation failure. Check the WordPress Compatibility page before you choose versions. This tutorial uses WordPress 6.4.4, IIS 10.0, MySQL 8.0, and PHP 8.0.
Install the three components using the following guides:
Component | Guide |
IIS | |
MySQL | |
PHP | How do I use IIS to build a PHP environment on a Windows instance? |
Step 2: Download and extract WordPress
Connect to the ECS instance. For instructions, see Use Workbench to connect to a Windows instance over RDP.
Download the WordPress 6.4.4 installation package from the official WordPress website.
NoteThis tutorial uses WordPress 6.4.4. Visit the official WordPress website for other versions. If you download from an instance in a region inside the Chinese mainland and receive the
429 Too Many Requestserror, retry or download the package from a third-party website.Extract the installation package. In this tutorial, the package is extracted to
C:\wordpress-6.4.4\wordpress.
Step 3: Create a MySQL database
Navigate to the
binfolder of the MySQL installation directory. In this example, the path isC:\BtSoft\mysql\MySQL8.0\bin.Hold the
Shiftkey, right-click a blank area in the folder, and select Open command window here.Log in to MySQL: Enter the root password when prompted.
.\mysql -u root -pCreate a database named
wordpress:create database wordpress;
Step 4: Configure WordPress
In the
C:\wordpress-6.4.4\wordpressdirectory, copywp-config-sample.phpand rename the copy towp-config.php.Open
wp-config.phpin a text editor and update the database connection fields:Database name (
DB_NAME):wordpressDatabase user (
DB_USER): your MySQL username (for example,root)Database password (
DB_PASSWORD): your MySQL password
Save and close the file.
Step 5: Configure IIS for WordPress
Open the Start menu. In the Windows Server section, click Server Manager.
In the top navigation bar of the Server Manager window, choose Tools > Internet Information Services (IIS) Manager.
In the Connections pane, expand < ECS instance name> > Sites.
Remove or reassign any website currently bound to port 80: In this example, the website named
127.0.0.1bound to port 80 is deleted.Delete the existing website bound to port 80, or
Change its port to an unused number (for example, 8088).
In the Actions pane on the right, click Add Website and configure the following parameters:
Parameter
Value
Site name
wordpressPhysical path
C:\wordpress-6.4.4\wordpressPort
80
Step 6: Install WordPress
On the Windows instance, open a web browser and go to
http://localhost/to launch the WordPress installation page.Fill in the site information:
Field
Description
Example
Site Title
Name of the WordPress website
demowpUsername
Admin login username (choose a secure name)
testwpPassword
Admin login password (use a strong password)
--
Your Email
Email address for notifications
example.comClick Run the installation.
Click Install WordPress.
Enter the username and password you specified during installation and click LOGIN.
You are now logged in to your WordPress dashboard. For more information about using WordPress, see the WordPress documentation.
Configure a domain name
Using a public IP address to access your WordPress website exposes the instance directly. To improve security, bind a domain name instead.
Register a domain name
Register a domain name through Alibaba Cloud. For instructions, see Register a domain name on Alibaba Cloud.
Apply for an ICP filing (Chinese mainland only)
If the ECS instance is in a region inside the Chinese mainland, apply for an Internet content provider (ICP) filing before you use the domain name. For instructions, see ICP filing process.
Resolve the domain name
Point the domain name to the public IP address of the ECS instance. For instructions, see Get Started.
For answers to frequently asked questions about DNS resolution, see FAQ about DNS resolution issues.
Update WordPress to use the domain name
Connect to the ECS instance. For instructions, see Overview of ECS remote connection methods.
Navigate to the
C:\BtSoft\mysql\MySQL8.0\binfolder. Hold theShiftkey, right-click a blank area, and select Open command window here.Log in to MySQL: Enter the root password when prompted.
mysql -u root -pSwitch to the WordPress database:
use wordpress;Update the site URL. Replace
http://www.example.comwith your actual domain name:update wp_options set option_value = replace(option_value, 'http://localhost', 'http://www.example.com') where option_name = 'home' OR option_name = 'siteurl';Exit MySQL:
exit;
The domain name is now configured for your WordPress website.
FAQ
Why can I not access the WordPress website through the public IP address?
Possible causes and solutions:
Port 80 is blocked. The port may not be open in the security group, the system firewall may be enabled on the instance, or another service may be using port 80. For troubleshooting steps, see What do I do if I cannot access a service deployed on an instance?
Version incompatibility. The PHP or MySQL version may be incompatible with your WordPress version. Check the WordPress Compatibility page for supported version combinations.
References
To deploy WordPress with Docker, see Use Docker Compose to deploy applications.
To upload themes or plug-ins to WordPress via FTP, build an FTP server first:
To host multiple websites on one ECS instance:
To enable HTTPS with an SSL certificate, see Installation overview.