Free Discord bot hosting 24/7: what actually stays online
A slash-command bot runs free on a host that wakes within Discord’s 3 seconds. A Gateway bot needs a process up all month: which free plans give you one.
Yes, for a bot that only answers slash commands, buttons and modals. Give it an Interactions Endpoint URL, and Discord sends each one to the bot as an HTTPS request, so the bot only has to run while it answers, and a free plan that sleeps or scales to zero can host it. The catch is time: the bot must answer within 3 seconds, so a host that takes a minute to wake fails the first command after a quiet spell. A bot built on the Gateway, as most discord.js and discord.py bots are, holds a WebSocket open and needs a process running all month: Fly.io’s Free plan with a card, Railway Free for a small bot, and Oracle Cloud’s Always Free VMs give you one, and GitHub Actions is not allowed for it.
Gregale publishes this page. Discord’s rules come from its interactions overview, receiving and responding and Gateway docs, checked on December 4, 2026, as were Railway’s Free plan, Fly.io’s pricing and PythonAnywhere’s allowlist. The other hosts’ limits come from their own docs, as checked for our pages on free Telegram bot hosting and Vercel (December 3) and Render’s free tier (December 2). Gregale’s come from its plans page, and its numbers from a test we ran on December 4.
Gateway or endpoint decides it
Discord delivers interactions in one of two ways, and its docs call them mutually exclusive:
- The Gateway. The bot opens a WebSocket to Discord and keeps it open, sending a heartbeat on a timer. This is the default, and what discord.js and discord.py use. The connection has to stay up, so the process runs all the time. A bot that reacts to messages, members joining, presence or voice needs it.
- An Interactions Endpoint URL. You set a public HTTPS URL in the
Developer Portal, and Discord sends each slash command, button press, menu
choice or modal submission there as a
POST. Nothing runs in between.
The endpoint has one hard rule: the first response must reach Discord within 3 seconds of the event, or Discord invalidates the interaction’s token and the user sees an error. Telegram repeats a webhook that fails and keeps updates for 24 hours; a Discord interaction gets one chance. So on a host that sleeps, the wake has to fit inside those 3 seconds too. Our endpoint guide has the complete Node.js bot, with no dependencies, and how to connect it.
Free hosts for a Discord bot
| Free plan | Slash-command bot (endpoint) | Gateway bot, all month | The catch |
|---|---|---|---|
| Gregale Free | Yes: a parked bot answered 164 to 197 ms after a command reached it | No: 20 GB-RAM-hours run a 256 MB process for about 80 hours | 1 app with 256 MB, HTTP only, requests up to 30 seconds |
| Cloudflare Workers Free | Yes: Discord’s own tutorial hosts a bot on Workers; 100,000 requests a day | No: a Worker runs only while it handles a request | 10 ms of CPU time per request |
| Vercel Hobby | Yes: a Node.js, Python or Go function | For about a week: a Daemon (in beta) bills 2 GB of provisioned memory every hour it runs, and Hobby includes 360 GB-hours | 4 hours of Active CPU and 1 million invocations a month |
| Render Free | Only while awake: after 15 minutes idle the next command waits about a minute, far past the 3 seconds | Only if an outside ping keeps it awake, since the Gateway connection is outbound; one service fits 750 free hours | The bot must also serve HTTP for the ping, and it loses local files at each spin-down |
| PythonAnywhere Beginner | Yes, as a Flask web app; discord.com is on the free allowlist for follow-up messages | No: always-on tasks are for paid accounts, though gateway.discord.gg is on the allowlist | 100 CPU-seconds a day, and outbound HTTP(S) only to allowlisted sites |
| Railway Free | Yes, but it sleeps after 5 to 10 minutes without outbound traffic, and Railway doesn’t say how fast it wakes | Yes, if small: the Gateway connection is outbound traffic, so the bot never sleeps; $5 covers 500 MB or 0.25 vCPU all month | Services stop until the next billing cycle when the $5 runs out |
| Fly.io Free plan | Yes, with one Machine kept running | Yes: Fly prices “a Discord bot … running 24/7” on a 256 MB Machine at $2.21 a month, of the $5 | $5 a month needs a card ($1 once, for 7 days, without one); past $5 the whole month is billed |
| Oracle Cloud Always Free | Yes | Yes: a VM of your own | Oracle may reclaim an instance whose CPU and network use (and memory, on Arm) stay under 20% for 7 days, as a quiet bot’s do |
| GitHub Actions | No | No: a job stops after 6 hours | GitHub’s terms rule out using hosted runners for anything unrelated to the repository’s software |
Three things the table doesn’t show:
- The 3 seconds include the wake. Answering with type
5, a deferred response, buys 15 minutes for the real reply, but the process must be up to send it. A host that starts a container or a stopped VM on the first request spends part of the 3 seconds before your code runs. - Railway and Render count different traffic. Railway puts a service to sleep when it stops sending traffic, and says a bot holding a WebSocket stays awake. Render spins a free service down when nothing comes in, and a Gateway connection the bot opened doesn’t count, so a Gateway bot there needs an HTTP route and outside pings.
- Railway’s $5 pays for everything at once. It covers 500 MB of memory or 0.25 vCPU running all month, not both, and egress comes out of it too. A small bot fits; one that caches whole servers in memory runs out before the month ends.
Where Gregale fits
A slash-command bot fits the Free plan: 1 app with 256 MB and 20 GB-RAM-hours a month, and requests can take up to 30 seconds. An app parks after 1 minute idle and holds no memory while parked. Free is HTTP only, which is all an endpoint needs.
On December 4, 2026 we deployed the bot from gregale-dev/discord-bot-interactions, on a 512 MB instance, with a test key pair we generated instead of a real Discord app. We parked it before each command and signed every request the way Discord does:
- Inside Gregale: 4 wakes restored the snapshot in 51 to 68 ms and sent
the first byte of the
pong164 to 197 ms after the command reached Gregale, by the app’s wake timeline. - From a laptop in Istanbul: 9 commands to the parked app took 0.62 to 0.74 seconds end to end, against 0.47 to 0.50 seconds once it was running. About 0.31 seconds of each was opening the connection and TLS to the app in Quebec. We didn’t measure from Discord’s servers.
- The checks Discord runs: a
PINGgot{"type":1}, and a request with a bad signature got401.
The same bot used 68 MB of memory in our endpoint guide.
A Gateway bot runs on Gregale as a worker: a service without ports: in a
project runs all the time and is billed for every hour.
A 256 MB worker running a 30-day month uses about 180 GB-RAM-hours, inside the
200 that Hobby includes for $10 a month. You can also split the bot: commands
on the endpoint, scaling to zero, and a small worker only for the Gateway
events you need.
What to get right on any host
- Verify every request. Check
X-Signature-Ed25519against the timestamp inX-Signature-Timestampfollowed by the raw body, and answer401when it fails. Discord won’t save the endpoint URL until this and thePINGreply work. - Answer
PINGwith{"type":1}. Discord sends one when you save the URL. - Defer slow work. Answer with type
5within 3 seconds, then edit the reply through the interaction’s webhook. The token lasts 15 minutes. - Keep the bot token off the endpoint. The endpoint needs only the public key. The bot token is for registering commands from your machine.
- One way at a time. Once the endpoint URL is set, interactions stop arriving over the Gateway, so a bot that also listens for them there stops seeing them.
What we verified
Discord’s, Railway’s, Fly.io’s and PythonAnywhere’s docs on December 4, 2026; the other hosts’ limits on the dates above. We didn’t deploy a bot to the other hosts for this page. Gregale’s plans are from its plans page on December 4, and the wake times from our own test that day, after which we deleted the test app. The bot’s memory use is from our endpoint guide, measured on November 27, 2026.
Questions
- Can I host a Discord bot for free 24/7?
Yes, if it only answers slash commands, buttons and modals: set an Interactions Endpoint URL and Discord sends each one as an HTTPS request, so a free plan that scales to zero can host it, as long as it answers within 3 seconds. A Gateway bot needs a process running all month, which Fly.io’s Free plan with a card, Railway Free for a small bot, and Oracle Cloud’s Always Free VMs give you.
- Why does my Discord bot say “The application did not respond”?
Its first response didn’t reach Discord within 3 seconds, and on a free host the usual cause is the time it takes to wake. Answer with a deferred response (type 5) as soon as the request arrives, and pick a host that wakes in well under a second or stays running.
- Can I run a discord.js or discord.py bot on Vercel or Cloudflare Workers?
Not as a Gateway bot: a function or Worker runs only while it handles a request, and a Vercel Daemon on Hobby uses up the plan’s provisioned memory in about a week. Both can host the same bot as an Interactions Endpoint that answers slash commands.
- Does Railway’s free plan keep a Discord bot online?
A small Gateway bot, yes. Railway puts a free service to sleep after 5 to 10 minutes without outbound traffic, and the bot’s Gateway connection is outbound traffic. The $5 a month covers 500 MB of memory or 0.25 vCPU running all month, and when it runs out the bot stops until the next billing cycle.
- Can I run a Discord bot on GitHub Actions?
No. A job on a GitHub-hosted runner stops after 6 hours, and GitHub’s terms rule out using hosted runners for anything unrelated to the repository’s software.