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.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.
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
.envfile - 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.txtlisting all dependencies (e.g.,discord.pyorpy-cord, andpython-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
- Log in to the Free Tier Dashboard at dash.daki.cc or the Billing Panel at billing.daki.cc.
- Create a new server and select the Python egg.
- Give your server a name (e.g.,
MyPythonBot).
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):- Compress your project folder into a
.zipfile. - In the Portal, go to the Files tab and click Upload.
- Right-click the
.zipand click Extract.
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:python main.py— if your entry file ismain.pypython bot.py— if your entry file isbot.pypython -m mypackage— if your project is structured as a package
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.
- In the Files tab, click New File and name it
.env. - Add your token:
- Click Save.
python-dotenv is in your requirements.txt, then load the file in your code:
.env files.
Step 6: Start Your Bot
Click Start in the Console tab. A successful launch will print:Common Issues
ModuleNotFoundError: No module named 'discord'
ModuleNotFoundError: No module named 'discord'
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.ModuleNotFoundError: No module named 'dotenv'
ModuleNotFoundError: No module named 'dotenv'
Add
python-dotenv to your requirements.txt and restart the server.discord.errors.LoginFailure: Improper token has been passed
discord.errors.LoginFailure: Improper token has been passed
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.PrivilegedIntentsRequired error
PrivilegedIntentsRequired error
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.
Server crashes immediately on start
Server crashes immediately on start
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
- Environment Variables — Full guide on
.envfiles and reading variables in code. - Keep Your Free Server Active — Watch ads regularly to keep your Free Tier server running.
- File Manager — Update your code after making changes.