Discord bot hosting in Python (discord.py) 24/7
Updated 25-10-2026
A Python bot written with discord.py (or py-cord or nextcord) runs with us around the clock. You upload the files, and the panel installs the libraries, starts the bot and keeps it running.
Prepare the project
List the dependencies in requirements.txt:
discord.py==2.4.0
python-dotenv==1.0.1An example main.py:
import os
import discord
from dotenv import load_dotenv
load_dotenv()
intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
@client.event
async def on_ready():
print(f"Logged in as {client.user}", flush=True)
client.run(os.environ["DISCORD_TOKEN"])Upload and set the start
- Upload the files in the File manager or over SFTP.
- In Server settings → Startup point to the start file, e.g.
main.py. - In Environment choose the Python version: discord.py 2 needs Python 3.8 or newer.
The token in a .env file
Create a .env file with the line DISCORD_TOKEN=your_token. The example code reads it with load_dotenv(). Do not paste the token into the code or a repository.
Start it
In the Console click Start. You see the bot's logs live.
Python sometimes holds back printed text and the logs show up late. Add
flush=Truetologgingmodule.
Common errors
- LoginFailure: Improper token has been passed: the token is out of date, put a new one in
.env. - PrivilegedIntentsRequired: turn on the needed Privileged Gateway Intents in the Discord Developer Portal.
- ModuleNotFoundError: No module named …: add the library to
requirements.txt. The package to install is sometimes named differently from the module, e.g. thediscordmodule is installed asdiscord.pyanddotenvaspython-dotenv. - The bot does not see message content: turn on the Message Content intent in the Developer Portal and in the code (
intents.message_content = True).
The basics (creating the bot in Discord) are in Discord bot: getting started.