Get your Discord bot online in five steps
Follow this sequence to deploy safely: create an account, provision a bot, enable maintenance mode, upload via SFTP, then go live.
Deploying a Discord bot for the first time can feel overwhelming, especially if you have never worked with remote servers or file transfer tools before. This guide walks you through every stage of the process in detail, from initial account creation through to verifying that your bot is running correctly in production. Whether you are building a simple moderation bot or a complex application with database integrations, the deployment workflow remains the same. By following these five steps carefully, you will avoid the most common mistakes that cause bots to crash or fail to start after upload.
What you will need
- Discord bot token from the Developer Portal
- Bot source code (Node.js or Python)
- SFTP client (FileZilla, WinSCP, or Cyberduck)
- Start command (npm start, node index.js, or python main.py)
Before you start
Taking a few minutes to prepare before you begin the deployment process will save you significant time and frustration later. Many first-time users skip straight to uploading files and then spend hours debugging issues that could have been prevented with a brief pre-flight check. The items below represent the most critical things to verify before you touch the hosting panel.
Your Discord bot token is the single most important credential in this process. You can obtain it from the Discord Developer Portal by selecting your application, navigating to the Bot section, and clicking Reset Token or Copy. Make sure you have enabled the correct Gateway Intents for your bot. If your bot reads message content, you must explicitly enable the Message Content intent in the Developer Portal, otherwise your bot will connect successfully but fail to respond to any messages. This is one of the most frequently reported issues among new bot developers.
- Confirm your Discord bot token works and required intents are enabled.
- Ensure your entry file name matches your start command.
- Keep secrets out of code. Plan to use environment variables or a .env file.
- Install an SFTP client. We recommend FileZilla or WinSCP.
Always enable maintenance mode before uploading files, editing code, or installing packages. Do not turn it off until every task is finished. Maintenance mode exists to prevent your bot process from interfering with file uploads or package installations. If the bot is running while you overwrite its files, you may encounter corrupted modules, incomplete writes, or permission errors that are difficult to diagnose after the fact.
Deploy your bot safely
The deployment process is divided into five sequential steps. It is important to complete them in order, as each step depends on the previous one being finished correctly. Skipping ahead or performing steps out of sequence is the most common reason deployments fail for new users. Read through all five steps before you begin so you understand the full workflow.
Create your free account
Register at dash.monkey-network.xyz, verify email, and sign in.
Account creation takes less than a minute. Navigate to the dashboard URL, fill in your email address and a secure password, and submit the registration form. You will receive a verification email shortly after. Check your spam folder if it does not appear within a few minutes. Once verified, sign in to access the control panel where you will manage all of your bot instances.
Create a bot instance
Select Node.js, Nodemon, or Python. Each bot gets 1GB RAM, 1GB storage, and 150% CPU.
When creating a bot instance, choose the runtime that matches your bot's programming language. Node.js is the correct choice for JavaScript bots using libraries such as discord.js or Eris. Python is the correct choice for bots written with discord.py, Pycord, or similar Python libraries. The Nodemon option is useful during development because it automatically restarts your bot when file changes are detected, but most users should use the standard Node.js option for production deployments. Each bot instance is allocated dedicated resources, so your bot will not compete with other users for memory or processing power.
Enable maintenance mode
Turn it on before touching files. This pauses the bot and prevents conflicts.
Maintenance mode is a toggle available on your bot's management page in the dashboard. When enabled, it gracefully stops the bot process and locks the container so that file operations can proceed without interference. This is not optional. Uploading files while your bot is running can lead to partial file writes and corrupted dependencies. Always confirm that the panel shows maintenance mode as active before proceeding to the next step.
Upload and install via SFTP
Upload code with SFTP, set environment variables, then install dependencies in the console.
This is the most involved step. Connect to your bot's container using an SFTP client with the credentials shown in the dashboard. Upload all of your bot's source files into the /home/container/ directory. After uploading, switch to the console tab in the dashboard and run the appropriate install command for your runtime. For Node.js bots, run npm install to install packages listed in your package.json. For Python bots, run pip install -r requirements.txt to install your dependencies. Do not close the console until the installation completes successfully.
End maintenance and start
When files and installs are done, end maintenance, start the bot, and watch the logs.
Once you have confirmed that all files are uploaded and all dependencies are installed, disable maintenance mode using the toggle in the dashboard. Then click the Start button to launch your bot. Immediately switch to the console or log view to watch the output. A healthy bot will print a login confirmation message within a few seconds. If you see errors instead, re-enable maintenance mode before making any changes, then review the troubleshooting section below for guidance.
Quick checklist before going live
- All files uploaded to /home/container/ via SFTP
- Dependencies installed (npm install or pip install -r requirements.txt)
- Environment variables set (tokens, prefixes, API keys)
- Start command matches your entry file
- Logs are clean after a test start
Connect with SFTP
SFTP (Secure File Transfer Protocol) is the reliable way to upload your bot files.
SFTP works similarly to FTP but encrypts all data in transit, including your credentials and file contents. This means your bot's source code and any sensitive configuration files are protected during upload. Unlike web-based file managers, SFTP clients give you full control over file permissions, allow you to transfer entire directory structures at once, and provide reliable resume capabilities for large uploads. If you have never used an SFTP client before, FileZilla is the most beginner-friendly option and is available for Windows, macOS, and Linux at no cost.
- Find credentialsOpen your bot in the panel and copy Host, Port (usually 2022), Username, and Password.
- Open your SFTP clientEnter the credentials and connect. Accept the host key if prompted.
- Upload filesPlace files inside
/home/container/. Keep structure tidy. Do not upload node_modules. - Verify uploadConfirm entry files exist (for example, index.js or main.py) before leaving maintenance mode.
FileZilla (Win/Mac/Linux), WinSCP (Windows), Cyberduck (Win/Mac).
Environment variables
Set tokens and secrets in the panel or upload a .env file via SFTP.
Environment variables are the standard way to store sensitive values such as bot tokens, API keys, and database connection strings without embedding them directly in your source code. This practice is important for security because it means your credentials are not visible to anyone who can see your code. On MonkeyBytes, you can set environment variables either through the panel interface or by uploading a .env file to the root of your container directory. If you use a .env file, make sure your bot's code loads it using the appropriate library, such as the dotenv package for Node.js or python-dotenv for Python.
- Example keys: DISCORD_TOKEN, PREFIX, DATABASE_URL
- Keep .env out of git if you use version control
- Never hard-code secrets inside your code
Entry points for your bot
The start command tells the hosting platform exactly how to launch your bot. It must point to the correct entry file in the correct location. If your start command references a file that does not exist or uses the wrong runtime, your bot will fail to start immediately. Double-check that the filename in your start command matches the actual filename you uploaded, including capitalisation. On Linux-based hosting environments, file names are case-sensitive, so index.js and Index.js are treated as two different files.
Node.js
- Place your entry file (for example, index.js) in /home/container/
- Set start command to
npm startornode index.js - Add scripts to package.json for clarity
Python
- Place main file (for example, main.py) in /home/container/
- Set start command to
python main.py - Include requirements.txt and install in console
Keep maintenance mode on while you:
- Upload or replace files via SFTP
- Edit configs or .env values
- Run npm or pip installs
Only disable it after uploads and installs finish and you are ready to start the bot.
Starter bots
Discord.js (Node.js)
// index.js
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent
]
});
client.once('ready', () => {
console.log(`Logged in as ${client.user.tag}`);
});
client.on('messageCreate', (message) => {
if (message.content === '!ping') {
message.reply('Pong!');
}
});
client.login(process.env.DISCORD_TOKEN);
package.json
{
"name": "my-discord-bot",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"dependencies": {
"discord.js": "^14.14.1"
}
}
Discord.py (Python)
# main.py
import os
import discord
from discord.ext import commands
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.event
async def on_ready():
print(f'{bot.user} is online')
@bot.command()
async def ping(ctx):
await ctx.send('Pong!')
bot.run(os.getenv('DISCORD_TOKEN'))
requirements.txt
discord.py==2.3.2
Common issues
Bot crashes on start
- Check logs for stack traces
- Confirm DISCORD_TOKEN is set and valid
- Install dependencies (npm install or pip install -r requirements.txt)
- Verify the entry file name matches your start command
SFTP connection refused
- Use the provided port (often 2022, not 22)
- Check host and username from the panel
- Try another client if needed
Dependencies not found
- Run installs in the console after uploading files
- Ensure package.json or requirements.txt lists the packages
- Run inside maintenance mode to avoid conflicts
Bot offline but panel says running
- Check intents in the Discord Developer Portal
- Confirm the bot is invited to your server
- Watch logs for authentication or connection errors
Email monkeybyteshosting@gmail.com or check back soon for our Discord community.
Preparing your bot for deployment
Before uploading your bot to MonkeyBytes, it is worth taking some time to ensure your project is structured correctly and that all necessary files are included. A well-organised project is significantly easier to deploy and maintain over time, and it reduces the likelihood of encountering errors during the upload and installation process.
Your project should have a clear entry point file at the root level of your project directory. For Node.js bots, this is typically index.js, bot.js, or app.js. For Python bots, main.py or bot.py are the most common conventions. Alongside this entry file, you need a dependency manifest: package.json for Node.js or requirements.txt for Python. These files tell the package manager exactly which libraries to install and at which versions, ensuring that your bot runs with the same dependencies on the server as it does on your local machine.
If your bot uses additional configuration files, such as a config.json for storing non-sensitive settings like command prefixes or feature flags, make sure these are included in your upload. However, you should never include files that contain secrets such as bot tokens or database passwords in your upload if you are copying from a version-controlled repository. Instead, use environment variables or a .env file as described in the SFTP section above.
For Node.js projects, do not upload the node_modules directory. This folder contains all of your installed dependencies and can be extremely large, often containing thousands of files. Uploading it is slow and unnecessary because you will run npm install on the server, which will recreate the entire node_modules directory from your package.json. Similarly, Python users should not upload virtual environment directories such as venv or .venv. Only upload your source code, your requirements.txt, and any configuration or data files your bot needs.
It is also good practice to test your bot locally before deploying. Run your bot on your own computer first and verify that it connects to Discord, responds to commands, and handles errors gracefully. If your bot does not work locally, it will not work on the server either. Local testing lets you catch issues such as missing dependencies, syntax errors, or incorrect token configuration before you begin the deployment process.
Troubleshooting common deployment issues
Even with careful preparation, you may encounter issues during deployment. This section covers the most common problems that users face when deploying their bots for the first time and provides clear guidance on how to resolve each one.
One of the most frequent issues is the "module not found" error, which appears when your bot tries to import a library that has not been installed on the server. This usually means you forgot to run npm install or pip install -r requirements.txt after uploading your files. It can also occur if your dependency manifest is incomplete. If you added a new library to your project locally but did not update your package.json or requirements.txt, the server will not know to install it. Always verify that every library your bot uses is listed in the appropriate manifest file before uploading.
Token-related errors are another common cause of deployment failures. If your bot logs an error related to authentication, an invalid token, or a disallowed intent, start by verifying that your DISCORD_TOKEN environment variable is set correctly in the panel. Tokens can become invalid if you regenerate them in the Discord Developer Portal after setting them on the server. If you recently reset your token, you must update the value on the server as well. Additionally, ensure that all required Gateway Intents are enabled in the Developer Portal, particularly the Message Content intent if your bot reads message text.
File path errors occur when your bot's code references files using paths that do not match the server's directory structure. On MonkeyBytes, your files are stored in /home/container/, and this is the working directory when your bot starts. If your code uses absolute paths that reference locations on your local machine, such as C:\Users\YourName\bot\data.json, those paths will not exist on the server. Use relative paths instead, such as ./data.json, which will resolve correctly regardless of where the project is hosted.
If your bot starts but immediately stops or enters a restart loop, check the console logs for the specific error message. Common causes include syntax errors in your code that were not caught locally, missing environment variables that your bot expects but cannot find, or port conflicts if your bot attempts to open a web server on a port that is not available. Read the error message carefully, as it will almost always indicate the exact file and line number where the problem occurred.
Permission errors during package installation can sometimes occur if files were uploaded with incorrect permissions or if a previous failed installation left behind lock files. If you encounter this, try deleting the node_modules folder or any __pycache__ directories via SFTP, then run the installation command again from the console. Make sure maintenance mode is enabled while you do this to prevent any conflicts with a running process.
Go from zero to online in minutes
Follow the five steps, keep maintenance mode on during changes, and your bot will be online quickly.
Fast recap
- Create account and bot slot
- Enable maintenance mode
- Upload via SFTP
- Install packages
- End maintenance and start