• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

How to Set Up a WordPress Site on a Hong Kong VPS with aaPanel (Step-by-Step 2026)

March 21, 2026

Running WordPress on a Hong Kong VPS gives you full control over your server environment, significantly better performance than shared hosting, and — with CN2 GIA routing — fast page load times for visitors in mainland China and across East Asia.

This guide walks through the complete setup process using aaPanel (宝塔面板 international edition) — one of the most popular server management panels for Linux VPS, with a clean web interface that makes server administration accessible even if you are not a command-line expert.

By the end of this tutorial, you will have a fully functional WordPress site running on Nginx with PHP 8.x, MySQL, Redis object caching, and a free SSL certificate — optimised for performance from China and the Asia-Pacific region.


What You Need Before Starting

  • A Hong Kong VPS with at least 1 vCPU and 1 GB RAM (2 GB recommended for comfortable WordPress operation)
  • A fresh installation of Ubuntu 22.04 LTS or CentOS 7/8 (Ubuntu 22.04 recommended)
  • Root SSH access to your VPS
  • A domain name with DNS pointed to your VPS IP address
  • An SSH client — Terminal on macOS/Linux, or PuTTY / Windows Terminal on Windows

Important: Start with a clean OS installation. Do not attempt to install aaPanel on a server that already has Apache, Nginx, or MySQL running — package conflicts will cause installation failures.


Step 1: Connect to Your VPS via SSH

Open your terminal and connect to your VPS using the IP address and root credentials provided by your hosting provider:

ssh root@YOUR_VPS_IP

Accept the host key fingerprint on first connection, then enter your root password. You should see the server’s command prompt.

Before installing anything, update the system package list and apply available upgrades:

apt update && apt upgrade -y

This ensures your base system is current and reduces the chance of dependency conflicts during installation. The process typically takes 1–3 minutes on a fresh VPS.


Step 2: Install aaPanel

aaPanel provides a one-line installer script. Run the following command for Ubuntu/Debian systems:

wget -O install.sh http://www.aapanel.com/script/install-ubuntu_6.0_en.sh && bash install.sh aapanel

For CentOS systems, use:

yum install -y wget && wget -O install.sh http://www.aapanel.com/script/install_6.0_en.sh && bash install.sh aapanel

The installer will:

  1. Ask you to confirm the installation directory (press Enter to accept the default)
  2. Install all required dependencies automatically
  3. Configure the aaPanel service and firewall rules
  4. Display your aaPanel login URL, username, and password on completion

Installation takes approximately 2–5 minutes. Save the login credentials displayed at the end — you will need the URL, username, and password to access the panel.

The output will look similar to this:

==================================================================
Congratulations! Installed successfully!
==================================================================
aaPanel Internet Address: http://YOUR_VPS_IP:7800/xxxxxxxx
aaPanel Internal Address: http://YOUR_VPS_IP:7800/xxxxxxxx
username: admin_xxxxxxxx
password: xxxxxxxxxxxxxxxx
==================================================================

Step 3: Log In to aaPanel and Install the LNMP Stack

Open the aaPanel URL in your browser. You may see a security warning if your browser does not trust the self-signed certificate — this is expected. Proceed to the login page and enter the credentials from the installer output.

On first login, aaPanel will prompt you to install a software stack. Select LNMP (Linux + Nginx + MySQL + PHP) — this is the recommended stack for WordPress performance:

  • Nginx: Select version 1.24 or latest stable
  • MySQL: Select version 8.0 (or 5.7 if you need broader plugin compatibility)
  • PHP: Select version 8.1 or 8.2
  • phpMyAdmin: Optional but recommended for database management
  • Redis: Check this box — you will use it for WordPress object caching

Click One-click install and wait for the installation to complete. This typically takes 5–15 minutes depending on your VPS speed. You can monitor progress in the task log at the bottom of the panel.


Step 4: Open Required Firewall Ports

Navigate to Security in the aaPanel left sidebar. Ensure the following ports are open:

  • Port 80 — HTTP (required for Let’s Encrypt SSL verification and unencrypted access)
  • Port 443 — HTTPS (required for SSL)
  • Port 7800 — aaPanel admin interface (restrict to your IP address if possible for security)
  • Port 22 — SSH (already open; consider changing to a non-standard port later)

If your VPS provider also has a network-level firewall (security group or ACL), ensure the same ports are open there as well — aaPanel’s firewall only controls the server’s internal iptables rules.


Step 5: Create a MySQL Database for WordPress

Navigate to Database in the aaPanel sidebar and click Add Database. Fill in the following:

  • Database name: wordpress_db (or any name you prefer)
  • Username: wp_user
  • Password: Generate a strong password (click the generate button) and save it somewhere safe
  • Access: Leave as 127.0.0.1 (local access only — more secure)

Click Submit to create the database. Note down the database name, username, and password — you will enter these during the WordPress installation wizard.


Step 6: Create a Website in aaPanel

Navigate to Website in the aaPanel sidebar and click Add Site. Configure as follows:

  • Domain: Enter your domain name (e.g. yourdomain.com). Add both yourdomain.com and www.yourdomain.com
  • Root directory: Leave as the default (/www/wwwroot/yourdomain.com)
  • PHP version: Select the PHP version you installed (8.1 or 8.2)
  • Database: Select the database you just created
  • FTP: Optional — skip unless you specifically need FTP access

Click Submit. aaPanel will create the Nginx virtual host configuration and website directory automatically.


Step 7: Download and Install WordPress

Navigate to the website root directory via aaPanel’s File Manager, or use SSH:

cd /www/wwwroot/yourdomain.com

Download the latest WordPress:

wget https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
mv wordpress/* .
rm -rf wordpress latest.tar.gz

Set correct file permissions:

chown -R www:www /www/wwwroot/yourdomain.com
find /www/wwwroot/yourdomain.com -type d -exec chmod 755 {} \;
find /www/wwwroot/yourdomain.com -type f -exec chmod 644 {} \;

Now open your domain in a browser. You should see the WordPress installation wizard. Click Let’s Go and enter the database credentials you created in Step 5:

  • Database Name: wordpress_db
  • Username: wp_user
  • Password: your generated password
  • Database Host: 127.0.0.1
  • Table Prefix: Change from wp_ to something random (e.g. hk7_) for security

Complete the installation wizard by entering your site title, admin username, and admin email. WordPress is now installed.


Step 8: Install a Free SSL Certificate

Navigate to Website in aaPanel, click on your site name, then select SSL. Choose Let’s Encrypt and click Apply.

aaPanel will automatically verify your domain ownership via HTTP and install a free SSL certificate. This typically takes under 60 seconds.

Once installed, enable Force HTTPS to automatically redirect all HTTP traffic to HTTPS. Your site is now accessible securely at https://yourdomain.com.

Let’s Encrypt certificates expire after 90 days. aaPanel handles automatic renewal — no manual action required.


Step 9: Configure Nginx for WordPress (Permalinks Fix)

WordPress requires a specific Nginx configuration to handle pretty permalinks correctly. Navigate to Website → your site → Configuration in aaPanel and locate the Nginx config file. Ensure the following block is present inside the server {} block:

location / {
    try_files $uri $uri/ /index.php?$args;
}

location ~ \.php$ {
    fastcgi_pass unix:/tmp/php-cgi-81.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

location ~ /\.ht {
    deny all;
}

aaPanel typically inserts this configuration automatically when you create a PHP site, but verify it is correct. Save and reload Nginx:

nginx -t && systemctl reload nginx

Step 10: Enable Redis Object Caching

Redis object caching stores the results of database queries in memory, dramatically reducing page generation time for WordPress — particularly effective for sites with significant traffic from China where every millisecond of latency matters.

Install the Redis Object Cache plugin from the WordPress admin panel:

  1. Go to Plugins → Add New in your WordPress dashboard
  2. Search for Redis Object Cache (by Till Krüss)
  3. Install and activate the plugin
  4. Navigate to Settings → Redis and click Enable Object Cache

Add the following lines to your wp-config.php file (above the line that says /* That's all, stop editing! */):

define('WP_REDIS_HOST', '127.0.0.1');
define('WP_REDIS_PORT', 6379);
define('WP_CACHE_KEY_SALT', 'yourdomain_');
define('WP_REDIS_TIMEOUT', 1);
define('WP_REDIS_READ_TIMEOUT', 1);

Return to the Redis settings page in WordPress admin. The status should now show Connected with cache hits accumulating after a few page loads.


Step 11: Performance Verification

With your WordPress site live, run the following checks to confirm everything is working correctly:

Test SSL

Visit https://yourdomain.com and confirm the padlock icon appears in your browser. Run an SSL check at ssllabs.com for a full certificate grade report.

Test page load speed from China

Use a tool like 17ce.com or boce.com — both offer multi-node speed tests from locations across mainland China. With CN2 GIA routing and Redis caching enabled, you should see Time to First Byte (TTFB) values under 200 ms from major Chinese cities.

Test Redis caching

In the WordPress admin under Settings → Redis, verify the hit ratio increases with successive page loads. A ratio above 80% indicates Redis is working effectively.

Verify Nginx is serving requests

curl -I https://yourdomain.com

The response headers should include Server: nginx.


Optional: Install a Page Caching Plugin

Redis handles database object caching. For full-page caching — which serves pre-rendered HTML to visitors without executing PHP at all — install one of the following:

  • LiteSpeed Cache — excellent performance, works well with Nginx via its page caching module
  • W3 Total Cache — highly configurable, supports Redis page caching in addition to object caching
  • WP Super Cache — simpler setup, reliable static file caching for lower-traffic sites

Full-page caching is the single highest-impact WordPress performance optimisation available. Combined with Redis object caching, a properly configured WordPress site on a Hong Kong VPS with CN2 GIA routing will consistently outperform expensive managed WordPress hosting services for East Asian audiences.


Troubleshooting Common Issues

WordPress shows a blank white page after installation

This is typically a PHP memory limit issue. Add the following to wp-config.php:

define('WP_MEMORY_LIMIT', '256M');

Permalinks return 404 errors

The Nginx try_files directive is missing or incorrect. Re-check Step 9 and reload Nginx after making changes.

SSL certificate fails to install

Verify that your domain’s DNS A record is correctly pointing to your VPS IP address, and that port 80 is open and accessible from the internet. Let’s Encrypt requires HTTP access for domain verification.

Redis shows “Disconnected” in WordPress admin

Verify Redis is running: systemctl status redis. Check the port and host settings in wp-config.php match the Redis configuration in aaPanel.


Conclusion

You now have a fully operational WordPress site running on a Hong Kong VPS with:

  • Nginx web server with correct WordPress rewrite rules
  • PHP 8.x for modern plugin and theme compatibility
  • MySQL 8.0 database
  • Redis object caching for fast repeated page loads
  • Free Let’s Encrypt SSL certificate with auto-renewal
  • CN2 GIA network routing for low-latency China access

This stack gives you production-ready WordPress performance at a fraction of the cost of managed WordPress hosting — with better China connectivity than any managed host running from US or European data centres.

Need a Hong Kong VPS to get started? Server.HK’s plans include KVM virtualisation, NVMe SSD storage, and CN2 GIA routing as standard — everything you need for this setup from the entry-level tier.


Frequently Asked Questions

Can I use Apache instead of Nginx with aaPanel on a Hong Kong VPS?

Yes, aaPanel supports Apache as an alternative to Nginx. However, Nginx is strongly recommended for WordPress on a VPS — it uses significantly less memory per connection and handles concurrent requests more efficiently, which is critical on smaller VPS instances with 1–2 GB RAM.

How much RAM does WordPress need on a Hong Kong VPS?

A minimal WordPress installation with Nginx and MySQL requires approximately 512 MB of RAM at idle. Under real traffic load with Redis and PHP-FPM workers active, 1 GB is the practical minimum and 2 GB is the comfortable baseline for a production site.

Is aaPanel free to use?

aaPanel offers a free open-source version with all core features needed for this tutorial. A paid Pro version adds additional monitoring and deployment features, but is not required for standard WordPress hosting.

How do I update WordPress core and plugins on a VPS?

WordPress updates work identically to shared hosting — use the Updates section in your WordPress admin dashboard. Ensure your file permissions are set correctly (Step 7) so WordPress can write update files without FTP credentials.

Can I host multiple WordPress sites on one Hong Kong VPS?

Yes. aaPanel supports multiple websites on a single VPS — each with its own Nginx virtual host, database, and SSL certificate. The practical limit depends on your VPS RAM and traffic volume, but 3–5 low-traffic WordPress sites comfortably fit on a 2 GB RAM VPS.

Tags: aaPanelHong Kong VPSNginx WordPressSSL certificateVPS tutorialWordPress VPS setup

Leave a Reply

You must be logged in to post a comment.

Recent Posts

  • How to Set Up a WordPress Site on a Hong Kong VPS with aaPanel (Step-by-Step 2026)
  • How to Choose the Right Hong Kong VPS Plan: A Buyer’s Guide for 2026
  • CN2 GIA vs BGP vs CN2 GT: What’s the Real Difference for China Connectivity?
  • Top 5 Use Cases for a Hong Kong Dedicated Server in 2026
  • Hong Kong VPS vs Japan VPS: Head-to-Head for Asia-Pacific Deployments in 2026

Recent Comments

No comments to show.

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot