• 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

Zero Trust Access for Hong Kong VPS: Secure Remote Team Access (2026)

September 15, 2026

Zero trust security means “never trust, always verify” — no VPN required, no open SSH ports on the public internet, every access request authenticated regardless of network. Implementing zero trust on your Hong Kong VPS combines Cloudflare Tunnel (no open inbound ports) with Authelia (SSO with MFA) to give your team secure access to internal tools — Gitea, Grafana, Portainer, n8n, Jupyter — without exposing any port to the public internet.


Architecture

<code">
Team Member Browser
        │
        ▼
Cloudflare (auth check) ──── Authelia (MFA verification) ────┐
        │                                                     │
        │ Authenticated                                       │
        ▼                                                     │
Cloudflare Tunnel ◄──── HK VPS (no public inbound ports) ───┘
        │
        ▼
Internal Services (Gitea, Grafana, Portainer, n8n...)

No inbound ports (not even 443) need to be open on your VPS — Cloudflare Tunnel makes outbound connections to Cloudflare’s network, and Cloudflare routes authenticated traffic through those tunnels to your services.


Step 1: Cloudflare Tunnel Setup

<code"># Install cloudflared
curl -L --output cloudflared.deb \
  https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
dpkg -i cloudflared.deb

# Authenticate with Cloudflare (opens browser)
cloudflared tunnel login

# Create a tunnel
cloudflared tunnel create hk-vps-tunnel

# Note the tunnel ID — you'll need it in config
cloudflared tunnel list

Tunnel Configuration

<code">mkdir -p /etc/cloudflared/

cat > /etc/cloudflared/config.yml << 'EOF'
tunnel: YOUR_TUNNEL_ID
credentials-file: /root/.cloudflared/YOUR_TUNNEL_ID.json

ingress:
  # Gitea — internal Git server
  - hostname: git.yourdomain.com
    service: http://localhost:3000

  # Grafana — monitoring dashboards
  - hostname: metrics.yourdomain.com
    service: http://localhost:3000    # Grafana port

  # Portainer — Docker management
  - hostname: docker.yourdomain.com
    service: http://localhost:9443
    originRequest:
      noTLSVerify: true

  # n8n — workflow automation
  - hostname: automation.yourdomain.com
    service: http://localhost:5678

  # Authelia — authentication portal (must be first to match)
  - hostname: auth.yourdomain.com
    service: http://localhost:9091

  # Catch-all (required)
  - service: http_status:404
EOF

# Create DNS records pointing to the tunnel
cloudflared tunnel route dns hk-vps-tunnel git.yourdomain.com
cloudflared tunnel route dns hk-vps-tunnel metrics.yourdomain.com
cloudflared tunnel route dns hk-vps-tunnel docker.yourdomain.com
cloudflared tunnel route dns hk-vps-tunnel auth.yourdomain.com

# Systemd service
cloudflared service install
systemctl enable --now cloudflared

Step 2: Authelia — Self-Hosted SSO with MFA

<code">mkdir -p /opt/authelia/{config,data}

cat > /opt/authelia/config/configuration.yml << 'EOF' server: host: 0.0.0.0 port: 9091 log: level: info jwt_secret: GENERATE_RANDOM_64_CHAR_STRING default_redirection_url: https://git.yourdomain.com authentication_backend: file: path: /config/users_database.yml password: algorithm: argon2id access_control: default_policy: deny rules: # Allow all authenticated team members to Gitea - domain: git.yourdomain.com policy: one_factor # Require 2FA for admin tools - domain: docker.yourdomain.com policy: two_factor - domain: metrics.yourdomain.com policy: two_factor - domain: automation.yourdomain.com policy: two_factor session: name: authelia_session secret: ANOTHER_RANDOM_64_CHAR_STRING expiration: 8h inactivity: 30m domain: yourdomain.com # Shared session across all subdomains regulation: max_retries: 3 find_time: 2m ban_time: 5m storage: local: path: /data/db.sqlite3 notifier: smtp: host: localhost port: 25 sender: authelia@yourdomain.com EOF # Create users database cat > /opt/authelia/config/users_database.yml << 'EOF'
users:
  alice:
    displayname: "Alice Chen"
    password: "$argon2id$v=19$..."    # Generate with: authelia crypto hash generate argon2
    email: alice@yourcompany.com
    groups:
      - admins
      - developers

  bob:
    displayname: "Bob Liu"
    password: "$argon2id$v=19$..."
    email: bob@yourcompany.com
    groups:
      - developers
EOF

docker run -d \
  --name authelia \
  --restart unless-stopped \
  -p 127.0.0.1:9091:9091 \
  -v /opt/authelia/config:/config \
  -v /opt/authelia/data:/data \
  authelia/authelia:latest

Step 3: Cloudflare Access Rules

In Cloudflare Zero Trust → Access → Applications → Add Application:

  1. Select: Self-hosted
  2. Application domain: git.yourdomain.com
  3. Session duration: 8 hours
  4. Identity providers: Google Workspace (or any OAuth provider)

Create a Policy:

  • Action: Allow
  • Include: Emails ending in @yourcompany.com (or specific email list)

Repeat for each internal service. Now when a team member visits https://git.yourdomain.com:

  1. Cloudflare checks if they have a valid Access session
  2. If not, redirect to your identity provider (Google/GitHub OAuth)
  3. After OAuth authentication, check the email domain policy
  4. If authorised, route to Authelia for optional MFA
  5. Final Authelia session grants access to the internal service

Step 4: TOTP Setup for Team Members

<code"># Generate TOTP secret for a user via Authelia CLI
docker exec authelia authelia storage totp generate \
  --config /config/configuration.yml alice

# Output: TOTP URL and QR code
# Team member scans with Google Authenticator or Authy

# Or users self-enroll at:
# https://auth.yourdomain.com/settings/two-factor

Step 5: Close All Public Firewall Ports (Except SSH)

<code"># With Cloudflare Tunnel handling all web traffic, close everything
ufw default deny incoming
ufw default allow outgoing

# Keep SSH on your custom port for emergency server access
ufw allow 22222/tcp comment 'Emergency SSH access'

# REMOVE web ports — Cloudflare Tunnel handles these
ufw delete allow 80/tcp
ufw delete allow 443/tcp

ufw enable
ufw status

# Verify tunnel is still working:
curl https://git.yourdomain.com   # Should reach Gitea via Cloudflare Tunnel

With no public ports 80 or 443 open, your VPS IP cannot be targeted by direct-IP attacks, port scanners, or brute-force attempts on your web services — only SSH remains accessible from the public internet.


Benefits Summary

CapabilityBefore (open ports)After (zero trust)
Web service ports exposed80, 443 publicNone (tunnel only)
AuthenticationService-specific passwordsSSO + MFA for all services
Access loggingPer-service logsCentralised Cloudflare Access logs
Brute force protectionFail2Ban per serviceCloudflare’s global network blocks attackers
New team member accessCreate credentials in each serviceAdd email to Cloudflare Access policy
Offboard team memberRemove from each serviceRemove from Cloudflare Access policy

Conclusion

Zero trust access with Cloudflare Tunnel and Authelia eliminates the attack surface on your Hong Kong VPS — no public web ports, all team access authenticated via SSO with MFA, every access attempt logged centrally. The combination of Cloudflare’s global DDoS protection and Authelia’s local authentication gives teams secure access to internal tools from anywhere in Asia-Pacific without a traditional VPN, while keeping the VPS hardened against direct attacks.

Secure your team access: Browse Server.HK Hong Kong VPS plans — Cloudflare Tunnel and Authelia run on any VPS plan with minimal resource overhead alongside your application services.

Recent Posts

  • Monorepo Deployment on Hong Kong VPS: Turborepo and pnpm (2026)
  • GitLab Runner on Hong Kong VPS: Self-Hosted CI/CD Pipeline (2026)
  • Deploy Spring Boot on Hong Kong VPS: Java Microservices for Asia (2026)
  • TimescaleDB on Hong Kong VPS: Time-Series Data for Asia-Pacific (2026)
  • Hong Kong VPS China Accessibility Checklist: Make Your Site Work (2026)

Recent Comments

  1. Hong Kong VPS Uptime and SLA: What 99.9% Uptime Really Means for Your Business (2026) - Server.HK on How to Monitor Your Hong Kong VPS: Uptime, Performance, and Alert Setup Guide (2026)
  2. Best Hong Kong VPS Providers in 2026: Compared by Speed, Routing, and Value - Server.HK on How to Migrate Your Website to a Hong Kong VPS: Zero-Downtime Transfer Guide (2026)
  3. vibramycin injection on How to Choose the Right Hong Kong VPS Plan: A Buyer’s Guide for 2026
  4. allopurinol for gout on CN2 GIA vs BGP vs CN2 GT: What’s the Real Difference for China Connectivity?
  5. antibiotics online purchase on How to Set Up a WordPress Site on a Hong Kong VPS with aaPanel (Step-by-Step 2026)

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