Skip to content
Kravn Hosting

FR/EN

  • The offer
  • Guide
  • FAQ
  • FR/EN
Discord Panel login Sign up
  1. Home
  2. Guides
  3. Host a Python Discord bot for free

Host a Python Discord bot for free

Is your bot written with discord.py, py-cord, nextcord or disnake? On Kravn Hosting it runs 24/7 on Python 3.13 or 3.12, for free, with no credit card. This guide shows what to prepare, how to upload it and how to fix the most common errors.

Prepare your bot

Your folder needs at least these files:

  • main.py (or bot.py, or app.py): the file that starts your bot.
  • requirements.txt: the packages your bot needs.
  • .env: your Discord token. It stays on the server, never put it on GitHub.

A simple requirements.txt:

discord.py
python-dotenv

The .env file:

DISCORD_TOKEN=your-token

A minimal main.py that answers !ping:

import os
import discord
from dotenv import load_dotenv

load_dotenv()
intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)

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

@client.event
async def on_message(message):
    if message.content == "!ping":
        await message.channel.send("Pong!")

client.run(os.environ["DISCORD_TOKEN"])

Get it online

  1. Create your account with Discord, then log in to the panel and open your bot.
  2. Pick Python (3.13 or 3.12) in the Startup tab. Leave the main file empty: Kravn looks for main.py, then bot.py, then app.py.
  3. Upload your files in the Files tab or over SFTP. Do not upload your venv folder: it is created again on the server.
  4. Press Start. On the first start, Kravn creates a Python environment (.venv) and installs your requirements.txt. After that, it only reinstalls when that file changes.

Is your code on GitHub? Deploy it from GitHub, it updates on every restart.

Common errors

  • ModuleNotFoundError: the package is missing from requirements.txt. Add it and restart.
  • PrivilegedIntentsRequired: your code asks for an intent that is not enabled. In the Discord developer portal, Bot tab, enable Message Content Intent (and Server Members Intent if you use it).
  • LoginFailure: Improper token: the token is wrong or was reset. Copy the new one into your .env.
  • KeyError: 'DISCORD_TOKEN': the .env is not read. Check that it sits next to main.py and that python-dotenv is in requirements.txt.
  • The bot stops with no message: it may be out of memory. Each bot has 256 MB of RAM, enough for a normal bot, but not for loading large files or AI models in memory.

Good to know

  • You get 256 MB of RAM, 768 MB of disk and 20% of a CPU core.
  • Only a Discord bot is allowed: a website, a proxy or any other program is stopped.
  • Your bot is paused if it stays offline for more than 5 days. Your files are kept and you start it again yourself from the panel.
  • You can switch from Python to Node.js later, in the Startup tab.

Create my account

Going further

  • Free Discord bot hosting
  • Host a discord.js bot (Node.js)
  • Deploy a Discord bot from GitHub
  • Frequently asked questions
  • A question? Come to the Discord.
Kravn Hosting

Free and secure hosting for your Discord bot, online 24/7.

Join the Discord

Kravn

  • The offer
  • Panel login
  • Create an account
  • Status
  • Discord

Guides

  • Free bot hosting
  • Python Discord bot
  • discord.js bot (Node.js)
  • Deploy from GitHub
  • Ready-made bots
  • Web dashboard
  • All guides

Legal

  • Legal notice
  • Terms of use
  • Privacy

© 2026 Kravn Hosting · Free service.