
Host a Discord Bot with Pterodactyl
This guide shows how to run your own Discord bot 24/7 on Pterodactyl — from importing a bot Egg to uploading your code and setting the bot token. You host the bot's program code, not a Discord server itself.
Prerequisites: Before you begin, make sure you have the following ready:
Step 1: Get a Language Egg
The Egg you need depends on the programming language your bot is written in. The Egg library provides generic Eggs for Node.js, Python and other languages in its Languages category.
.json file via Download eggStep 2: Import the Egg
Upload the downloaded Egg to your Pterodactyl panel:
.json file and choose a Nest under Associated Nest — e.g. a new Nest called Bots that you created beforehand via Create New. Then open the imported Egg and, on the Configuration tab, change the Start Configuration to a text your bot prints once it is running — otherwise the panel keeps showing the server as startingStep 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 if you upload your files yourself instead of cloning a Git repositoryStep 4: Upload Your Bot's Files
Your bot's code needs to be uploaded to the server before it can run:
index.js, app.py, package.json, requirements.txt or any other project files. The start file must match the Main file (Node.js) or App py file (Python) variable on the Startup tabStep 5: Configure the Bot Token
The bot needs its token to authenticate with Discord's services:
.env file that you create in the Files tabDISCORD_TOKEN=your-tokenNever 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:
package.json or requirements.txt before starting the botFurther Documentation
For help building your bot, refer to the official Discord developer documentation.