For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

This guide installs the tunnel directly on the same computer as the bot.

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.

1

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:

Detail
Example
Where you will use it

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.

2

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.

  1. Open the config folder.

  2. Open core.yml in a text editor.

  3. Find the existing line Dashboard:.

  4. 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=direct

Replace 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:

  • URL starts with https:// and contains only your public website address.

  • URL does not contain 127.0.0.1, your server's IP, a dashboard port, or /api/auth/callback.

  • Port matches the number from Step 1.

  • Hosting is direct.

3

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.

  1. Select the application belonging to this bot.

  2. Open OAuth2 and find Redirects.

  3. Add this address, replacing the example domain:

    https://dashboard.example.com/api/auth/callback
  4. Save 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.

4

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-8

Other header lines are normal.

Result
What to do next

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.

This test checks the local web page only. Complete Discord sign-in through the public HTTPS address in Step 8.

5

Create a tunnel and connect it to the bot computer

Use a browser for Cloudflare and the bot computer for installation.

  1. Sign in to the Cloudflare dashboard.

  2. Open Networking → Tunnels.

  3. Select Create Tunnel. If asked for a connector type, choose cloudflared.

  4. Name it something recognizable, such as Drako Dashboard.

  5. Select the bot computer's operating system and architecture.

  6. Follow Cloudflare's displayed Install and Run instructions on the bot computer.

  7. 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.

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.

6

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:

Field
Enter

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:3000

Use 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.

7

Make visitors use HTTPS

Do this in Cloudflare's settings for your domain.

If all websites on that domain support HTTPS:

  1. Open SSL/TLS → Edge Certificates.

  2. Find Always Use HTTPS.

  3. 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.

8

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.

  1. Open your public address, such as https://dashboard.example.com.

  2. Check that the Drako login page appears without a certificate warning.

  3. Select Login and sign in with Discord.

  4. Select a server you own or administer, or one where you have been granted dashboard access.

  5. 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.

  6. Select Sign out and confirm you return to the login page.

  7. Sign in again to confirm the complete flow works.

The bot and the tunnel service must both remain running for the dashboard to stay available.

If something goes wrong

Saving or sign-out says the session could not verify the request

Compare the address in your browser with Dashboard.URL or DASHBOARD_URL. They must use the same https:// address, including the same hostname.

For example, this combination is correct:

Browser:               https://dashboard.example.com
Dashboard URL setting: https://dashboard.example.com
Tunnel service:        http://127.0.0.1:3000

An HTTP-to-HTTPS redirect does not correct an HTTP URL saved in the bot configuration.

After correcting the setting, restart the bot and reload the dashboard. An older open tab can also hold an outdated session token. If a fresh login still fails, check the configuration and active settings source rather than repeatedly clearing cookies.

The local test says 426 Upgrade Required

The normal Drako dashboard page should return 200 OK for the test in Step 4. A 426 response can come from another service on the selected port, including a WebSocket listener; the message alone does not identify the application.

Check the dashboard port in the active settings file and look for startup errors such as EADDRINUSE, which means the requested address and port are already in use.

On Windows, this read-only command lists connections using port 3000:

Replace 3000 with your dashboard port. Send the output to support along with the local test result and the bot's startup error, if any. Avoid stopping an unfamiliar process just because it uses that port.

Cloudflare shows 502 Bad Gateway or cannot reach the website

Repeat Step 4 on the bot computer. If it succeeds, check that the saved tunnel route uses the exact same HTTP address and port, and that the connector is running directly on that computer.

If the connector runs in another computer or container, return to the setup requirements at the top of this page.

The tunnel is not Healthy

Return to the installation instructions in Step 5. Confirm the connector was installed on the bot computer and that its service is running. Copy the error message for support if it will not start.

Discord says the redirect is invalid

Compare the address saved in Discord with Step 3. Check https://, the hostname, and /api/auth/callback. Save changes in Discord and update any explicit RedirectURI in the bot settings.

Login returns to the login page

Check Hosting: "direct" and the tunnel's http://127.0.0.1:3000 destination. Confirm the connector runs directly on the bot computer, then restart the bot and retry through the public HTTPS website.

If the bot logs a warning about a secure session cookie or proxy trust, include that warning in your support request.

Editing the settings file makes no difference

Save the file and restart the bot. Check whether the bot loads a .env file or has environment variables supplied by a hosting panel or startup command. Make the changes in the settings source the bot actually uses.

Existing advanced settings

Older guides may have asked you to add Host, TrustLoopbackProxy, or TrustedProxies. Their .env equivalents are DASHBOARD_HOST, DASHBOARD_TRUSTLOOPBACKPROXY, and DASHBOARD_TRUSTEDPROXIES.

For the exact setup on this page, back up your configuration and remove those old overrides so Hosting: "direct" can choose the defaults. Keep custom settings if your host requires them; ask the host before changing a setup that differs from this guide.

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, and Hosting, or their .env equivalents.

  • 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.

Last updated