Skip to content

How do I deploy a discord.py bot?

Create your bot at discord.com/developers/applications, open the Bot tab and press Reset Token to copy the token. Add the bot to your server with the bot and applications.commands scopes.

In the panel, open the Startup page and paste the token into Discord Token. Your code reads it with os.environ["DISCORD_TOKEN"].

Upload your bot file and a requirements.txt listing your packages, such as discord.py, nextcord or py-cord. Every start runs pip install -r requirements.txt. Keep only one of discord.py or Pycord in the file, as both install a package called discord. To deploy from Git, set Git Repository on the Startup page and reinstall.

The server starts bot.py by default. If your entry file is different, set Bot Main File on the Startup page, for example main.py. You can choose Python 3.11, 3.12 or 3.13 there too.

Press Start and watch the Console. ModuleNotFoundError means a package is missing from requirements.txt; LoginFailure means the token is wrong. If slash commands do not show, sync your command tree once with await bot.tree.sync(). The full guide with working code is at zerosrp.co.uk/discord-bot-hosting/discord-py.

Was this helpful?

Want to try this on a real server?

Everything described here is available on the trial too, on the same hardware and the same panel as the paid plans. Try it free for 48 hours, no credit card required.

Didn't fix it? Ask in Discord.

Ask in our Discord - we help with hosting questions whether or not you host with us.