Setting Up CyberPanel on a VPS with a Custom Domain and Reverse Proxy

In this guide, we’ll walk through setting up CyberPanel on a VPS, securing it with a custom domain, and configuring a reverse proxy so the panel is accessible without specifying a port number.
We’ll cover everything from installation to DNS setup to vHost editing.

Example details used in this guide
IP Address: 123.45.67.89
Domain: example.com
Subdomain for panel: panel.example.com
Email: admin@example.com

Installing CyberPanel on the VPS

First, connect to your VPS over SSH:

ssh root@123.45.67.89

Update your server packages:

apt update && apt upgrade -y

Run the CyberPanel installation script:

sh <(curl -s https://cyberpanel.net/install.sh)

During installation:

  • Choose 1 for “Install CyberPanel with OpenLiteSpeed”
  • Install Full Service (includes DNS, Email, and FTP)
  • Use MariaDB for the database
  • Set an admin password (you’ll use this to log in later)
  • Enable PowerDNS, Postfix, Pure-FTPd
  • Restart the server when the installation is complete

After installation, CyberPanel is available at:

https://123.45.67.89:8090


One you set manually during the install prompts (if you chose “S” for “Set” when asked about the admin password), or

Randomly generated and displayed in the server console at the end of the installation.

It usually appears in the install summary like:

CyberPanel Successfully Installed
Current Disk usage : 3/40GB (10%)
Current RAM usage  : 512/2000MB (25%)
Installation time  : 10 minutes
Congratulations! CyberPanel is successfully installed.  

Your login credentials:
Username: admin
Password: Ab12Cd34Ef56
WebAdmin: https://123.45.67.89:8090

Creating a Website in CyberPanel

Log into CyberPanel:

https://123.45.67.89:8090

(Default user: admin)

Navigate to:

WebsitesCreate Website

Fill in the details:

  • Domain Name: panel.example.com
  • Owner: admin
  • Email: admin@example.com
  • PHP Version: 8.1 (or latest stable)
  • SSL: Checked ✅

Click Create Website.

Creating the DNS Record

Go to your DNS provider (e.g., GoDaddy, Cloudflare, Namecheap) and create an A Record for your subdomain.

Example:

TypeNameValueTTL
Apanel123.45.67.89300

This points panel.example.com to your VPS.

Add the reverse proxy from the CyberPanel UI (no SSH)

Path in CyberPanel:
Websites → List Websites → Manage (on panel.example.com) → vHost Conf

  1. Log in to CyberPanel.
  2. Go to Websites → List Websites.
  3. Click Manage for your site (e.g., panel.example.com).
  4. Click vHost Conf (scroll down).
  5. In the editor, append the following blocks at the end (keep the existing content intact):
# ---- External app to reach CyberPanel (HTTPS on 8090) ----
extprocessor cyberpanel_8090 {
  type                    proxy
  address                 https://127.0.0.1:8090
  maxConns                100
  initTimeout             60
  retryTimeout            0
  pcKeepAliveTimeout      60
  persistConn             1
  respBuffer              0
  # Optional: if your OLS build enforces cert check to upstream, you can disable it:
  # sslProxyCertVerify     0
}

# ---- Proxy everything to CyberPanel, preserve host, fix redirects, mark as HTTPS ----
context / {
  type                    proxy
  handler                 cyberpanel_8090
  addDefaultCharset       off
  allowBrowse             1
  keepHostHdr             1
  rewriteLocation         1

  rewrite  { enable 0 }
  extOverride             0

  reqHeaders  {
    add   X-Forwarded-Proto   https
    add   X-Forwarded-Port    443
    add   X-Forwarded-For     %u
    add   X-Real-IP           %u
    add   X-Forwarded-Host    $VH_NAME
    add   X-Forwarded-Ssl     on
    add   Front-End-Https     on
  }
}

(without :8090).

Click Save (or Save & Rebuild if available).

Restart OpenLiteSpeed: Server Status → LiteSpeed Status → Restart, or run:

systemctl restart lsws

Tip: Once it works, block the raw panel port:

  • If using UFW:
ufw delete allow 8090 || true
ufw allow 80
ufw allow 443
ufw limit 22
ufw enable

Access the Panel Without the Port

Now, you can log in to CyberPanel securely via:

https://panel.example.com

No more :8090 required 🎉

Summary

We’ve:

  1. Installed CyberPanel with OpenLiteSpeed
  2. Created a new website for the panel’s subdomain
  3. Added a DNS record pointing to the VPS
  4. Configured OpenLiteSpeed as a reverse proxy via vHost editing
  5. Locked down the server for better security

This setup keeps CyberPanel accessible at a clean, secure URL while hiding the backend port from the public.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top