NodeForge.host

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

01

Create your Discord application

Create an application in the Discord Developer Portal, add a bot user, and keep the bot token private.

02

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.

03

Create the bot in NodeForge

Open My Bots, choose Node.js or Python, then choose a hosting plan and complete checkout.

04

Upload your project ZIP

Upload a ZIP containing the bot files. Keep package.json or requirements.txt at the project root where possible.

05

Add your token securely

Add DISCORD_TOKEN as an environment variable. Never place the token in source code or send it to support.

06

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.

07

Apply and start

Apply the configuration, start the bot, then open Console to watch dependency installation and startup logs.

08

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

  1. 1
    Open the official Discord Developer Portal and create an application.
  2. 2
    Add a bot user to the application and choose the bot name/avatar you want.
  3. 3
    Copy 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.
  4. 4
    For the downloadable !ping examples below, enable Message Content Intent for the bot.
  5. 5
    Use the app's installation/OAuth2 settings to invite the bot to a test Discord server. Grant only the permissions your bot needs.
Treat a Discord bot token like a password. If it is exposed, reset it in Discord and update the NodeForge environment variable.

NodeForge

2. Create and configure the hosted bot

Create the service

In My Bots, click Create bot, give it a name and choose Node.js or Python.

Choose a plan

Open Billing for the bot and choose Starter, Forge or Pro. New paid services must have an active subscription before normal runtime actions are available.

Upload the ZIP

Upload your project ZIP. NodeForge extracts it into the bot's project storage and shows the uploaded files in the file panel.

Add environment variables

Add DISCORD_TOKEN and any other values your code reads from the environment. Save/apply the configuration after changes.

Set the startup file

Node.js examples use index.js. Python examples use bot.py. Your own project can use a different entry file.

Start the bot

Apply the configuration, click Start, then watch the Console. A healthy example prints that it logged into Discord successfully.

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

Download ZIP
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

Download ZIP
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"])
Fastest test: download one ZIP, create a matching runtime in NodeForge, upload it, add 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.js

Set Startup File to index.js. NodeForge installs production dependencies from package.json before launching it.

Recommended Python ZIP

bot.py
requirements.txt
cogs/
  moderation.py

Set Startup File to bot.py. NodeForge installs packages from requirements.txt before launching it.

Tip: put the project files at the root of the ZIP rather than wrapping everything in an extra folder. That keeps startup paths simple.

Secrets

5. Environment variables

Environment variables let your bot read secrets and configuration without storing them inside the uploaded source files.

NameUse
DISCORD_TOKEN
Required by the example bots. Paste the Discord bot token as the value.
DATABASE_URL
Only if your own bot connects to an external database.
API_KEY
Typical name for third-party APIs. Use the exact variable name your code expects.
NODE_ENV
Optional application setting; usually not needed for the examples.

Do 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.