NodeForge guides
Get your Discord bot online.
A complete walkthrough from creating the Discord bot to uploading code, adding the token, starting the container and checking live logs.
Quick start
From new app to running bot
Create your Discord application
Create an application in the Discord Developer Portal, add a bot user, and keep the bot token private.
Invite the bot to your server
Use Discord's installation/OAuth2 settings to add the bot to a test server with only the permissions it needs.
Create the bot in NodeForge
Open My Bots, choose Node.js or Python, then choose a hosting plan and complete checkout.
Upload your project ZIP
Upload a ZIP containing the bot files. Keep package.json or requirements.txt at the project root where possible.
Add your token securely
Add DISCORD_TOKEN as an environment variable. Never place the token in source code or send it to support.
Choose the startup file
For Node.js choose index.js (or your real entry file). For Python choose bot.py, main.py or your project entry file.
Apply and start
Apply the configuration, start the bot, then open Console to watch dependency installation and startup logs.
Test it in Discord
The example bots respond to !ping. If they do not, check the logs and confirm Message Content Intent is enabled.
Discord
1. Create the Discord bot
- 1Open the official Discord Developer Portal and create an application.
- 2Add a bot user to the application and choose the bot name/avatar you want.
- 3Copy or reset the bot token when needed, then put it straight into NodeForge as
DISCORD_TOKEN. Do not paste the token into your source code. - 4For the downloadable
!pingexamples below, enable Message Content Intent for the bot. - 5Use the app's installation/OAuth2 settings to invite the bot to a test Discord server. Grant only the permissions your bot needs.
NodeForge
2. Create and configure the hosted bot
Create the service
Choose a plan
Upload the ZIP
Add environment variables
DISCORD_TOKEN and any other values your code reads from the environment. Save/apply the configuration after changes.Set the startup file
index.js. Python examples use bot.py. Your own project can use a different entry file.Start the bot
Downloads
3. Ready-to-run example bots
These are intentionally small examples for testing NodeForge. Both read the token fromDISCORD_TOKEN and reply to !ping.
Node.js example
discord.js • startup: index.js
const { Client, GatewayIntentBits } = require("discord.js");
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
],
});
client.on("messageCreate", async (message) => {
if (message.author.bot) return;
if (message.content === "!ping") {
await message.reply(`Pong! ${client.ws.ping}ms`);
}
});
client.login(process.env.DISCORD_TOKEN);Python example
discord.py • startup: bot.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.command()
async def ping(ctx):
await ctx.send(f"Pong! {round(bot.latency * 1000)}ms")
bot.run(os.environ["DISCORD_TOKEN"])DISCORD_TOKEN, select the startup file, Apply, Start, then type !ping in your Discord server.Project files
4. ZIP layout and startup files
Recommended Node.js ZIP
index.js
package.json
src/
commands.jsSet Startup File to index.js. NodeForge installs production dependencies from package.json before launching it.
Recommended Python ZIP
bot.py
requirements.txt
cogs/
moderation.pySet Startup File to bot.py. NodeForge installs packages from requirements.txt before launching it.
Secrets
5. Environment variables
Environment variables let your bot read secrets and configuration without storing them inside the uploaded source files.
DISCORD_TOKENDATABASE_URLAPI_KEYNODE_ENVDo not upload a .env file. Store secrets in NodeForge's Environment Variables panel instead.
Runtime
6. Read the Console
The Console is the first place to look when a bot does not start. A successful Node.js example normally looks similar to:
[nodeforge] Node.js container ready
[nodeforge] Installing production dependencies
[nodeforge] Starting index.js
[example] Logged in as ExampleBot#0000
[example] Type !ping in a server channel.Python shows similar NodeForge startup messages followed by the output from bot.py.
Troubleshooting
Common problems
DISCORD_TOKEN is missing+
Add DISCORD_TOKEN in the bot's Environment Variables section, then Apply the configuration again.
Startup file not found+
Check the file browser and make sure Startup File exactly matches the uploaded file path, such as index.js or bot.py.
Cannot find module / dependency+
For Node.js, confirm package.json lists the dependency. For Python, confirm requirements.txt contains it.
Bot logs in but !ping does nothing+
Enable Message Content Intent for the Discord bot and make sure it can view/send messages in the test channel.
Bot immediately exits+
Open Console and read the first error after the NodeForge startup messages. Most startup problems are visible there.
Payment active but bot will not start+
Confirm the bot is provisioned, the startup file exists, environment variables are set, and the account/bot is not suspended.
Still stuck?
Include the bot name and the relevant Console error when contacting support. Never send your password or Discord bot token by email.