Skip to main content

Hosting & Running Python Discord Bots

This guide explains how to set up, deploy, and run Python-based Discord bots (using discord.py, disnake, or nextcord) on your CordenX panel.


1. File Structure & Dependencies

Ensure your project contains these essential files before uploading:

  • Main Entry File: Usually main.py, bot.py, or app.py.
  • requirements.txt: A file listing all required Python modules (e.g., discord.py, python-dotenv).

2. Setting Up requirements.txt

Create a file named requirements.txt in your project folder containing your dependencies: text discord.py>=2.3.0 python-dotenv aiohttp

3. Uploading Files & Environment Configuration

  1. Log into your panel and select your Discord Bot server instance.
  2. Go to File Manager (or connect via SFTP).
  3. Upload your .py scripts and requirements.txt.
  4. Create a .env file to store your credentials: env DISCORD_TOKEN=your_bot_token_here

4. Configuring Startup Settings

  1. Navigate to the Startup tab in the sidebar.
  2. Configure the startup variables:
  • Main Python File: Set to main.py (or your entry filename).
  • Python Version: Select Python 3.10+ or Python 3.11 from the image selection.
  1. Switch to the Console tab and click Start. The panel will install packages from requirements.txt automatically.