Your App Hosting server has an IP address and an allocated port, both shown in the panel. A web app must listen on exactly that port and on all interfaces (0.0.0.0), or it cannot be reached from outside.
-
Listen on the allocated port
Pterodactyl puts the port in the
SERVER_PORTenvironment variable. Use it in your code:index.js const express = require('express'); const app = express(); app.get('/', (req, res) => res.send('Hello from RHQ!')); const port = process.env.SERVER_PORT || 3000; app.listen(port, '0.0.0.0', () => console.log(`Running on port ${port}`));Add
"express": "^4.21.0"todependenciesinpackage.json.main.py import os from flask import Flask app = Flask(__name__) @app.get("/") def home(): return "Hello from RHQ!" app.run(host="0.0.0.0", port=int(os.environ.get("SERVER_PORT", 8000)))Add
flasktorequirements.txt. -
Start and test
Click Start, then open
http://SERVER_IP:PORTin your browser, with the values from the panel. -
Add your domain
In Cloudflare, under DNS → Records, add:
Type Name Content Proxy A appSERVER_IPDNS only (grey cloud) Your app is now at
http://app.yourdomain.com:PORT.
Why the orange cloud does not work here
The Cloudflare proxy accepts only certain ports: 80, 8080, 8880, 2052, 2082, 2086, 2095 for HTTP and 443, 2053, 2083, 2087, 2096, 8443 for HTTPS. If your allocated port is not one of them, keep the record on DNS only.