discord.js Hosting — Deploy a Node.js Bot from GitHub (2026)

Bernis·

discord.js bots are the easiest kind to host badly — node index.js in a terminal works until the terminal closes. Here’s the production setup: a repo that deploys cleanly, and hosting that keeps it online and redeploys when you push.

Make the repo deployable

package.json is the contract. The host needs to know how to install and start your bot:

{
  "main": "index.js",
  "scripts": { "start": "node index.js" },
  "engines": { "node": ">=20" },
  "dependencies": { "discord.js": "^14.16.0" }
}

Three rules: a real start script (that’s what gets run), an engines.node field (discord.js v14 needs Node 18+; declare it instead of hoping), and committed package-lock.json so installs are reproducible.

Token from the environment:

const { Client, GatewayIntentBits } = require("discord.js");
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
client.login(process.env.DISCORD_TOKEN);

Request only the intents you use — MessageContent needs the Developer-Portal toggle too, and the gateway rejects logins that ask for privileged intents without it.

Slash commands: register once, not on every boot

The classic mistake is calling REST.put(Routes.applicationCommands(...)) on startup. It works — until Discord rate-limits your deploys because every restart re-registers everything. Keep a separate deploy-commands.js you run when commands change, not when the bot boots. Your host restarts your bot more often than you think (crashes, redeploys, node maintenance); boot should be side-effect free.

Hosting it on FadeHost

  1. Bots panel → Connect GitHub (one-click App) → choose the repo. Node.js is detected from package.json.
  2. Set DISCORD_TOKEN and any other secrets as environment variables.
  3. Deploy — clone, npm install, npm start, in an isolated sandbox with a live console.
  4. From then on, every push to your default branch redeploys automatically. Crash? Auto-restart, plus an AI crash doctor that reads the stack trace and names the fix (nine times out of ten it’s a bad token or a missing intent).

First bot free (256MB — a typical discord.js v14 bot idles around 80–150MB). Music bots are the exception: audio transcoding wants real headroom, so give one the Pro tier (4GB + 3 vCPU, $6/mo) rather than fighting OOM restarts on a small container. Bots that store data (economy, leveling, tickets) get a managed MySQL/Postgres/Redis one click away on a private network.

The checklist

  • start script + engines.node + lockfile committed
  • Token and API keys in env vars, .env in .gitignore
  • Slash-command registration out of the boot path
  • Intents match the Developer Portal toggles
  • Host restarts on crash and reboot — comparison of your options here

Also see: free bot hosting, honestly explained · running discord.py instead?