How to Install a Custom Discord Bot from GitHub
Download and deploy any Discord bot from GitHub on your XGamingServer Discord bot server.
This guide walks you through deploying any open-source Discord bot from GitHub on your XGamingServer.
📝 Note: You need a Discord bot token before proceeding. Follow our Create a Bot Token guide if you have not created one yet.
Finding a Bot on GitHub
Popular Discord bot repositories include:
- discord.js Guide Bot — Official discord.js example bot
- Red-DiscordBot — Modular Python bot
- JMusicBot — Java music bot
Check the bot's README for setup instructions, required environment variables, and the language it is written in.
Standalone Node.js or Python Server (Git Integration)
If your Startup page has a Git Repo Address variable, your server can clone directly from GitHub with automatic updates.
Set the Git Repository
Go to Startup and fill in:
- Git Repo Address — The repository URL (e.g.,
https://github.com/username/bot-repo) - Install Branch (Node.js) or Git Branch (Python) — The branch to clone (leave blank for the repo default)
- User Uploaded Files — Set to
0(so the server clones from Git)
Set the Main File
Set the main file variable to match the bot's entry point:
- Node.js server: Set Main File to
index.js(or whatever the README specifies) - Python server: Set App py File to
bot.py(or whatever the README specifies)
Enable Auto Update (Optional)
Set Auto Update to 1 to automatically pull the latest code from GitHub on each restart.
Start the Server
Go to Console and click Start. The server will clone the repository and install dependencies automatically.
Configure the Bot
After the first start, go to Files. Create a .env file or edit the config file as described in the bot's README:
TOKEN=your_bot_token_hereRestart
Click Restart in the Console for the token to take effect.
Updating the Bot
If Auto Update is enabled, the server pulls the latest code on each restart. To manually update, restart the server or disable and re-enable auto update.
Using a Private GitHub Repository
On the Startup page, fill in the Git Username and Git Access Token fields. Create a personal access token with repo scope and use it as the access token.
Discord Bot Server (Manual Upload)
If your Startup page only has a Startup Command variable, you need to download the bot files and upload them manually.
Download the Bot Files
On the bot's GitHub page, click the green Code button and select Download ZIP. Extract the ZIP file on your computer.
Upload to Your Server
Log in to the XGamingServer panel and go to Files. Upload all the extracted bot files.
Install Dependencies
Go to Startup and set the Startup Command to /bin/bash. Start the server, then in the Console install dependencies based on the bot's language:
Node.js bots:
npm installPython bots:
pip3 install -r requirements.txtJava bots: No dependency install needed — just upload the .jar file.
Configure the Bot
Most bots need a token and other settings. Check the bot's README for a .env.example or config.example file. Create the required config file in Files:
- Copy the example config and rename it (e.g.,
.env.example→.env,config.example.json→config.json) - Fill in your bot token and any other required values
See our Manage Bot Token guide for details on setting up tokens.
Set the Startup Command
Go to Startup and change the Startup Command to run the bot:
| Language | Startup Command |
|---|---|
| Node.js | node index.js |
| Python 3 | python3 bot.py |
| Java | java -jar BotName.jar |
| Go | ./bot |
| C# / .NET | mono Bot.exe |
Replace the filename with whatever the bot's README specifies.
Start the Server
Go to Console and click Start. Watch the output to confirm the bot connects to Discord successfully.
Updating the Bot
To update a bot deployed manually:
Download the Latest Release
Go to the bot's GitHub page and download the latest ZIP or release.
Back Up Your Config
Before uploading new files, download your .env, config.json, or any other configuration files you customized.
Upload New Files
Upload the updated bot files to Files, overwriting the old ones.
Restore Your Config
Re-upload your configuration files.
Reinstall Dependencies
If dependencies changed, run the install command again via Console with the startup command set to /bin/bash.
Troubleshooting
- Bot crashes immediately — Check the
Consolefor error messages. Most common cause is a missing or invalid bot token. - "Cannot find module" / "ModuleNotFoundError" — Dependencies were not installed. On the Discord Bot server, set the startup command to
/bin/bashand run the install command. On standalone servers, check that yourpackage.jsonorrequirements.txtis present. - Git clone fails — Verify the repository URL is correct and public. For private repos, use an authenticated URL with a personal access token.
- Server stuck on "Starting" — The panel may not detect startup output. Join our Discord for help adjusting the configuration.
How is this guide?