NewCode CLOUD — 20% off your first month on all cloud VPSClaim

Hong Kong VPS Beginner’s Guide: Everything You Need to Start (2026)

· 7 min read

If you have never managed a server before, a Hong Kong VPS might seem intimidating. But the learning curve is shorter than most expect — and the fundamentals you learn apply to every Linux server you will ever manage. This guide takes you from provisioning your first VPS to running a secure website, step by step, assuming no prior Linux server experience.


What Is a VPS and Why Hong Kong?

A Virtual Private Server (VPS) is a dedicated slice of a physical server — you get guaranteed CPU, RAM, and NVMe storage that no other customer shares, accessible via the internet 24/7. Unlike shared hosting (where one server hosts hundreds of sites and they compete for resources), a VPS gives you root access — complete control over the operating system, software, and configuration.

Hong Kong VPS with CN2 GIA routing sits at the optimal network junction for Asia-Pacific: sub-50ms to mainland China (where shared hosting in the US delivers 300ms+), sub-25ms to Taiwan, sub-60ms to Japan and Korea — all without requiring a Chinese ICP hosting licence.


Step 1: Choosing Your Plan

For beginners, start conservatively — you can always upgrade:

  • 1–2 GB RAM: a personal blog, portfolio, or small WordPress site. One website with moderate traffic.
  • 4 GB RAM: small business website, WooCommerce store, or a simple SaaS application. Includes room for Redis caching and MySQL.
  • 8 GB RAM: high-traffic sites, multiple websites, or an application with significant database requirements.

Select Ubuntu 22.04 LTS as your operating system — it is the most widely documented Linux distribution, easiest for beginners, and fully supported by all guides in this series.


Step 2: Connect to Your VPS via SSH

After provisioning, Server.HK provides your VPS IP address, initial root password, and SSH port. Connect using SSH — the secure shell protocol for remote server management.

macOS / Linux

<code"># Open Terminal and connect:
ssh root@YOUR_VPS_IP

# You will see:
# The authenticity of host '1.2.3.4' can't be established.
# Type 'yes' and press Enter to trust the server on first connection

# Enter the initial root password when prompted

Windows

Windows 10/11 includes SSH in PowerShell — use the same command above. Alternatively, download PuTTY (free) and enter your VPS IP and port in the connection settings.

Change Root Password Immediately

<code">passwd
# Enter new password twice
# Use a strong password: at least 16 characters, mixed case, numbers, symbols

Step 3: Essential Linux Commands for VPS Management

You do not need to memorise Linux — you need to recognise patterns. These 20 commands cover 90% of what you will do on a VPS:

<code"># NAVIGATION
pwd                    # Print current directory (where am I?)
ls -la                 # List files (including hidden ones)
cd /var/www            # Change directory
cd ~                   # Go to home directory
cd ..                  # Go up one directory

# FILES AND DIRECTORIES
mkdir -p /var/www/mysite      # Create directory (and parents)
cp file1.txt file2.txt        # Copy file
mv oldname.txt newname.txt    # Rename/move file
rm filename.txt               # Delete file (permanent — be careful)
rm -rf /directory/            # Delete directory recursively (dangerous!)

# VIEWING AND EDITING FILES
cat /etc/hostname              # Display file contents
nano /etc/nginx/nginx.conf     # Edit file (Ctrl+X to exit, Y to save)
less /var/log/nginx/error.log  # Scroll through long file (Q to quit)
tail -f /var/log/nginx/access.log  # Watch file updates in real-time

# SYSTEM STATUS
top                    # Process monitor (Q to quit)
free -h                # Memory usage
df -h                  # Disk usage
uname -a               # System information

# PACKAGE MANAGEMENT
apt update             # Refresh package list
apt upgrade -y         # Install available updates
apt install nginx -y   # Install a package
apt remove nginx       # Remove a package

# SERVICES
systemctl status nginx          # Check service status
systemctl start nginx           # Start a service
systemctl stop nginx            # Stop a service
systemctl restart nginx         # Restart a service
systemctl enable nginx          # Start automatically on boot

# PERMISSIONS
chown www-data:www-data /var/www/mysite    # Change file owner
chmod 755 /var/www/mysite                  # Change permissions

Step 4: First-Time Server Setup

<code"># Update all packages (always do this first on a new VPS)
apt update && apt upgrade -y

# Install essential tools
apt install -y curl wget git unzip vim ufw fail2ban

# Configure firewall — allow only what you need
ufw allow 22/tcp     # SSH (keep this open!)
ufw allow 80/tcp     # HTTP
ufw allow 443/tcp    # HTTPS
ufw enable
# Confirm: "Command may disrupt existing ssh connections. Proceed with operation (y|n)?" → y

ufw status           # Verify firewall is active

Step 5: Set Up SSH Key Authentication (Important Security Step)

Password authentication for SSH is vulnerable to brute-force attacks. SSH keys are far more secure — and more convenient once set up.

Generate SSH Key (On Your Local Machine)

<code"># In Terminal on your computer (not the VPS):
ssh-keygen -t ed25519 -C "my-hk-vps-key"
# Press Enter for default location (~/.ssh/id_ed25519)
# Optionally set a passphrase for extra security

# View your PUBLIC key (this is what you add to the server):
cat ~/.ssh/id_ed25519.pub
# Looks like: ssh-ed25519 AAAA... your@computer

Add Key to Your VPS

<code"># On the VPS:
mkdir -p ~/.ssh
chmod 700 ~/.ssh
nano ~/.ssh/authorized_keys
# Paste your PUBLIC key (the ssh-ed25519 AAAA... line) and save

chmod 600 ~/.ssh/authorized_keys

Test Key Login

<code"># In a NEW terminal (don't close your current connection yet):
ssh -i ~/.ssh/id_ed25519 root@YOUR_VPS_IP
# Should connect without asking for a password

Disable Password Authentication

<code"># Only after confirming key login works:
nano /etc/ssh/sshd_config
# Find and change:
PasswordAuthentication yes
# To:
PasswordAuthentication no

systemctl reload sshd

Step 6: Install a Web Server (Nginx)

<code">apt install -y nginx

# Start Nginx and enable on boot
systemctl enable --now nginx

# Test: open http://YOUR_VPS_IP in your browser
# You should see the "Welcome to nginx!" page

Create Your First Website

<code"># Create a directory for your website
mkdir -p /var/www/mysite
chown -R www-data:www-data /var/www/mysite

# Create a simple HTML page
cat > /var/www/mysite/index.html << 'EOF'

Hello from Hong Kong VPS!

CN2 GIA routing active — fast for Asia users.


EOF

# Create Nginx configuration for your site
cat > /etc/nginx/sites-available/mysite << 'EOF'
server {
    listen 80;
    server_name YOUR_DOMAIN.com;    # Or your VPS IP for testing

    root /var/www/mysite;
    index index.html;

    location / {
        try_files $uri $uri/ =404;
    }
}
EOF

# Enable the site
ln -s /etc/nginx/sites-available/mysite /etc/nginx/sites-enabled/
nginx -t             # Check configuration for errors
systemctl reload nginx

# Visit http://YOUR_VPS_IP — you should see your page

Step 7: Add SSL with Let’s Encrypt

Before this step, your domain’s DNS A record must point to your VPS IP (set in your domain registrar’s DNS panel).

<code">apt install -y certbot python3-certbot-nginx

# Issue free SSL certificate
certbot --nginx -d yourdomain.com

# Certbot automatically:
# - Verifies you control the domain
# - Issues the certificate
# - Updates your Nginx configuration for HTTPS
# - Sets up automatic renewal

# Test renewal
certbot renew --dry-run

# Your site is now at https://yourdomain.com

Step 8: WordPress Installation (Optional)

<code"># Install PHP and MySQL
apt install -y php8.3-fpm php8.3-mysql php8.3-xml php8.3-mbstring \
  php8.3-curl php8.3-zip php8.3-gd mysql-server

# Create WordPress database
mysql -u root -p << 'SQL' CREATE DATABASE wordpress; CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'StrongPassword!'; GRANT ALL ON wordpress.* TO 'wpuser'@'localhost'; FLUSH PRIVILEGES; SQL # Download WordPress cd /var/www/mysite wget https://wordpress.org/latest.tar.gz tar xzf latest.tar.gz --strip-components=1 rm latest.tar.gz chown -R www-data:www-data /var/www/mysite # Update Nginx config for PHP and WordPress cat > /etc/nginx/sites-available/mysite << 'EOF'
server {
    listen 443 ssl;
    server_name yourdomain.com;
    root /var/www/mysite;
    index index.php;

    ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;

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

    location ~ \.php$ {
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }
}
EOF

nginx -t && systemctl reload nginx

# Visit https://yourdomain.com to complete the WordPress installer

Step 9: Basic Monitoring

<code"># Real-time resource monitor (press Q to quit)
htop

# Check Nginx access logs (real-time)
tail -f /var/log/nginx/access.log

# Check Nginx error logs
tail -f /var/log/nginx/error.log

# Check system resources
free -h     # Memory
df -h       # Disk usage
uptime      # CPU load

Beginner Mistakes to Avoid

  • Never run applications as root — use dedicated system users (www-data for web, postgres for database)
  • Always test Nginx config before reloading — run nginx -t first; a syntax error in production config takes down your site
  • Don’t close your current SSH session when testing new SSH config — always open a second terminal to test changes work before closing the first
  • Set up backups from day one — see our backup strategy guide; losing data because you had no backup is a preventable disaster
  • Keep the system updated — apt update && apt upgrade weekly; unpatched vulnerabilities are the leading cause of VPS compromises
  • Don’t disable the firewall — even temporarily. If you need to troubleshoot, add a specific rule rather than disabling UFW

Where to Go Next

Once your first website is running, explore the rest of the server.hk/blog guides:

  • WordPress Speed Optimization — add Redis caching and FastCGI cache for sub-100ms China load times
  • VPS Security Hardening — SSH hardening, Fail2Ban, sysctl parameters
  • Automated Backups — protect your data with off-site backup to Cloudflare R2
  • CI/CD with GitHub Actions — automate deployments so you never SSH in for routine updates

Conclusion

A Hong Kong VPS managed from the command line gives you capabilities that shared hosting never can: custom software, persistent processes, full database control, and the CN2 GIA routing that makes your site genuinely fast for mainland Chinese visitors. The learning curve from this beginner guide to a fully configured production server is measured in hours, not weeks — and every skill you build transfers to every Linux server you will ever manage.

Start your VPS journey: Browse Server.HK Hong Kong VPS plans — choose Ubuntu 22.04, provision in minutes, and follow this guide to have your first website live within an hour.

Related articles

More in VPS & ServersServer setup guides