Skip to main content

Documentation Index

Fetch the complete documentation index at: https://wiki.daki.cc/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through deploying a Python Discord bot on Daki Hosting — from creating your server to reading your bot token securely and going live.

What you’ll learn

  • How to create a Python server for your bot
  • How to upload your code
  • How to configure the install command, startup command, and Python version
  • How to set your bot token securely using a .env file
  • How to start your bot and verify it works

Prerequisites

  • A Daki account (Free Tier or paid) — see Create an Account
  • A Discord bot with a bot token, created in the Discord Developer Portal
  • Your bot’s source code, including a requirements.txt listing all dependencies (e.g., discord.py or py-cord, and python-dotenv)
Discord bots connect outbound to Discord’s servers and do not require an inbound port. This means Discord bots work on both Free Tier and paid plans. If your bot also runs an HTTP server (e.g., for webhooks or a web dashboard), you will need a paid plan, as publicly accessible ports are only available on paid plans. See Network & Allocations.

Step 1: Create a Python Server

  1. Log in to the Free Tier Dashboard at dash.daki.cc or the Billing Panel at billing.daki.cc.
  2. Create a new server and select the Python egg.
  3. Give your server a name (e.g., MyPythonBot).
See Create Your First Server for the full walkthrough.

Step 2: Access the Portal

Log in to the Portal via SSO or directly at portal.daki.cc. See Portal Overview.

Step 3: Upload Your Bot’s Code

Option A — Upload as a ZIP (simplest):
  1. Compress your project folder into a .zip file.
  2. In the Portal, go to the Files tab and click Upload.
  3. Right-click the .zip and click Extract.
Option B — Use SFTP (no size limits): Use your SFTP credentials from the Settings tab to upload the folder directly. See File Manager.
Include a requirements.txt in your project root. This is used by the install command to install your dependencies.

Step 4: Configure the Startup Tab

Open the Startup tab and configure all three fields: 1. Docker Image — Select the Python version your bot requires (e.g., Python 3.12). Choose the latest available version if unsure. 2. Install Command — Set this to install your dependencies automatically:
pip install -r requirements.txt
3. Startup Command — Set this to the command that runs your bot:
  • python main.py — if your entry file is main.py
  • python bot.py — if your entry file is bot.py
  • python -m mypackage — if your project is structured as a package
You are free to adjust these commands to match your project’s structure and requirements. See Startup Settings for a full explanation.

Step 5: Add Your Bot Token via a .env File

Store your Discord bot token in a .env file on the server so it never appears in your source code.
  1. In the Files tab, click New File and name it .env.
  2. Add your token:
    BOT_TOKEN=your_discord_bot_token_here
    
  3. Click Save.
Make sure python-dotenv is in your requirements.txt, then load the file in your code:
from dotenv import load_dotenv
import os
import discord

load_dotenv()
TOKEN = os.environ.get("BOT_TOKEN")

intents = discord.Intents.default()
client = discord.Client(intents=intents)

@client.event
async def on_ready():
    print(f"Logged in as {client.user}")

client.run(TOKEN)
See Environment Variables for more details on using .env files.

Step 6: Start Your Bot

Click Start in the Console tab. A successful launch will print:
Logged in as MyBot#1234
If you see errors, check the Troubleshooting guide.

Common Issues

Your dependencies were not installed. Check that discord.py or py-cord is listed in requirements.txt, and that the install command is set to pip install -r requirements.txt in the Startup tab. Restart the server to trigger the install.
Add python-dotenv to your requirements.txt and restart the server.
Your token in the .env file is incorrect or missing. Open the .env file in the Files tab and check the value carefully. Remove any extra spaces or quotes.
Your bot is requesting intents that are not enabled in the Discord Developer Portal. Enable the required privileged intents (e.g., Message Content Intent) in your bot application’s settings, and make sure your code requests the same intents.
Read the Console output for the error. Common causes: wrong startup command (filename typo or wrong path), missing requirements.txt, or a missing package. See Troubleshooting.

Next Steps