node index.js or python bot.py, the bot comes online and, as soon as you close the terminal, it disappears from the server. Nothing is wrong with your code. The problem is where the bot is running.
Why the bot stops
The bot is a process, and that process depends on two things you turn off without noticing:- The terminal. The process starts as a child of the terminal. Closing the window ends the session, and the system ends the session’s processes with it. The bot goes away at the same moment.
- The computer. If the PC shuts down, sleeps, restarts for an update or loses its internet connection, the bot goes down with it.
Options to keep the bot online
Leave your PC on
Good enough for testing. It costs nothing beyond electricity. But the bot goes down when the power goes out, when the internet drops or when the system restarts to update. You also need to remember to open the terminal again after every outage.Rent a VPS and use pm2
A VPS is a Linux server that is always on. pm2 keeps the bot running after you log out of SSH and restarts it if it crashes:Use managed hosting
You upload the code, add the token, and the platform runs the process, shows the logs and restarts the bot when it crashes. There is no server to manage. In exchange, you do not touch the machine’s operating system.The short path: Hyze Cloud
On Hyze Cloud there is nothing to install. It takes three steps:- Upload the code from GitHub or as a ZIP.
- Add
DISCORD_TOKENto the environment variables. - Click Deploy application and follow the logs.
Does free hosting sleep?
Many free plans turn the app off after a while without HTTP traffic, and since a Discord bot receives no HTTP traffic, it sleeps and goes offline; on Hyze Cloud, apps are not turned off for being idle.Next steps
Bot online 24/7
Prepare the code, store the token and deploy.
Open the dashboard
Create your account and get a 7-day trial.

