Cloudflare Tunnel Step By Step
This guide gives your Drako Bot v2 dashboard a website address such as https://dashboard.example.com.
Follow the steps in order. Check the result at the end of each step before moving on.
Before you start
You need:
Drako Bot v2 running, with the dashboard addon installed and its license and Discord application credentials configured.
A domain you own, already added to Cloudflare and showing as Active.
Access to the computer or server that runs the bot.
Access to the bot's application in the Discord Developer Portal.
If the dashboard addon is not configured yet, complete Dashboard Setup first. You will update its website address and Discord return address below.
If your bot runs on a rented Windows server, that Windows server is the bot computer. Your home computer is not the bot computer, even when you use it to connect to the server.
If the bot or tunnel runs inside Docker, Pelican, Pterodactyl, or another hosting container, start with the Pelican and Docker guide. In those setups, 127.0.0.1 may point to the wrong place.
You do not need to install Nginx or Certbot for the setup on this page. Cloudflare Tunnel makes an outbound connection, so this setup does not require opening the dashboard port to the Internet. About Cloudflare Tunnel.
Write down your website address and port
Choose the address people will type into their browser. This guide uses dashboard.example.com.
Replace example.com with your own domain everywhere it appears below. You can also replace dashboard with another name, such as panel.
Next, find Port inside the existing Dashboard section of config/core.yml. If you use a .env file, find DASHBOARD_PORT there instead. For a new setup, the usual port is 3000.
Keep these details beside you:
Your dashboard name
dashboard.example.com
Cloudflare's public hostname
Your public website address
https://dashboard.example.com
Drako's URL setting and your browser
Your dashboard port
3000
Drako, the local test, and the tunnel route
Your local dashboard address
http://127.0.0.1:3000
The local test and Cloudflare's service address
The two addresses intentionally start differently:
Public address:
https://— visitors connect securely to Cloudflare.Local address:
http://— the tunnel connects to Drako on the bot computer.
127.0.0.1 means “this computer.” Keep those numbers exactly as shown for this guide. Cloudflare supports forwarding a public HTTPS website to a local HTTP service. Cloudflare routing documentation.
If your port is 3014, your local address becomes http://127.0.0.1:3014. Replace 3000 with 3014 in every later example. Your public address still has no port number.
Ready to continue: you know your dashboard name and its port.
Update the bot's dashboard settings
Do this on the bot computer. Open the folder containing the bot's package.json and config folder.
Make a backup copy of the settings file before editing it. Use one of the following sections, depending on how your bot loads its settings.
Open the
configfolder.Open
core.ymlin a text editor.Find the existing line
Dashboard:.Update the following fields beneath it. Use
Hosting: "direct"because this guide runs the bot and connector directly on the same computer.
Dashboard:
Enabled: true
URL: "https://dashboard.example.com"
Port: 3000
Hosting: "direct"
# Keep your existing license and Discord credentials.Replace the example website name and port with the details from Step 1.
Keep your existing credentials in that section; the example shows only the fields you need to change. Save the file with Ctrl + S.
The bot can load .env from its main folder or its config folder. A custom startup setting can also select a different file. When a .env file is loaded, edit that file for these settings.
Update or add these lines, keeping your existing credentials:
DASHBOARD_ENABLED=true
DASHBOARD_URL=https://dashboard.example.com
DASHBOARD_PORT=3000
DASHBOARD_HOSTING=directReplace the example website name and port. Keep one copy of each setting, then save the file. Do not create a new .env file just for this guide if your bot currently uses core.yml.
If a hosting panel sets dashboard environment variables, update the matching values there too. Those values can override the file you edited.
Drako handles the listening defaults and saves its session secret automatically. You do not need to generate a secret or add proxy settings for this setup. Keep any secret already saved by the bot.
If you previously added advanced listening or proxy settings, they still override the hosting defaults. See Existing advanced settings below if you are changing how the bot is hosted.
Check before continuing:
URLstarts withhttps://and contains only your public website address.URLdoes not contain127.0.0.1, your server's IP, a dashboard port, or/api/auth/callback.Portmatches the number from Step 1.Hostingisdirect.
Tell Discord where to return after sign-in
Do this in a web browser. Discord needs a return address so it can send you back to the dashboard after you sign in.
Open the Discord Developer Portal.
Select the application belonging to this bot.
Open OAuth2 and find Redirects.
Add this address, replacing the example domain:
https://dashboard.example.com/api/auth/callbackSave your changes.
The first part must match the public address from Step 1. The ending must be exactly /api/auth/callback.
If your bot settings already contain RedirectURI or DASHBOARD_REDIRECTURI, change that setting to this same full return address. Otherwise, Drako uses this address automatically.
Ready to continue: Discord has the full HTTPS return address saved. Discord's redirect URL documentation.
Restart the bot and check it locally
Do this on the bot computer. Restart the bot using the method you normally use. Wait for it to finish starting, and check its console for dashboard errors.
Open a second terminal for the following test. Leave the bot running.
Open the Start menu, search for PowerShell, and open it. If the bot runs on a remote Windows server, open PowerShell inside that server's desktop.
Paste this command and press Enter:
curl.exe -I http://127.0.0.1:3000/Open a terminal or SSH session on the bot computer and run:
curl -I http://127.0.0.1:3000/Remember to replace 3000 if you use another dashboard port. Copy only the command; do not add a PS C:\...> or $ prompt in front of it.
What you should see
The response should include:
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8Other header lines are normal.
200 OK and an HTML content type
Continue to Step 5.
Cannot connect, connection refused, or timed out
Check that the bot started successfully and that your test uses its dashboard port.
426 Upgrade Required
The service on this port did not return the expected dashboard page. Check the port and which application owns it. Use the troubleshooting section below.
Another error or a different application's page
Resolve that local response before continuing.
Do not continue until this local check works. Adding a tunnel cannot repair a dashboard that is not responding correctly on the bot computer.
This test checks the local web page only. Complete Discord sign-in through the public HTTPS address in Step 8.
Create a tunnel and connect it to the bot computer
Use a browser for Cloudflare and the bot computer for installation.
Sign in to the Cloudflare dashboard.
Open Networking → Tunnels.
Select Create Tunnel. If asked for a connector type, choose cloudflared.
Name it something recognizable, such as
Drako Dashboard.Select the bot computer's operating system and architecture.
Follow Cloudflare's displayed Install and Run instructions on the bot computer.
Wait until the tunnel shows Healthy, then continue.
Cloudflare provides the installation commands for the selected system. Use those commands directly, in the order shown. Cloudflare's installation instructions.
For Windows, open PowerShell with Run as administrator before running the installation commands. Install the connector as a service using the command Cloudflare supplies, so it can keep running when you close the terminal. Windows service documentation.
The installation command contains a private tunnel token. Keep the complete command private; do not post it in support screenshots.
If you already have a healthy tunnel whose connector runs directly on the bot computer, use that tunnel and continue below. You do not need one tunnel for every website.
Ready to continue: the tunnel is Healthy, and the local check from Step 4 passes. Healthy confirms the connector is online; it does not confirm your dashboard works.
Add the dashboard website to the tunnel
Do this in Cloudflare. Open your tunnel, then select Routes → Add route → Published application. Some layouts label these as Published application routes or Public hostnames.
Enter your own dashboard details using this example:
Subdomain
dashboard
Domain
Choose your domain, such as example.com
Path
Leave empty
Service type
HTTP
Service address
127.0.0.1:3000
If Cloudflare shows one full Service URL field instead, enter:
http://127.0.0.1:3000Use the port that passed Step 4. Keep the local address exactly the same as the one you tested.
Leave additional settings at their defaults and select Add route or Save. Cloudflare normally creates the hostname's DNS record when you save a dashboard-managed route. Cloudflare route documentation.
If Cloudflare reports that a DNS record already exists, check whether that exact hostname is already used by another website or tunnel. A different unused name, such as bot-panel.example.com, avoids replacing an existing website. If you choose a new name, update Steps 1–3 to match and restart the bot.
Check the saved row: your dashboard hostname should point to http://127.0.0.1:3000, with your chosen port substituted. The address should match the successful local test.
Make visitors use HTTPS
Do this in Cloudflare's settings for your domain.
If all websites on that domain support HTTPS:
Open SSL/TLS → Edge Certificates.
Find Always Use HTTPS.
Turn it on.
If the switch is missing, check that the domain's SSL/TLS encryption mode is not Off.
This switch covers the domain's other hostnames too. If you have other websites that must remain HTTP-only, use a redirect rule limited to your dashboard hostname instead. Cloudflare HTTPS redirect instructions.
Keep the tunnel's local service address set to HTTP. This step changes the address visitors use; it does not change Drako's local listener.
Ready to continue: your public address uses HTTPS, and the tunnel's service address still uses HTTP.
Open the website and test sign-in, saving, and sign-out
Do this in a web browser. You can now use your own computer or phone.
Open your public address, such as
https://dashboard.example.com.Check that the Drako login page appears without a certificate warning.
Select Login and sign in with Discord.
Select a server you own or administer, or one where you have been granted dashboard access.
Make a small, reversible settings change you intend to test. Save it, reload the page, and confirm it persisted. Restore the original value if needed.
Select Sign out and confirm you return to the login page.
Sign in again to confirm the complete flow works.
Setup is complete when loading, sign-in, saving, and sign-out all work.
The bot and the tunnel service must both remain running for the dashboard to stay available.
If something goes wrong
What to send support
Send:
The step where you got stuck and the exact error message.
Your public dashboard address and dashboard port.
The values of
URL,Port, andHosting, or their.envequivalents.Whether the bot and connector run directly on the same computer.
A screenshot of the tunnel route showing its hostname and service address.
The output of the local test in Step 4 and any relevant bot startup error.
Crop screenshots to the relevant settings. Keep bot tokens, client secrets, session secrets, license keys, browser cookies, and tunnel installation tokens out of the support request.
Last updated