Discord Bot Hosting 2026: How to Keep Your Bot Online 24/7
How to host a Discord bot 24/7 in 2026. VPS vs shared hosting, Node.js and Python bot setup, process managers, and what to look for in a Discord bot host.
- #discord-bot
- #hosting
- #nodejs
- #python
- #vps
- #24-7
Discord Bot Hosting 2026: How to Keep Your Bot Online 24/7
Running a Discord bot on your personal computer works fine for testing β but the moment you close your laptop, the bot goes offline. To keep your bot running 24/7, you need a server. Here's what you need to know about Discord bot hosting in 2026.
Why You Need Dedicated Hosting for Your Discord Bot
Discord bots need to maintain a persistent WebSocket connection to Discord's gateway. This means:
- Your host needs a stable, always-on internet connection
- The process needs to keep running indefinitely
- Crashes need automatic recovery
- For large bots (1000+ servers): you need adequate CPU for event processing
Your home internet and laptop aren't reliable enough for a production bot. A VPS or dedicated hosting is the right solution.
What Your Discord Bot Actually Needs
Discord bots are extremely lightweight compared to game servers:
| Bot Size | Servers | Recommended RAM | CPU |
|---|---|---|---|
| Small | Under 100 | 512 MB | Minimal |
| Medium | 100β1000 | 512 MB β 1 GB | Low |
| Large | 1000β10,000 | 1β2 GB | Moderate |
| Very large | 10,000+ | 2β4 GB | Significant |
A simple moderation/music bot for a single community server needs almost nothing β 256β512 MB RAM is sufficient.
Node.js Discord Bot Setup (discord.js)
The most popular stack for Discord bots in 2026 is Node.js with discord.js v14:
# Install Node.js (if not present)
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
# Create bot directory and install discord.js
mkdir mybot && cd mybot
npm init -y
npm install discord.js
Basic index.js:
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
]
});
client.once('ready', () => {
console.log(`Logged in as ${client.user.tag}`);
});
client.on('messageCreate', message => {
if (message.content === '!ping') {
message.reply('Pong!');
}
});
client.login(process.env.DISCORD_TOKEN);
Store your bot token in a .env file (never hardcode it):
DISCORD_TOKEN=your_token_here
Python Discord Bot Setup (discord.py)
For Python bots with discord.py:
pip install discord.py python-dotenv
Basic bot.py:
import discord
import os
from dotenv import load_dotenv
load_dotenv()
intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
@client.event
async def on_ready():
print(f'Logged in as {client.user}')
@client.event
async def on_message(message):
if message.content == '!ping':
await message.channel.send('Pong!')
client.run(os.getenv('DISCORD_TOKEN'))
Keeping Your Bot Online: Process Managers
If your bot crashes, it needs to restart automatically. Use a process manager:
PM2 (Node.js)
npm install -g pm2
# Start your bot with PM2
pm2 start index.js --name "my-discord-bot"
# Make PM2 start on system reboot
pm2 startup
pm2 save
Useful PM2 commands:
pm2 list # Show all running processes
pm2 logs my-discord-bot # View logs
pm2 restart my-discord-bot # Restart bot
pm2 stop my-discord-bot # Stop bot
systemd (Linux, Node.js or Python)
Create /etc/systemd/system/discordbot.service:
[Unit]
Description=Discord Bot
After=network.target
[Service]
Type=simple
User=steam
WorkingDirectory=/home/steam/mybot
ExecStart=/usr/bin/node index.js
Restart=on-failure
RestartSec=5
EnvironmentFile=/home/steam/mybot/.env
[Install]
WantedBy=multi-user.target
Enable and start:
systemctl enable discordbot
systemctl start discordbot
systemctl status discordbot
Security: Protecting Your Bot Token
Your Discord bot token is the key to your bot. If it leaks:
- Anyone can use your bot as a malicious bot
- Your bot can be used for spam or abuse
- Discord may terminate your bot application
Never:
- Commit your token to GitHub (use
.gitignorefor.env) - Share your token in Discord or chat
- Include tokens in screenshots
Always:
- Use environment variables or
.envfiles - Regenerate your token immediately if it leaks (Discord Developer Portal β Bot β Reset Token)
Renzom Discord Bot Hosting
Renzom offers VPS-style hosting suitable for Discord bots. With full SSH access and Linux environment, you can run Node.js or Python bots with PM2 or systemd for automatic restart.
Since Discord bots are so lightweight, even our entry-level plans handle multiple bots simultaneously.
Summary
Discord bot hosting needs an always-on server, a process manager for crash recovery, and secure token handling. Node.js (discord.js) and Python (discord.py) are the dominant stacks. PM2 for Node.js and systemd for any stack are the standard solutions for keeping bots running through crashes and reboots. Entry-level VPS hosting starts well under β¬10/month for most bot workloads.
