Discord Bot

Can I run a Python bot / use Flask?

Python bots are fully at home on our hosting, and you can even run a lightweight web process like Flask alongside them. This article covers deploying a Python bot and adding a Flask keep-alive or health endpoint.

Hosting a Python bot

Python is fully supported — discord.py and other Discord libraries all work here.

  1. Upload your code and your requirements.txt to the Files tab.
  2. Open the Startup tab and set bot.py (or your entry file) as the file to run.
  3. Save and press Start from the Console.

Your dependencies install automatically from requirements.txt, so there's nothing extra to configure.

Running Flask alongside your bot

A lightweight Flask process can run alongside your bot — handy for a keep-alive or health-check endpoint. If Flask needs to accept traffic from outside the server, add a port for it:

  1. Go to the Ports tab and add a port.
  2. Have Flask listen on that host and port.
  3. Point anything that needs to reach it at the allocation shown in the Ports tab.

Tip: If Flask is only used internally, you may not need an external port at all — add one only when something outside the server needs to connect.

Frequently asked questions

Which Python versions can I use? Set the runtime in the Startup tab. If you need a specific version that isn't selectable, open a ticket and we'll help.

Can Flask serve a full website too? It can serve traffic with a port from the Ports tab, though for a heavier web app you may want a plan sized accordingly — open a ticket and we'll advise.