Web dashboard for your Discord bot
Your bot comes with a website: a dashboard, a ticket panel, a stats page? Kravn puts it online in HTTPS at its own address, https://xxxxxxxx.bots.kravn.org. It's free, the certificate is automatic, and there's no port to open: you turn on one setting.
Turn it on in 3 steps
- In your code, make your web app listen on host
0.0.0.0and on the port given in thePORTvariable (examples below). - In the panel, open your server, Startup tab, and set Web dashboard to
on. - Press Restart. The console shows your address:
Web dashboard: https://xxxxxxxx.bots.kravn.org. The first time, allow up to 2 minutes for the HTTPS certificate.
The xxxxxxxx part is your server ID: the 8 characters in the panel address of your server.
Code examples
Node.js (Express)
app.listen(process.env.PORT || 3000, '0.0.0.0');
Python (Flask)
app.run(host="0.0.0.0", port=int(os.environ.get("PORT", 5000)))
Python (aiohttp, next to discord.py)
site = web.TCPSite(runner, "0.0.0.0", int(os.environ["PORT"]))
Your .env already sets PORT? It is kept, but it must be the port of your server (shown in the console and in the Network tab), or visitors get the "offline" page.
Login with Discord (OAuth2)
If your dashboard uses "Login with Discord", add the new address in the Developer Portal, OAuth2, Redirects, for example https://xxxxxxxx.bots.kravn.org/callback, and use the same address in your code. Addresses like http://node.kravn.org:30087 don't work: bot ports are never reachable from the Internet.
Rules and limits
- Allowed: the website or dashboard of your Discord bot. Not allowed: proxy, VPN, tunnel, file hosting, phishing or anything illegal. Such a dashboard is cut off, and the bot can be suspended.
- Your dashboard runs inside your bot: it shares its RAM, and its traffic counts in the 10 GB per day limit of the bot.
- Uploads up to 10 MB per request, and a per-visitor rate limit. WebSockets (socket.io) work.
- Bot stopped or app not ready: visitors see a Kravn "offline" page.
- Cookies set by your dashboard stay on your own address.
- To turn it off, set Web dashboard back to
off: the address goes offline within a minute.
Going further
- Deploy a Discord bot from GitHub
- Ready-made Discord bots
- A question? Come to our Discord.