← All guides

Host your Discord bot

Get your Node.js, Python or Java bot online 24/7 in about 5 minutes. No bot plan yet? Pick one first and choose your language at checkout.

The four steps: create the bot in the Discord Developer Portal, upload your code, set the main file in Startup, press Start.
The four steps. You only do steps 1–3 once.

1. Create your bot and copy its token

Skip this if your bot already exists and you have its token.

  1. Go to the Discord Developer Portal and click New Application. Give it a name.
  2. Open the Bot page and click Reset Token. Copy the token and keep it somewhere safe. Discord only shows it once.
  3. On the same page, under Privileged Gateway Intents, turn on the ones your code asks for. Most bots that read commands typed in chat need Message Content Intent. Welcome bots need Server Members Intent.
  4. To invite the bot, open OAuth2 → URL Generator, tick bot and applications.commands, choose the permissions it needs, then open the link at the bottom and pick your Discord server.

Your token is the password to your bot. Anyone who has it can control the bot. Never paste it in Discord, a screenshot or a public GitHub repo. If it leaks, click Reset Token straight away.

2. Open your bot in the panel

After you order, your bot server is created automatically. Log in to the game panel with the same email and password as the client area, and click your bot. It's empty for now, waiting for your code.

3. Put your code on the server

Option A: upload your files

  1. Click Files, then Upload, and choose your bot's files. You can also upload a .zip and use ⋯ → Unarchive.
  2. Upload your code and your package list (package.json for Node.js, requirements.txt for Python). For Java, upload your built .jar.
  3. Don't upload node_modules, venv or __pycache__. They're big, and the panel installs your packages itself.

For lots of files, SFTP is faster.

A typical Node.js bot: index.js, package.json and a .env file with the token. node_modules is created automatically.
A typical Node.js bot. node_modules is created for you.

Option B: clone it from GitHub

  1. Make sure the Files page is empty. The first clone only works into an empty folder.
  2. Open Startup and fill in Git Repo Address (for example https://github.com/you/your-bot). Set Install Branch if it isn't your default branch.
  3. Set User Uploaded Files to false.
  4. Private repo? Fill in Git Username and Git Access Token. On GitHub, create a fine-grained token with read-only access to that one repo's contents.
  5. Go to Settings and click Reinstall Server. The repo is cloned and your packages are installed. You can watch it in the Console.

Want new commits to go live on every restart? Set Auto Update to true, and the bot runs git pull each time it starts.

4. Keep your token in a .env file

Put the token in its own file instead of in your code. Then you can share or push your code without leaking it. In Files, click New File, name it .env, and add:

DISCORD_TOKEN=paste-your-token-here

If you use Git, add .env to your .gitignore so it never gets committed. Then load it in your bot:

Node.js: add dotenv to your package.json (or run npm install dotenv on your PC first), then:

require("dotenv").config();
const { Client, GatewayIntentBits } = require("discord.js");

const client = new Client({ intents: [GatewayIntentBits.Guilds] });
client.once("ready", () => console.log(`Logged in as ${client.user.tag}`));
client.login(process.env.DISCORD_TOKEN);

Python: add python-dotenv to your requirements.txt next to discord.py, then:

import os
import discord
from dotenv import load_dotenv

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

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

client.run(os.getenv("DISCORD_TOKEN"))

Java: read the token from a file next to your jar (for example with the dotenv-java library, or a config.properties file) rather than building it into the jar.

5. Check the Startup settings

Open Startup. The settings depend on your language:

  • Main file (Node.js and Python): the file that starts your bot, e.g. index.js, src/index.js, bot.py or main.py. TypeScript works too: set it to your .ts file and it runs directly.
  • Jar file (Java): the name of your .jar, e.g. bot.jar.
  • Docker Image: your language version. New bots start on Node.js 24, Python 3.13 or Java 21. Pick another version here if your bot needs it.
  • Requirements file (Python): leave it as requirements.txt unless yours has another name.
  • Additional Node packages / Additional Python packages: optional extras to install on each start, separated by spaces. Most bots don't need these if their package list is complete.
Startup tab for a Node.js bot: Main file index.js, User Uploaded Files true, Docker Image Nodejs 24.
The Startup tab for a Node.js bot. Python bots look the same with bot.py.

6. Start your bot

Go to Console and press Start. You'll see your packages installing (this is quicker after the first start), then your bot's own messages. When you see your "Logged in" line, check Discord: your bot is online.

That's it. Your bot stays online when you close the panel or turn off your PC. If it crashes, it's restarted automatically. If it crashes again within a minute, it stays off so you can read the error in the console.

The status shows Running as soon as your bot prints anything. A bot that prints nothing stays on Starting but still works. Adding a "Logged in" message, like in the examples above, makes it easy to tell.

Handy extras

  • Database: on Bot Standard and up, create a MySQL database in the Databases tab for levels, warnings or settings. See Create and use a MySQL database. Use the host and port shown there, not localhost.
  • Daily restart: add a schedule that restarts the bot once a day. See Schedules.
  • Web dashboard or webhooks: your bot has one public port. Listen on the port shown on the Console page (it's also in the SERVER_PORT environment variable) and on host 0.0.0.0.
  • Let a friend help: add them under Users. See Give friends access to the panel.
  • Backups: back up before big changes. See Back up and restore.

Troubleshooting

  • "Used disallowed intents" or "PrivilegedIntentsRequired": your code asks for an intent that's turned off. Turn it on in the Developer Portal under Bot → Privileged Gateway Intents, or remove it from your code.
  • "An invalid token was provided" or "Improper token": the token in .env is wrong or was reset. Copy a fresh one with Reset Token. Check there are no spaces or quotes around it.
  • "Cannot find module …" (Node.js): the package is missing from package.json, or Main file points to the wrong file. File names are case-sensitive: Index.js isn't index.js.
  • "ModuleNotFoundError" (Python): add the package to requirements.txt and restart. Note that the package name can differ from the import name, e.g. python-dotenv is imported as dotenv.
  • "Unable to access jarfile" (Java): the Jar file setting doesn't match your file's name exactly.
  • The bot stops with "Killed" or "out of memory": it needs more RAM than your plan has. Music bots and bots in many servers often need Bot Pro or bigger. Open a ticket and we'll move you up.
  • Git clone fails: make sure Files is empty, the address is right, and for private repos the access token can read the repo. The exact error is in the console.
  • Slash commands don't show up: invite the bot with the applications.commands scope, and register your commands in your code. Global commands can take a few minutes to appear.

Stuck?

Open a ticket in the client area with the error from your console. We'll help you get your bot online.

Open a ticket