How do I deploy a discord.py bot?
Create your bot application at discord.com/developers/applications and add it to your Discord server with the appropriate permissions. Copy the bot token; you will need it as an environment variable.
In the panel, go to the Startup page and add an environment variable named TOKEN (or whatever your code reads from os.environ) with your bot token. Never hardcode the token in your source files.
Upload your bot files via File Manager. Include a requirements.txt listing your dependencies. The panel installs them automatically from requirements.txt on first start. Make sure discord.py or py-cord (whichever you use) is listed there. Include the correct version pin if your code depends on a specific API version.
Set your start command on the Startup page. Common options: python bot.py, python main.py, or python -m yourpackage if structured as a package. The panel uses the Python version configured for your server; check the Startup page for the Python binary being used.
After uploading files and configuring the start command, click Start. Check the Console page for errors. Common causes of failure: TOKEN environment variable not set (you will see a LoginFailure or similar error), a missing import (ModuleNotFoundError means a dependency is not in requirements.txt), or a Python version mismatch. If dependencies fail to install, check the Console output from startup for pip error messages.
To update code, stop the server, upload updated files via File Manager, and restart. If you have changed requirements.txt, the panel will re-run the install automatically.
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 24-hour, 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.