Reproducible installs
Declare every production package in requirements.txt or your chosen Python project file so the remote environment can be rebuilt consistently.
requirements.txt or pyproject.toml
Python runtime
A deployment path for Python bot makers who want the code in GitHub, the token outside it, and the startup evidence close at hand.
Production shape
The goal is a repeatable release whose dependencies, command, and failures are easy to explain.
Declare every production package in requirements.txt or your chosen Python project file so the remote environment can be rebuilt consistently.
requirements.txt or pyproject.toml
Make the command that starts the bot unambiguous. A host should not have to guess between bot.py, main.py, app.py, or a package module.
python -m your_bot
Import errors, syntax failures, missing variables, and Discord login errors should remain visible instead of becoming a mysterious offline badge.
traceback + exit status
Deploy checklist
A bot that works inside only one developer environment is not ready for reliable hosting.
Use a virtual environment so the dependency list reflects the bot project rather than every Python package installed on your computer.
Record discord.py and every package the bot imports. A deployment can only install dependencies that the repository declares.
Read DISCORD_TOKEN from the environment, fail clearly when it is missing, and keep .env files outside Git.
Run the exact production command, confirm on_ready completes, and test the event or command paths the bot actually needs.
Discord-specific
discord.py requires intents when the client is created. Choose the smallest set that supports the bot's features; member, presence, and message-content access may require additional configuration or approval.
The discord.py intents primer explains both sides of the configuration. Discord's official getting-started guide also warns that bot tokens should never be shared or committed to version control.
Prefer a clear startup failure over silently passing an empty token or setting. A one-line configuration error is easier to fix than a process that never connects.
Questions
No. Commit the dependency declaration, not the local virtual-environment folder. The deployment environment should create a clean environment and install the declared packages.
The package may not be declared, its import name may differ from its package name, or the deployment may use a different Python version than your computer.
Check the intents passed to discord.Client or commands.Bot and the matching toggles in the Developer Portal. Prefix commands that read message content generally require the message-content intent.
Keep reading
Turn a repository into a repeatable hosted release.
Read more →bothoster.dev/how-to-host-a-discord-botChoose between a PC, VPS, general cloud, and managed bot hosting.
Read more →bothoster.dev/securityUse a safer credential lifecycle from development to production.
Read more →Next step
Join BotHoster early access and help refine a clearer deployment flow for discord.py projects.