Writing a Discord bot and running it on your own machine is fun, right up until you shut the computer down for the night and the bot goes offline with it, leaving your server waiting for commands that never come. This is the classic problem everyone hits when they start building Discord bots.
The fix that real bot developers use is to move the bot onto a VPS that stays on 24 hours a day, so you no longer have to leave your home PC running, wasting power and risking dropped connections. This article explains why a VPS is perfect for the job, with steps to install a Node.js or Python bot on a Linux VPS using pm2 so it stays online all the time, and even restarts itself automatically after the VPS reboots.
Why a home PC cannot run a Discord bot 24/7
A Discord bot has to be online at all times to receive commands and respond to events in your server. The moment the process stops, the bot shows as offline and does nothing at all. A home PC is a poor fit because you do not leave it on around the clock, and even if you do, it still has several weak points.
Think about a bot that sends member alerts, queues music, tracks stats, or runs a leveling system in a server that people use all day. If the bot keeps dropping, it loses all credibility. A VPS solves every weak point of running on a home PC.
- Shut down or restart = the bot goes offline instantly and you have to start it again every time
- A dropped home connection or power cut takes the bot down too, with no backup
- Leaving a PC on 24/7 wastes power, overheats the machine, and shortens its lifespan
- Home IPs change often and are unstable, unsuitable for tasks that must stay online continuously
- You have to keep the PC running, which makes it awkward to use for anything else
How a VPS helps you run a Discord bot
A VPS (Virtual Private Server) is a virtual server that stays on inside a datacenter 24 hours a day, with backup power and high-speed networking far more stable than a home connection. You get full control of the machine (Full Root Access), so you can install Node.js, Python, or anything else you like.
Once your bot lives on a VPS, it stays online even when you switch off your home PC, because the bot no longer runs on your machine. You just SSH in to manage it when needed and let the VPS handle the rest.
- On 24/7 in a datacenter with backup power and networking, 99.9% uptime
- Full Root Access to install Node.js/Python/any library you want
- Choose your OS, both Linux (the most popular for bots) and Windows
- A stable IP that does not change as often as a home connection
- Switch off your home PC and the bot stays online, saving power at home
- Manage it over SSH from anywhere, updating or restarting the bot on the go
How much VPS spec does a Discord bot need
The good news is that most Discord bots use very few resources, especially bots that just respond to general commands. You do not need to buy a high-spec VPS. Start with the smallest package, which is usually enough, and upgrade later when your bot gets more complex or lives in a large server with thousands of members.
| Recommended spec | Suits which kind of bot | Notes |
|---|---|---|
| 1 vCPU / 1 GB RAM | General command bots, leveling bots, alert bots | Enough for most bots |
| 1 vCPU / 2 GB RAM | Music bots on 1–2 servers, bots with a small database | Extra RAM for audio streaming |
| 2 vCPU / 2–4 GB RAM | Music bots on many servers, several bots on one machine | Runs multiple bots at once |
| 2+ vCPU / 4+ GB RAM | Bots in large servers, heavy processing/AI bots | Handles high load and heavy work |
Steps to run a Discord bot on a Linux VPS (Node.js / Python)
Follow along step by step, starting from zero
Suppose you have finished writing your bot locally and the code is in GitHub or ready to upload. The steps below are a guide to getting the bot online for real on a Linux VPS (for example, Ubuntu).
- 1Order the VPS, then SSH in with ssh root@your-ip
- 2Update the system with apt update && apt upgrade first
- 3Install the runtime: for a Node.js bot install Node.js + npm / for a Python bot install python3 + pip
- 4Pull the bot code onto the machine, e.g. git clone from GitHub or upload via SFTP
- 5Install dependencies: Node uses npm install / Python uses pip install -r requirements.txt
- 6Set the Bot Token in a .env file or config (never hardcode the token directly in the code)
- 7Run the bot once to check that it comes online and responds to commands
- 8Install a process manager to keep the bot running (see the next section)
Keep the bot running with pm2 (it survives closing SSH)
If you run the bot with a plain command and then close the SSH window, the bot stops instantly because the process is tied to that session. The fix is a process manager like pm2 (for Node.js, and it works with Python scripts too), which runs the bot in the background and restarts it automatically if it crashes or the VPS reboots.
pm2 is the most popular tool for this, easy to install and use, and great for beginners. Another popular option is a systemd service, which already ships with Linux and suits long-term, professional-grade deployments.
- 1Install pm2 with npm install -g pm2
- 2Start the bot with pm2 start index.js --name mybot (Python uses pm2 start bot.py --interpreter python3)
- 3Check the bot status with pm2 status and view logs with pm2 logs
- 4Run pm2 startup then pm2 save so the bot starts itself automatically every time the VPS reboots
- 5Update the bot: git pull then pm2 restart mybot
Linux or Windows: which is better for a Discord bot
For a Discord bot, Linux is the main recommendation because it uses fewer resources (no GUI weighing it down), so even a small VPS runs it smoothly. Tools like Node.js, Python, and pm2 are designed to work best on Linux, and most tutorials and examples out there are Linux-based.
You can choose Windows if you are more comfortable with it, or if your bot depends on a program or library that only runs on Windows. But Windows uses more RAM, so you need a higher spec. At Plusweb you can pick whichever OS suits you.
| Point | Linux | Windows |
|---|---|---|
| Resource usage | Low, runs on small specs | Higher, needs extra RAM |
| Suits | General Node/Python bots | Bots that rely on Windows programs |
| Tools (pm2/systemd) | Fully supported | Usable but configured differently |
| Popularity for bots | Highest, plenty of examples | Less common |
| Connection | SSH | Remote Desktop (RDP) |
Summary: move your Discord bot to a VPS for 24/7 uptime
Running a Discord bot on your home PC is fine only for development and testing, but when it comes to real use, the bot has to stay online all the time. A VPS is the best answer because it is on 24/7 in a datacenter with 99.9% uptime, gives you Full Root Access, and lets you pick your OS, all without leaving a PC running and wasting power.
Start with a small VPS spec that is enough for most bots, install Node.js or Python, then use pm2 to keep the bot running and self-restarting after reboots. With that, your bot stays reliably online, ready to serve your server members at all times.
Get your Discord bot online 24/7 with Plusweb Cloud VPS
From ฿150/month · Full Root Access · KVM · SSD · 99.9% uptime · Choose Linux or Windows · Auto-provisioned within minutes — switch off your home PC and the bot stays online
Frequently Asked Questions
What VPS spec do I need to run a Discord bot?
A typical Discord bot uses very few resources. Starting at 1 vCPU / 1 GB RAM is enough for command bots, leveling bots, or alert bots. For a music bot that streams audio on several servers, or a heavy-processing bot, step up to 2 vCPU / 2–4 GB RAM.
Why not just run the Discord bot on my home PC?
Because the bot goes offline the moment you shut down, lose your connection, or hit a power cut, and leaving a PC on 24/7 wastes power and overheats the machine. A VPS stays on in a datacenter with backup power and networking, so it is far better suited to a bot that must stay online continuously.
How do I stop the bot from dying when I close the SSH window?
Use a process manager like pm2. Run pm2 start to launch the bot in the background, then pm2 startup + pm2 save so it starts itself automatically every time the VPS reboots. The bot stays online even after you close SSH. A systemd service works too.
Should a Discord bot use Linux or Windows?
Linux is recommended because it uses fewer resources, runs on small specs, and tools like Node.js, Python, and pm2 fully support it. Choose Windows only when your bot depends on a program that runs only on Windows. At Plusweb you can pick either OS.
Can I run multiple Discord bots on a single VPS?
Yes. pm2 supports running multiple processes on one machine. Give them separate names (--name) and manage each one individually. Just make sure the VPS spec matches the number of bots and the total load. Starting at 2 vCPU / 2–4 GB RAM comfortably runs several bots.
GUIDES
Related articles
Keep reading on similar topics

Run Bots and Automation Scripts 24/7 on a VPS
Got a Python/Node script, a Telegram bot, a web scraper, or an automation task you want running all the time? This guide explains why a VPS beats a home PC, how to use pm2 and cron to keep bots/scripts running continuously, and the spec you need.
Read more
What Is a VPS? What Can You Do With One, Explained Simply
A complete guide to VPS — what a VPS server is, how it works, how Cloud VPS differs from a regular VPS, what you can do with one, how it compares to shared hosting and dedicated servers, who should use one, and how to get started in 2026.
Read more
Cheap VPS 2026: How to Choose Value Without Getting Scammed
Want a cheap VPS but afraid of getting a poor deal? This article explains why VPS prices vary so much, how "cheap" differs from "good value", the criteria for choosing a cheap VPS that is worth it, and the red flags of cheap VPS providers to avoid before you get scammed.
Read more