How to Keep Your Bot Online 24/7
Auto-restart on crash, auto-start on reboot, the only two settings you need.
Introduction
Your bot will crash sometimes. APIs time out, dependencies hiccup, Discord goes weird. The goal isn't "never crash", it's "auto-recover instantly."
Enable Auto-Restart on Crash
- 1Open the panel β your bot β Startup β Crash Detection
- 2Toggle Auto-Restart on Crash ON
- 3Set Max restarts per hour to 10
- 4Click Save
The panel now restarts your bot within 5 seconds of any non-zero exit.
Enable Auto-Start on Panel Reboot
- 1Open Settings β Startup
- 2Toggle Start with Panel ON
- 3Save
This makes sure your bot comes back after maintenance windows.
Handle Errors in Your Code
- Wrap your main event handler in try/catch
- Listen for
unhandledRejectionand log it before exiting - Use exit code 1 for fatal errors, 0 for clean shutdown
- Print structured logs, they're easier to grep
Monitor Your Bot
- The panel's Uptime widget shows current run length and total uptime
- The Console logs the last 1000 lines, older logs go to
/logs - Use UptimeRobot to ping a health endpoint and alert you on outage
Warning: A bot stuck in a fast crash loop will burn your max-restarts cap. If it's restarting every 2 seconds, fix the crash before re-enabling auto-restart.
Need More Help?
Bot keeps crashing in mystery ways? Open a ticket, we'll review the logs with you.
Was this helpful?
Your feedback helps us write better guides.
Related Articles
More from Bot Hosting.
How to Upload and Run Your Discord Bot
From local code to a live bot on Endercloud in five minutes.
How to Set Environment Variables for Your Bot
Keep tokens, API keys, and secrets out of your code with env vars.
How to Use Python for Your Discord Bot on Endercloud
Set up a discord.py bot from scratch, the right Python version, the right libs.
Still need help?
Our team is on Discord around the clock. Real humans, real answers.