Back to Blog
Guide10 min read2026-07-04

Best Discord Bot Hosting Platforms in 2026

Discord bots need a persistent process and a gateway connection — which rules out a lot of serverless hosts. Here's how to host bots correctly in 2026, with a fair platform comparison.

Ajay Kumar
Ajay Kumar
Founder & DevOps, PandaStack

Why most "free" bot hosting advice is wrong

The number one misconception about hosting Discord bots: they are not web apps. A typical bot maintains a persistent WebSocket connection to the Discord Gateway and listens for events. That has two big implications:

  1. 1It needs a long-running process. Pure request/response serverless functions that spin down between invocations will drop the gateway connection. Scale-to-zero can disconnect your bot.
  2. 2It often doesn't serve HTTP at all. Many hosts expect a web server on a port; a gateway bot may have nothing listening, which can confuse health checks.

There's a newer alternative — HTTP interaction endpoints — where Discord sends slash-command interactions to your HTTPS endpoint. That model *can* work on serverless. But for bots that need to observe message events, voice, or presence, you need the persistent gateway connection, and therefore a persistent host.

Gateway bot vs. HTTP-interactions bot

Gateway botHTTP interactions
ConnectionPersistent WebSocketPer-request HTTPS
HostingLong-running processCan be serverless
Can read message eventsYes (with intent)No
Voice supportYesNo
Scale-to-zero friendlyNoYes

Match your hosting to your bot type. Most full-featured bots are gateway bots and need a persistent host.

The platforms

A small VPS (DigitalOcean, Hetzner, etc.)

The old reliable. A cheap VPS runs a bot process under systemd or pm2 and just keeps it alive. Maximum control, minimal cost. The trade-off is you own the OS, updates, and restarts. Perfectly fine for a single hobby bot.

Railway / Render

Both run long-lived worker processes (not just web services), which is exactly what a gateway bot needs. Push your repo, set the start command, and it stays running. Managed databases are available for bots that store state. Good DX for hobby and small community bots. Check current pricing.

Fly.io

Runs your bot as a persistent machine; good for bots that need to be always-on with some regional control. Note that some scale-to-zero configs aren't appropriate for gateway bots — keep at least one instance always running.

PandaStack

Disclosure: my platform. A Discord gateway bot runs on PandaStack as a long-lived container web service (the process stays up even though it isn't serving much HTTP). Bring a Dockerfile or let buildpacks detect Node/Python/Go:

FROM node:20-slim
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
CMD ["node", "bot.js"]

Bots that store data (levels, economy, reminders) can attach a managed Postgres/MySQL/Mongo/Redis with the connection string injected. Need scheduled actions (daily stats, reminders)? Use cronjobs. You get live logs to debug gateway issues and rollbacks if a deploy breaks the bot.

Important honesty for this use case: PandaStack's free tier uses KEDA scale-to-zero on preemptible nodes — which is great for web apps but not ideal for an always-on gateway bot, since scaling to zero drops the gateway connection. For a production gateway bot on PandaStack, run it on a tier that stays warm rather than the scale-to-zero free tier. (An HTTP-interactions-only bot is fine on free tier, since it's request-driven.)

State, secrets, and reconnection

  • Never commit your bot token. Use env vars/secrets. A leaked token = a hijacked bot.
  • Use a real database for persistent state, not a local file that vanishes on redeploy.
  • Let the library handle reconnection/resume (discord.js, discord.py, and serenity all do this) — but design assuming occasional disconnects.
  • Request only the gateway intents you need; privileged intents (message content, presence) require enabling in the Discord developer portal.

Sizing

Most bots are I/O-bound and light. A small tier (0.25-0.5 vCPU, 512MB) handles a lot of guilds. Memory grows with cache size (member/message caches) — disable caches you don't use. Sharding becomes relevant only at large guild counts (Discord requires sharding past ~2,500 guilds).

References

  • [Discord Gateway docs](https://discord.com/developers/docs/topics/gateway)
  • [Discord interactions (HTTP) docs](https://discord.com/developers/docs/interactions/receiving-and-responding)
  • [Gateway intents](https://discord.com/developers/docs/topics/gateway#gateway-intents)
  • [discord.js guide](https://discordjs.guide/)
  • [discord.py documentation](https://discordpy.readthedocs.io/)

---

Building a bot that stores state and needs scheduled tasks? PandaStack gives you a container, a managed database, and cronjobs — just run a gateway bot on a warm tier rather than scale-to-zero. Start at [dashboard.pandastack.io](https://dashboard.pandastack.io).

Ready to deploy?

Start free on PandaStack.

Start free on PandaStack

More in Guide

Browse all Guide articles →

See also