What Hosting a Bot Actually Means

A Discord bot is a process that maintains a persistent WebSocket connection to Discord's gateway. As long as the process is running, the bot is online. The moment the process stops, the bot goes offline.

When you run a bot on your local machine by typing node bot.js, the process lives inside your terminal. Close the terminal, shut down your PC, or lose your internet connection and the bot dies instantly. Your server members see it go offline with no warning.

Hosting means moving that process to a machine that is designed to run continuously: a server in a datacenter with reliable power, fast internet, and no user who will shut it down at 11pm. You do not need a powerful machine for most bots. You need one that stays on.

The key question is not "how powerful is the server?" but "does the platform keep my process running without interruption?" Many free platforms fail this test because they sleep or kill processes to manage shared resources.

Your Options (VPS, Free Cloud Tiers, Game Hosting)

There are three main categories of hosting for a Discord bot:

Paid VPS (Virtual Private Server): Providers like DigitalOcean, Linode, Hetzner, and Vultr offer Linux VMs starting at a few dollars per month. You get root access, complete control, and reliable uptime. This is the gold standard, but it costs money. Hetzner's cheapest ARM VPS is around 3 euros per month, which is the best value in this category.

Free cloud tiers: Platforms like Railway, Render, Fly.io, and Cyclic offer free tiers. The catch is almost always the same: processes spin down after inactivity, monthly compute credit limits, or cold start delays that make bots feel unresponsive. These are fine for testing but unreliable for production bots that need to always respond immediately.

Free game hosting with bot support: Some game hosting platforms, including NetSkyway, support Node.js and Python server types alongside game servers. This is genuinely free with no spin-down behaviour. The process stays running as long as you want it to.

Getting a Free Slot on NetSkyway

NetSkyway hosts Discord bots for free alongside Minecraft servers, Node.js apps, and Python apps. To get a slot:

  1. Join the Discord server at discord.gg/QXKNwaWVJ2.
  2. Find the server request channel and submit your request. Mention that you want a Node.js or Python slot for a Discord bot.
  3. Once approved, you will receive login credentials for the NetSkyway panel.
  4. Log into the panel at panel.netskyway.net. You will see your server slot with power controls, a live console, file management, and SFTP access.

The hardware behind each slot is real: i9-13900K or Ryzen 9 9950X CPUs with DDR5 RAM and NVMe storage. This is not shared web hosting with throttled resources. The panel is based on Pterodactyl, a well-established open source game server management platform.

Slots are free as long as your bot is actively running and you stay in the Discord community. There is no expiry timer on idle slots, but if you abandon a slot without any activity for an extended period it may be reclaimed to make room for new users.

Deploying Your Bot (Upload Files via SFTP or git)

With your slot ready, get your bot files onto the server. There are two approaches:

SFTP upload: Open FileZilla (or WinSCP on Windows). Create a new site connection with the hostname, port 2022, and your panel credentials. Navigate to your local bot folder on the left side and drag it to the server root on the right. Do not upload the node_modules folder since it can be hundreds of megabytes. You will reinstall dependencies on the server.

git clone: If your bot is in a git repository, open the console in the panel and run:

git clone https://github.com/yourusername/your-bot-repo.git .

The dot at the end clones into the current directory instead of creating a subfolder. This is cleaner for the server structure.

After uploading or cloning, create a .env file with your bot token. Use the panel's built-in file editor to create it without going back to SFTP:

DISCORD_TOKEN=your_token_here

Installing Dependencies (npm install or pip install -r requirements.txt)

Dependencies are not bundled with your code. After uploading your files, open the console in the panel and install them:

For Node.js bots:

npm install

This reads your package.json and installs everything listed under dependencies. For a discord.js bot this typically takes 30 to 60 seconds and installs a few hundred megabytes of packages into the node_modules folder on the server.

For Python bots:

pip install -r requirements.txt

If you do not have a requirements.txt, create one listing your packages: discord.py, python-dotenv, and any other libraries your bot uses. One package per line.

Once the install completes without errors, test the bot by running it directly: node bot.js or python bot.py. Check Discord to confirm the bot appears online and responds to a test command. If everything looks good, stop it with Ctrl+C and move to PM2.

Running the Bot with PM2 or screen

PM2 is a process manager that keeps your Node.js bot running even after you close the console tab. Install it and start your bot:

npm install -g pm2
pm2 start bot.js --name "discord-bot"
pm2 save

The pm2 save command writes the current process list to disk. Run pm2 startup to generate a startup command that makes PM2 automatically restore your bot after any server restart.

For Python bots, PM2 can manage Python processes too:

pm2 start bot.py --interpreter python3 --name "discord-bot"

Alternatively, use screen for a simpler setup:

screen -S discord-bot
python bot.py

Press Ctrl+A then D to detach from the screen session without killing the bot. Use screen -r discord-bot to reattach later. Screen is simpler but does not auto-restart on crash the way PM2 does.

For production use, PM2 is the right choice. The auto-restart on crash means your bot stays online even when an unhandled exception would otherwise kill it. Check logs with pm2 logs discord-bot to catch errors early.