discord.py Bot Hosting
Python bots built with discord.py, nextcord or Pycord all run the same way here: your bot file starts, it connects to Discord, and the server keeps it running day and night.
Put your packages in requirements.txt and every start installs them with pip. Pick Python 3.11, 3.12 or 3.13 on the Startup page.
- Python versions
- 3.11, 3.12 and 3.13
- Entry file
- bot.py (you can change it)
- Dependencies
- pip install -r requirements.txt on every start
- Libraries
- discord.py, nextcord, Pycord and more
A bot that runs here as it is
A minimal discord.py 2 bot with one slash command. Put discord.py in requirements.txt.
import os
import discord
from discord.ext import commands
intents = discord.Intents.default()
bot = commands.Bot(command_prefix="!", intents=intents)
@bot.event
async def setup_hook():
await bot.tree.sync()
@bot.event
async def on_ready():
print(f"Ready as {bot.user}")
@bot.tree.command(name="ping", description="Check the bot is alive")
async def ping(interaction: discord.Interaction):
await interaction.response.send_message("Pong")
bot.run(os.environ["DISCORD_TOKEN"])How to host a discord.py bot on Zeros Host
- 1
Create the bot in the Discord Developer Portal
Go to discord.com/developers/applications, create an application, open the Bot tab and press Reset Token to copy your token. Under OAuth2, pick the bot and applications.commands scopes, choose the permissions your bot needs, and open the generated link to add the bot to your server.
- 2
Create a Python bot server
Start a free trial or pick a Discord Bot plan and choose Python. A starter bot runs straight away so you can check everything is connected.
- 3
Add your bot token
Open the Startup page for your server and paste your token into Discord Token. The panel passes it to your bot as the DISCORD_TOKEN environment variable, so it never has to sit inside your code or your Git repository.
- 4
Upload your files or connect Git
Upload bot.py and requirements.txt with the File Manager, or set Git Repository on the Startup page and reinstall. With Git set, each restart pulls your latest commit before the bot starts.
- 5
Point Bot Main File at your entry file
If your bot starts from main.py or src/bot.py, set Bot Main File on the Startup page to that path.
- 6
Start it
Press Start. The console shows pip installing your requirements, then your own output. Your ready message means the bot is online.
Common discord.py errors and fixes
ModuleNotFoundError: No module named 'discord'
The package is missing from requirements.txt. Add discord.py (or nextcord or py-cord, whichever you import) and restart.
Two Discord libraries fighting over the discord module
discord.py and Pycord both install a package called discord. Keep only the one your code uses in requirements.txt and reinstall.
Slash commands do not show up
Call bot.tree.sync() once, as in the sample above, after defining your commands. Syncing to one guild is instant; global sync can take longer.
Used disallowed intents
Your code asks for a privileged intent (Message Content, Server Members or Presence) that is switched off for your bot. Turn it on under Bot, Privileged Gateway Intents in the Developer Portal, or remove it from your code.
An invalid token was provided
The token in Discord Token is wrong or was reset. Reset it in the Developer Portal, paste the new one on the Startup page and restart. Discord also resets tokens it finds in public GitHub repositories, so keep yours out of your code.
Which plan fits
A small discord.py bot runs comfortably in 256 MB. Bots that load data science libraries, images or large caches need more. Standard at 512 MB fits most Python bots.
Starter
£1/mo
256 MB RAM · 5 GB
Standard
£3/mo
512 MB RAM · 10 GB
Suggested for this bot
Pro
£5/mo
1 GB RAM · 15 GB
Enterprise
£6/mo
2 GB RAM · 25 GB
Try it free for 48 hours
Start a 48-hour Discord bot trial with no card needed. Pick your runtime and your server is ready in seconds. Plans start at £1 a month after that.
Frequently asked questions
Does it work with nextcord and Pycord?
Yes. The server runs whatever your requirements.txt installs. If there is no requirements.txt, the first install adds discord.py for you.
Can I use a virtual environment?
You do not need one. Each bot runs in its own container, so packages from requirements.txt are already isolated from every other server.
Which Python version should I pick?
Python 3.12 is a safe default. Use 3.11 if a package you rely on has not caught up yet, or 3.13 for the newest language features.