Standard Node projects
Keep the package.json, lockfile, and start script you already use. A hosting workflow should understand the project instead of forcing a custom bot format.
package.json + lockfile + start command
Node.js runtime
A GitHub-first home for Node.js Discord bots, with the deployment details made visible. BotHoster is currently accepting early-access signups.
Production shape
Good hosting should remove server chores without hiding the files and signals that make a Node deployment understandable.
Keep the package.json, lockfile, and start script you already use. A hosting workflow should understand the project instead of forcing a custom bot format.
package.json + lockfile + start command
Pass the Discord token through an environment variable. The token should never live in a public repository, source file, screenshot, or support message.
process.env.DISCORD_TOKEN
Startup errors, missing packages, rejected promises, and Gateway failures need to be visible in one place when a deployment does not stay online.
stdout + stderr + exit status
Deploy checklist
These steps prevent most first-deployment failures and make later updates much less dramatic.
Add a production script such as "start": "node src/index.js" to package.json and verify it works locally with npm start.
Use process.env.DISCORD_TOKEN (or a clearly named equivalent), add local .env files to .gitignore, and rotate any token that has ever been committed.
Commit package.json and the matching lockfile. Do not commit node_modules; the host should install the declared dependencies during deployment.
Watch the first startup, confirm the Ready event, and test the bot in a private server before announcing the deployment.
Discord-specific
A discord.js process stays connected to Discord's Gateway and subscribes to the events selected by its intents. Enable only the intents the bot uses, and remember that privileged intents must also be enabled in the Discord Developer Portal.
Discord's official guidance says a bot token is highly sensitive and should never be shared or checked into version control. The Discord getting-started guide explains credential handling, while the discord.js project setup guide covers environment variables for Node.js projects.
If a token has entered Git history, deleting the visible line is not enough. Reset the token in the Developer Portal, update the deployment secret, and then clean the history separately if needed.
Questions
Use a Node.js release supported by the discord.js version in your package.json. Declare the expected version with the package.json engines field when possible instead of relying on a host default.
No. Discord treats the bot token as a highly sensitive credential. Store it as a secret or environment variable, and reset it immediately if it enters Git history.
Common causes include a missing start script, an undeclared package, the wrong Node version, case-sensitive import paths, a missing environment variable, or an intent enabled in code but not in the Discord Developer Portal.
Keep reading
Prepare a repository, configure secrets, and verify the first release.
Read more →bothoster.dev/guides/keep-discord-bot-online-24-7Understand restarts, health signals, and failure loops.
Read more →bothoster.dev/securitySee the security principles BotHoster is being built around.
Read more →Next step
Join early access for BotHoster and help shape the GitHub-to-discord.js deployment workflow.