Skip to content
Vastrox Blog

Discord Bot Hosting: Keep Your Bot Online 24/7

July 1, 2026 · by The Vastrox Team

If your Discord bot only runs while your own computer is on, you have already met the problem. Close the laptop, lose your home internet for a minute, or reboot to install an update, and the bot drops offline for everyone who uses it. This guide is for bot developers who want their bot online 24/7. It covers why a server beats your PC, how to pick the right specs, how to keep the process running through crashes and reboots, how to scale as you grow, and what it all actually costs.

Why your own PC is the wrong place to host a bot

Running a bot from your desktop or laptop works for the first day of development. As a permanent home it fails in predictable ways, and every one of them shows up as downtime your users notice.

What you want instead is a machine that is always on, always connected, and doing nothing but running your bot. That is exactly what a server is for.

Why a VPS is the right home for a Discord bot

A VPS, or virtual private server, is a slice of a powerful machine in a datacenter that behaves like your own Linux box. You get root access, a fixed public IP, and guaranteed resources, all for a few dollars a month. If the term is new to you, our guide comparing shared hosting, a VPS, and game servers breaks down the differences before you commit.

For a Discord bot, a VPS solves every problem your PC has:

A Linux VPS is the natural fit. Almost every bot library, from discord.js to discord.py, is happiest on Linux, and providers, tutorials, and deployment tools all assume it. VASTROX runs on NVMe SSD storage in European datacenters with instant provisioning, so you can have a box ready in minutes.

How much CPU and RAM your bot actually needs

This is where new developers overspend. Most Discord bots are tiny. A typical command or moderation bot written in discord.js sits idle at roughly 100 to 200 MB of RAM and uses almost no CPU while it waits for events. You do not need a large server to run it.

Sensible starting points:

Start small. It is easy to move up a plan later when your bot grows, and you avoid paying for capacity you are not using yet.

Keep your bot alive and deploy it safely

Getting the bot onto a server is only half the job. If you start it by hand with node index.js in an SSH session, it dies the moment you close that session, and it stays dead if it crashes or the server reboots. You need a process manager to keep it running, and a tidy way to ship updates.

pm2 for Node.js bots

pm2 is the most popular option for JavaScript bots. It restarts your bot automatically if it crashes, and it can bring the bot back after a full server reboot.

  1. Install it globally: npm install -g pm2
  2. Start your bot with a name: pm2 start index.js --name discord-bot
  3. Tell pm2 to launch on boot: pm2 startup and run the command it prints.
  4. Save the current process list so it is restored on reboot: pm2 save

From then on, pm2 logs shows live output, pm2 restart discord-bot reloads after a code change, and pm2 status confirms it is alive.

systemd for Python and everything else

If your bot is written in Python with discord.py, or you simply prefer the built-in Linux tool, systemd does the same job. Create a service file at /etc/systemd/system/discord-bot.service that runs your script, then set Restart=always so it recovers from crashes. Enable it with systemctl enable --now discord-bot and it will start on every boot. The key line either way is the automatic restart. That single setting is the difference between a bot that survives an unhandled error and one that stays offline until you notice.

Deploy and update with Git

Once the server is running, treat deployment as a short routine rather than copying files by hand.

Scaling as your bot grows: sharding

A single process can run a bot across thousands of servers, but there is a hard limit. Discord requires sharding once your bot passes roughly 2,500 guilds. A shard is one connection to Discord's gateway that handles a subset of your servers, and the gateway will not let a single connection carry more than that.

The good news is you can grow in stages:

Do not build for a million users on day one. Ship on one small VPS, watch memory and CPU with pm2 or your host's dashboard, and upgrade when the numbers say so.

What Discord bot hosting costs

This is the reassuring part. A capable entry-level VPS runs from just a few dollars a month, and one box can comfortably host several small bots at once. Compare that to free platforms that put your bot to sleep after inactivity, cap your hours, or shut down without warning. For a service that is supposed to be online 24/7, "free" usually means "offline when it matters."

You can see current VPS options and monthly prices on our plans and pricing page, then pick the smallest plan that fits the specs above. Moving to a bigger plan later is painless, so there is no reason to overbuy at the start.

Getting started

Moving a bot off your PC is one of the highest-value upgrades a developer can make, and it is not hard. Rent a small Linux VPS, deploy your code from Git, keep your token in an environment variable, and wrap the process in pm2 or systemd so it survives crashes and reboots. Do that, and your bot stays online whether your laptop is open or not. Start small, measure real usage, and scale only when your bot earns it.

Ready to get started?

Fast NVMe hosting, VPS and game servers with free migrations and 24/7 support.

View plans

More from the blog