How to keep a Discord bot online
A Discord bot is online only while its process is running and its gateway connection is alive. Keeping it online means solving four separate problems: a machine that stays on, a supervisor that restarts crashes, a library that reconnects, and a plan that has not lapsed.
1. A machine that stays on
Your laptop is not one. It sleeps, it reboots, and its home connection changes address. Run the process on a machine that stays on. HostDC's free plan does that, with a 256 MB RAM pool, 0.5 CPU and 512 MB storage.
2. A supervisor for crashes
Every bot crashes eventually: an unhandled rejection, an out-of-memory kill, a bad deploy. HostDC restarts your bot automatically with backoff and gives up after 5 crashes in 10 minutes, so a broken bot does not restart forever. The last exit reason is on the bot's health card.
3. A library that reconnects
Gateway disconnects are normal. Both discord.js and discord.py reconnect on their own if you let them. Do not swallow the error and call process.exit, and do not catch SIGTERM without shutting down cleanly.
If your bot logs in and quietly stops responding hours later, look for heartbeat warnings in the console before blaming the host.
4. A plan that has not lapsed
On Free accounts you reactivate your bots weekly to keep them running. You get one hour of grace after the timer ends before bots pause. Paid plans (Mini, Lite, Pro and Max) never need reactivation. Reminders arrive by email, or as a Discord DM once you link your account, and the link in them opens the reactivation page without signing in. There you solve a quick captcha or watch a 5-second ad.
Related
Last updated 2026-09-06