Pterodactyl Logo

Host a Discord Bot with Pterodactyl

Pterodactyl is an excellent platform for hosting applications that need to run 24/7 — such as a Discord bot. Note that you are not hosting a Discord server itself, but rather the bot's program code that connects to the Discord service.

Prerequisites: Before you begin, make sure you have the following ready:

✓ A fully configured Pterodactyl panel — Initial Panel Configuration
✓ A bot application created in the Discord Developer Portal
✓ Your unique Bot Token, copied from the Discord Developer Portal

Step 1: Get a Discord Bot Egg

The Egg you need depends on the programming language your bot is written in — Python, JavaScript/Node.js, and others are all available. You can find a wide selection on pterodactyleggs.com.

2.Find an Egg matching your bot's language — e.g. Discord Bot JS for a Node.js bot or Discord Bot Python for a Python bot
3.Download the .json file for the Egg

Step 2: Import the Egg

Upload the downloaded Egg to your Pterodactyl panel:

1.Navigate to the Admin Area via the wrench icon ⚙
2.Click Nests in the sidebar
3.Click Import Egg, upload the .json file, and assign it to a Nest — e.g. create a new one called Bots

Step 3: Create the Bot Server

Create a server instance for your bot to run on. Most bots are very lightweight and don't require much CPU or RAM.

1.Go to Servers → Create New
2.Give the server a name (e.g. My Discord Bot)
3.Under Nest Configuration, select the Nest and the specific Bot Egg you just imported
4.Set appropriate resource limits and click Create Server

Step 4: Upload Your Bot's Files

Your bot's code needs to be uploaded to the server before it can run:

1.Navigate to your new bot server in the panel
2.Go to the File Management tab
3.Upload all of your bot's files — e.g. index.js, bot.py, package.json, or any other project files

Step 5: Configure the Bot Token

The bot needs its token to authenticate with Discord's services:

1.Go to the Startup tab for your server
2.Find the startup variable for the bot token — often named BOT_TOKEN or similar
3.Paste your Bot Token from the Discord Developer Portal into this field

Never share your Bot Token! This token provides full control over your bot. Treat it like a password and never make it public or commit it to a public repository.

Step 6: Start Your Bot

With everything configured, you can now start your bot:

1.Go to the Console tab
2.Click Start
3.Watch the console output for errors — if the Egg is correctly configured, it may automatically install dependencies (e.g. from package.json) before starting the bot

Further Documentation

For help building your bot, refer to the official Discord developer documentation.