Comparison
| Option | Bot host | VPS | Raspberry Pi |
|---|---|---|---|
| Cost | Free (256 MB) or $0.99–$3.49/mo | Varies by provider | Hardware up front + electricity |
| Setup | Pick a template, upload, add token | Install runtime, process manager, firewall | Install OS, runtime, process manager |
| Restarts on crash | See availability below | You set up pm2/systemd | You set up pm2/systemd |
| OS patching and security | Host does it | You | You |
| Uptime depends on | Host's data center | Provider's data center | Your power, router, ISP |
| Backups | Daily rolling backup slots on paid plans; 1 manual slot on Free | You set up | You set up |
| Run anything (DBs, web, other languages) | Discord bots in Node, Python, Java | Yes | Yes |
Choose a bot host if…
You want the bot online with the least upkeep, it's written with discord.js, discord.py or JDA, and you'd rather spend time on features than on server admin.
Choose a VPS if…
You run several services (web dashboard, database, other bots in other languages), you're comfortable with Linux, SSH and firewalls, and you want full control.
Choose a Raspberry Pi if…
You enjoy tinkering, already own one, and can live with downtime when your power or ISP drops. Use a wired connection and run the bot under systemd so it restarts after a reboot.
Self-host a Discord bot on Linux
Start with a bot that already logs in and answers a command. Our discord.js example and discord.py example include the required project files. Check that the runtime and any native dependencies support your Pi's architecture before copying a project from another machine.
- Create a dedicated, unprivileged account for the bot. In this example it is named
discordbot, with its project in/srv/discord-bot. Give that account the file access the project needs. - Install the runtime and declared dependencies. For Node.js with a matching lockfile, use
npm ci --omit=dev. For Python, create a virtual environment and installrequirements.txtinto it. - Put
BOT_TOKENand other private variables in/etc/discord-bot.env, inNAME=valueform. Keep it owned by root with mode0600; systemd reads it before starting the process. Do not commit it. - Save the following unit as
/etc/systemd/system/discord-bot.service. Replace paths with your actual files. Check the Node binary withcommand -v node; a version manager's interactive shell setup is not automatically loaded by systemd.
[Unit]
Description=Discord bot
Wants=network-online.target
After=network-online.target
StartLimitIntervalSec=300
StartLimitBurst=5
[Service]
Type=simple
User=discordbot
WorkingDirectory=/srv/discord-bot
EnvironmentFile=/etc/discord-bot.env
ExecStart=/usr/bin/node /srv/discord-bot/index.js
Restart=on-failure
RestartSec=10
MemoryAccounting=yes
NoNewPrivileges=yes
[Install]
WantedBy=multi-user.targetFor Python, replace ExecStart with the absolute path to the virtual environment's Python executable and main.py. A start limit stops repeated failures; fix the exception before resetting the failed service.
sudo systemctl daemon-reload
sudo systemctl enable --now discord-bot.service
sudo systemctl status discord-bot.service
sudo journalctl -u discord-bot.service -n 50 --no-pagerCheck that startup succeeds and a command works in a test server. Close SSH and test again, then verify that the service starts after a planned reboot. These checks distinguish a running process from a bot that actually receives and answers commands. See the systemd service manual for restart and start-limit behavior.
Memory, saved data and network checks
On the running example service, systemctl show discord-bot.service --property=MemoryCurrent reports the cgroup's current memory in bytes. Record it after startup and during normal use; leave room for dependency installation and workload peaks. One idle reading is not a capacity benchmark. Use the RAM guide to investigate growth.
Keep a separate copy of persistent files and test restoring it. Stop writes or use the database's backup tool when copying SQLite or another active datastore. Keep source in version control, while leaving credentials outside it. Update the OS and dependencies, and check logs after each update.
A Gateway-only bot connects out to Discord; opening an inbound router port is not needed just for that connection. An HTTP interactions endpoint or web dashboard needs its own reachable service. Avoid disabling the firewall to diagnose a bot that has not logged in. Start with its console and offline troubleshooting.
Choose managed hosting to reduce maintenance
- Price: discordbothost Starter is $0.99/month for 512 MB, with plan limits shown before purchase.
- No admin: own container, a hard disk quota and live graphs, with nothing to patch.
- Discord-aware: templates for the three big libraries, crash alerts in Discord (paid), and separate outgoing addresses for free and paid bots.
- Easy path up: 1 GB for $1.99 and 2 GB for $3.49 when the bot grows.
Bots restart automatically after a crash. Repeated crashes pause restarts; check the console before starting again.
Sources and scope
The Linux service example and primary systemd documentation were reviewed on . Adapt the runtime, account and paths to your machine. This comparison is published by DiscordBotHost; a VPS remains useful when you need system control or several services together.
Questions
Is a VPS better than bot hosting for a Discord bot?
A VPS gives root access, but you handle OS updates, security, process restarts and backups. A bot host provides a managed runtime with plan limits. Choose based on dependencies, control and how much maintenance you want to own.
Can I host a Discord bot on a Raspberry Pi?
Yes. A Pi on wired internet runs a small Node or Python bot well. You depend on your home power, router and internet, and you maintain the device yourself.
How do I keep a self-hosted Discord bot running after closing SSH?
Run it as a service rather than inside your SSH terminal. On a Linux host with systemd, configure the working directory, runtime, private environment file and restart policy, then enable the service and inspect its logs.
Does self-hosting a Discord bot require port forwarding?
A bot that only connects out to the Discord Gateway does not need an inbound port just for that connection. An HTTP interaction endpoint or public dashboard has separate networking requirements.
Sources
Related
Railway vs Render vs Replit vs Heroku for Discord Bots
Railway, Render, Replit, Heroku and Fly.io for a Discord bot: free options, real monthly cost, sleep behavior, and a cheaper dedicated alternative.
Updated · 3 min readFree Discord Bot Hosting Compared (2026)
Free Discord bot hosts side by side: RAM, renewal rules, sleep and backups for discordbothost, bot-hosting.net, fps.ms, Botkeep, FadeHost, Daki and more.
Updated · 4 min readbot-hosting.net Alternatives: Discord Bot Hosts Compared
Compare bot-hosting.net with discordbothost, Sparked Host and PebbleHost on renewal, memory, backups and price. Find the right fit before moving.
Updated · 4 min read