Choosing a Hong Kong VPS to build a website is the preferred option for many independent website owners, commercial projects, and technology enthusiasts. Compared to shared hosting, VPS offers advantages such as dedicated resources, a customizable environment, and the ability to install any software. WordPress, as the world's most popular open-source website building program, achieves extremely high scalability and performance when combined with a VPS. For beginners, setting up an accessible WordPress website is not as complicated as it seems. With just a VPS, a domain name, and basic Linux operation knowledge, deployment can be completed in a short time.
The setup process mainly consists of four stages: preparing the server environment, installing the runtime environment, deploying the WordPress program, binding the domain name, and configuring HTTPS. As long as the process is clear, the entire process can be completed within half an hour, and the subsequent maintenance costs are extremely low.
The first step is to choose a suitable Hong Kong VPS. Whether building a blog, a corporate website, or a small e-commerce site, 1 CPU core + 1GB RAM + 20GB SSD is generally sufficient. If the website uploads a large number of images or uses caching plugins, the disk capacity should be increased accordingly. The system recommends choosing Ubuntu 20.04 or 22.04, which has abundant community documentation, good compatibility, and can be seamlessly implemented with almost all tutorials. After purchasing the VPS, you can start configuring the environment by logging into the server via SSH.
The basic way to connect to a Hong Kong VPS is to execute SSH commands in your local terminal, for example:
ssh root@server IP
The first time you connect, you'll be prompted to trust the fingerprint; simply enter "yes". If your service provider doesn't enable root login by default, you'll need to log in with a regular account first, then switch to the root user.
The first thing to do during server initialization is to update the software repositories and install necessary components:
apt update && apt upgrade -y
Next, install Nginx, MySQL, and PHP, which form the foundation for running WordPress. You can choose an LNMP or LAMP environment, but the Nginx + PHP-FPM combination is recommended for better performance.
apt install nginx mysql-server php-fpm php-mysql php-xml php-curl php-zip php-mbstring php-gd -y
After installation, first check if Nginx is running:
systemctl status nginx
If "active" is displayed, the server has started successfully. You can directly access the server IP in your browser. The default Nginx page appearing indicates that the web service is functioning correctly.
Next, configure the database. Run the MySQL security script to set the root password and install the initial security policy:
mysql_secure_installation
Follow the prompts to set a password, disable remote root login, and delete the test database. Then log in to MySQL to create the WordPress database and user:
mysql -u root -p
CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8mb4;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'strong_password_here';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
This allocates a separate database to WordPress, preventing impact on internal system data.
The default PHP configuration is sufficient for WordPress operation, but parameters such as upload size and execution time limits need adjustment. Edit the PHP configuration:
nano /etc/php/*/fpm/php.ini
Modify the following configurations to values suitable for website building:
memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
Restart PHP after making changes:
systemctl restart php*-fpm
The server environment is now ready. The next step is to download and deploy WordPress. First, navigate to the website directory and obtain the latest official package:
cd /var/www/
wget https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
mv wordpress mysite
Then create a site configuration file for Nginx that points to the WordPress website directory:
nano /etc/nginx/sites-available/mysite.conf
Content example:
server {
listen 80;
server_name yourdomain.com;
root /var/www/mysite;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires max;
log_not_found off;
}
}
Enable the site and reload Nginx:
ln -s /etc/nginx/sites-available/mysite.conf /etc/nginx/sites-enabled/
nginx -t
systemctl reload nginx
Next, modify the WordPress file permissions to allow Nginx to write to plugins, caches, and media files correctly:
chown -R www-data:www-data /var/www/mysite
Now you can access the WordPress installation interface by visiting the IP address or domain name in your browser. Follow the prompts to enter the database name, username, and password to complete the initialization and access the backend.
To make the website accessible via the domain name, you need to add an A record in your domain's DNS control panel, pointing to the VPS's public IP address. Once it takes effect, the website will be accessible via the domain name. If you want your website to support HTTPS, you can use Certbot to automatically apply for a free SSL certificate:
apt install certbot python3-certbot-nginx -y
certbot --nginx
Follow the prompts to enter your email address, agree to the terms, and select a domain. The certificate will be automatically configured and a 90-day auto-renewal task will be enabled.
At this point, a complete, accessible WordPress website with HTTPS support and a fully functional operating environment has been set up. You can then log in to the backend to install themes and plugins, configure URL rewriting, add pages, and have complete control over your website content.
To ensure the stable operation of your Hong Kong VPS website, it is recommended to perform several basic optimizations. For example, enable WP Super Cache or LiteSpeed Cache to reduce PHP resource consumption, outsource image hosting to an image hosting service or CDN, limit backend XML-RPC requests to prevent brute-force attacks, and regularly upgrade your PHP and database versions.
For users unfamiliar with Linux, automated deployment tools such as Oneinstack, LNMP, and one-click WordPress scripts can be used. However, manual deployment allows for a better understanding of each step of the structure and is very helpful for later maintenance.