← Back to Blog
Bots

How to Host Your Discord Bot 24/7 for Free

Remoud Team · 5 min read · 2026-02-23

So you built a Discord bot. It works perfectly... until you close your laptop and the bot goes offline. If you want your bot to be online 24/7 without paying expensive monthly fees, cloud hosting is your answer.

The "Worker" Process Problem

Unlike regular web servers that listen for HTTP requests and can "sleep" when no one is hitting a URL, a Discord bot maintains a persistent websocket connection to Discord's servers. Providers that "sleep" free apps (like free Heroku used to do, or Render today) will cause your bot to repeatedly disconnect.

You need an "always-on" container.

Step 1: Keep Your Token Secret

Never commit your Discord Bot Token to GitHub! Instead, use `process.env.DISCORD_TOKEN` in your code and set the actual value inside your cloud provider's dashboard.

Step 2: Add a Dummy Web Server (Optional)

Some PaaS providers require apps to bind to a port within 60 seconds of booting, otherwise they assume the app crashed. You can easily add a lightweight web server in Node.js just to satisfy this requirement:

const http = require('http');
http.createServer((req, res) => res.end('Bot is alive!')).listen(process.env.PORT || 3000);

Step 3: Deploy to an Always-On Service

With Remoud, the free tier is 'always-on', meaning your bot won't hibernate when inactive. Connect your GitHub repo, input the `DISCORD_TOKEN` environment variable, and hit deploy. The bot will automatically restart if the code crashes, ensuring permanent uptime.

Get Your Bot Online permanently

Deploy your Node.js or Python Discord bot instantly on Remoud.

Start deploying for free →