Discord Bot Hosting: Keep Your Bot Online, Free or Paid
A Discord bot only works while its program is running. On your computer, it stops when you switch the computer off; on a host, it's always on. Here's how to set it up, with discord.js (Node.js) or discord.py (Python).
What a bot needs
A bot is a program that logs in to Discord with its token and sits there listening. Nobody connects to it, so there are no ports to open: it just has to be running. For commands and moderation, 256–512 MB of memory is plenty; with lots of servers, a big cache or music, 1 GB (the RAM calculator tells you which).
If you haven't built it yet, start with your first bot in Python or in JavaScript: about fifteen minutes each.
Rather not set it up yourself? Discord bot hosting from €1.50 a month, no contract and a full refund within 72 hours. Or create a free Discord bot, no card needed.
With NapNodes
Pick free or a plan
The free bot has 256 MB and is renewed every week with one click; the Mini (512 MB) and Plus (1 GB) plans never need renewing (pricing).
Pick the language
The bot starts out on Node.js; if yours is Python, go to “Settings” → “Language” and choose “Switch to Python” (your files aren't touched). The version (Node.js 24, 22 or 20; Python 3.13, 3.12 or 3.11) is under “Advanced settings” → “Version & startup”.
Upload your code
In “Files”, or put your GitHub repository's address in “Settings” and it downloads itself (and, if you like, updates on every restart; for a private one, with your username and a GitHub token). The dependencies in package.json or requirements.txt install at startup.
The token goes in your code
For example in a .env file your bot reads when it starts. Never in a public repository: whoever has it controls your bot (how to keep it safe and what to do if it leaks).
Pick the startup file and start it
index.js or app.py (or your own) in “Settings”, then “Start”. The panel's console shows what your bot prints; if it never connects or doesn't reply, see what to check for each error.
What's not allowed
No selfbots, spam, raids, scraping user data, crypto mining or anything against Discord's terms: abusive use gets cut off (Acceptable Use Policy). A normal bot has nothing to worry about.
And the bot can't send email directly: the mail ports (25, 465 and 587) are closed. If it needs to send email notifications, do it through an email-sending service's web API.
Frequently asked questions
Can I have a free Discord bot online all the time?
Yes: the NapNodes free bot has 256 MB and stays online; you only have to renew it every week with one click in the panel. Other free options, with their downsides, in keep a Discord bot online for free.
discord.js or discord.py?
Both work: Node.js for discord.js and Python for discord.py, nextcord or py-cord. You pick the language in “Settings” and the version in “Version & startup”.
Do I need to open ports for a Discord bot?
No. The bot connects to Discord; nobody connects to it.
How much RAM does a Discord bot need?
For commands and moderation, 256–512 MB. With lots of servers or music, 1 GB.
Shall we set it up for you?
Discord bot hosting from €1.50 a month, never oversold: your RAM is yours alone. And if you'd rather start without paying, there's a free Discord bot, no card needed.
Free tool: Discord bot permissions calculator. Tick your bot's permissions and get the number and the invite link; or paste a number and see which permissions it grants.
Free tool: Discord intents calculator. Tick what your bot does or search the event you're not getting: the intents, the discord.js or discord.py code and what to enable in the portal.
Free tool: Discord timestamp generator. Pick a date, time and time zone and copy the <t:…> so everyone on Discord sees the time in their own zone, or a countdown.
Free tool: Discord embed generator. Build an embed with a title, colour, fields and images, see it as Discord shows it and copy the discord.js, discord.py or webhook JSON code.
Keep reading
- Your Discord bot token: where to keep it and what to do if it leaks
Where to keep your Discord bot token so it doesn't leak (.env and .gitignore) and what to do, in order, if you pushed it to GitHub or it got stolen.
- Keep a Discord Bot Online for Free: Replit Alternatives
Why your Discord bot goes offline on Replit or Render, why the keep_alive trick fails, and the free options that really keep it running.
- Slash Commands in Your Discord Bot: Options, Subcommands and Permissions
Slash commands in discord.js and discord.py: options, subcommands, permissions, slow replies, autocomplete and why they don't show up.