Discord bot goes offline when I close my PC
Why your Discord bot goes offline when your PC sleeps or you close the terminal, and how to keep it running 24/7 without your computer.
Your bot works perfectly, then goes offline the moment you close your laptop. That's normal: here's why, and the fix.
Why it happens #
A Discord bot is a program that keeps a live connection open to Discord. That connection only exists while the program runs. When your PC sleeps, shuts down, restarts for updates or loses Wi-Fi, the program stops, so Discord shows the bot as offline a minute later.
Closing the terminal or your code editor does the same thing: it ends the program.
The fix: run it somewhere that never turns off #
- Bot hosting (simplest): upload your files to a host and press Start. ESN Nano is $0.50/month with 256 MB RAM, enough for most small bots.
- A VPS: a Linux server you manage yourself, with a process manager like systemd or pm2 to restart the bot.
- An always-on computer at home (an old PC or a Raspberry Pi): it works, but power cuts, updates and router restarts still take the bot down.
Move it to ESN in 4 steps #
- Pick a bot plan.
- Upload your project (see the Python or Node.js guide).
- Put your token in the startup variables, not in your code.
- Press Start, then stop the copy on your PC so the bot doesn't answer twice.
After that you can close everything: the bot keeps running.
Related: Discord bot offline? 9 causes · Keep your bot online 24/7 · discord.py bot keeps disconnecting
FAQ #
Can I keep my PC on instead?
You can, but sleep, updates, power cuts and Wi-Fi drops will still take the bot offline. A host keeps it running without your computer.
Will my bot lose data when it moves?
Only if it stores data in files you forget to upload. Upload your database or JSON files along with the code.
Still stuck? Use the live chat on the panel or ask in the ESN Systems Discord. Last updated November 3, 2026.