What Your Bot Needs to Run (Node.js or Python, Always-On Process)
A Discord bot is just a program that stays connected to Discord's gateway, listens for events, and responds to them. To run 24/7 it needs two things: a runtime environment and an always-on process.
Most Discord bots are written in one of two languages:
- Node.js - uses libraries like discord.js or Eris. Node.js 18+ is the current standard.
- Python - uses libraries like discord.py or nextcord. Python 3.10+ is recommended.
The bot process itself is just a script: node bot.js or python bot.py. The challenge is keeping that process running permanently, surviving crashes, reboots, and disconnects. On your local machine, closing the terminal kills the bot. On a hosting platform, a process manager handles restarts automatically.
Memory and CPU requirements for bots are modest. A typical moderation or music bot uses under 100 MB of RAM and almost no CPU at idle. Even a lightweight free hosting slot is sufficient for most bots.
Why a Free Hosting Service Beats Running It on Your PC
Running a bot locally is tempting because it feels simple. But it creates real problems for server members:
- The bot goes offline whenever your PC is off, sleeping, or restarting.
- Your home IP address is exposed in connection logs, which is a privacy and security risk.
- Home internet connections have worse uptime than a datacenter.
- Any update or crash requires you to manually restart the bot.
A hosting service eliminates all of these. The bot runs on a machine in a datacenter that is designed to stay online. Your IP is not exposed. Crashes are handled by a process manager. The only maintenance you need to do is push code updates.
Paid VPS plans start at a few dollars per month, but for a small bot there is genuinely no need to pay anything. Several platforms offer free tiers, including NetSkyway.
NetSkyway for Discord Bots (Node.js and Python Supported)
NetSkyway offers free hosting slots for Discord bots alongside its Minecraft and game server offering. Both Node.js and Python environments are supported. The hardware is real: i9-13900K or Ryzen 9 9950X processors, DDR5 RAM, and NVMe storage. This is not shared virtual hosting with throttled resources.
Slots are requested through Discord at discord.gg/QXKNwaWVJ2. After your request is approved, you get access to the NetSkyway panel where you can manage your server, view console output, upload files via SFTP, and restart the process if needed.
The panel is based on Pterodactyl, which is the industry-standard open source game server panel. If you have used any other managed game hosting before, the interface will be familiar. Console access means you can run commands like npm install or pip install -r requirements.txt directly from your browser.
There is no time limit on free slots as long as your bot is actively running and you are a member of the Discord server. NetSkyway also has a hibernation system: if your slot sits idle with no active process, it gets paused to reclaim resources, then wakes up sub-second when activity resumes.
Setting Up Your Bot on a Server Slot
Once you have a slot, the setup process is straightforward:
- Connect to your server via SFTP (your panel shows the host, port, username, and password).
- Upload your bot files to the server root. You can drag and drop in FileZilla.
- Open the console in the panel and run your package manager:
npm installfor Node.js bots orpip install -r requirements.txtfor Python bots. - Create a
.envfile (or edit your config file) with your bot token. Never hardcode tokens in your source code. - Test the bot with
node bot.jsorpython bot.pyfrom the console to confirm it connects.
If your bot connects successfully and responds to commands, move on to setting up a process manager so it stays running after you close the console tab.
Keeping It Running with PM2 (Node.js) or systemd
PM2 is a process manager for Node.js applications. It restarts your bot if it crashes, keeps it running after you disconnect, and gives you a simple command-line interface for managing it.
Install PM2 globally:
npm install -g pm2
Then start your bot with PM2:
pm2 start bot.js --name "mybot"
From now on, even if the process crashes, PM2 will restart it automatically. Use pm2 logs mybot to see output and pm2 status to check if it is running.
For Python bots, you have a few options. The simplest is using screen or tmux to run the process in a detached terminal session. A more robust option is writing a simple systemd service file, but on shared hosting you often do not have systemd access. PM2 also supports Python scripts: pm2 start bot.py --interpreter python3 --name "mybot".
Common Issues and How to Fix Them
A few problems come up repeatedly when setting up a Discord bot for the first time on a new host:
Bot connects but commands do not respond: Check that you have enabled the correct intents in the Discord Developer Portal. For most bots you need the Message Content intent enabled manually under Privileged Gateway Intents.
Module not found errors: You uploaded your code but forgot to run npm install or pip install -r requirements.txt on the server. Dependencies are not included in a typical upload. Run the install command in the console before starting the bot.
Token invalid error: Double-check that your token is correct and has not been regenerated since you last set it. Bot tokens regenerate when you click "Reset Token" in the Developer Portal, or when your previous token was leaked. Copy the fresh token into your config or .env file.
Bot offline after server restart: If you started the bot with pm2 start but did not save the process list, PM2 forgets about it on restart. Run pm2 save after starting your bot, then pm2 startup to generate a startup script. This is covered in the next logical step after getting the bot running.