1. Home
  2. Guides
  3. Discord bots
Discord botsGuide

How to host a Discord bot written in Python

If your discord.py bot only works while your computer is on, hosting it on a server keeps it connected around the clock. These are the steps.

  • 2 min read
  • 6 sections
Discord bots

In short

  • The bot runs on Python 3.12; the panel looks for main.py or bot.py, or the file you set.
  • Upload your .py files and your dependencies over FTP.
  • Paste the token in the panel, press Start and read the logs if the bot does not answer.

1. Check that it starts on your computer

Before uploading, run it locally and confirm it connects to Discord and answers commands. An error that already fails on your machine will fail on the server too.

2. Be clear about the main file

The panel looks for main.py or bot.py to start the bot. If your main file is named differently, set it in the panel settings.

3. Use the right Python version

The bot runs on Python 3.12. If you use discord.py or another library, check it is compatible with that version, and so are your dependencies.

4. Upload the files over FTP

Connect over FTP with the panel's credentials and upload your .py files and your dependencies.

5. Put the token in the panel and start

Do not write the token into the code or push it to a public repository: whoever has it controls your bot. Paste it in the panel and press Start.

6. Read the logs

If the bot does not answer, the first place to look is the logs in the panel: that is where a startup error, a missing dependency or a wrong token shows up.