Guide
Host a discord.js (Node.js) bot
Node.js 22 with your package.json, online 24/7.
- Upload your .js files with package.json (a .zip of the project is easiest). Leave out node_modules: we install packages fresh on every Deploy.
- The start file is the main in package.json, or index.js / bot.js. Press Use as start next to another file to change it.
- No package.json? We read the
requireandimportlines in your code and install those packages. Add a package-lock.json to pin exact versions. - Add DISCORD_TOKEN in Secrets and read it with
process.env.DISCORD_TOKEN. Do not upload a .env file with the token. - Press Deploy. Your bot runs as a non-root user on Node.js 22, ES modules (.mjs or "type": "module") included.
discord.js bots in a few servers fit in 256 MB; music bots and big bots are happier on Pro or Ultra.
Still stuck? Log in and ask support, or check the service status. New here? See bot hosting plans from $0.70 a month.
More Discord bot guides
Host a Discord bot 24/7 (Python, Node.js or Java)From a bot on your computer to a bot that never goes offline.Host a Java bot (JDA or Discord4J)Upload a runnable .jar, we run it on Java 21.Keep your Discord bot token safeNever put the token in your code; use an encrypted secret.Upload a multi-file bot (cogs, folders)Projects with cogs, config files and folders work as they are.My Discord bot is offline or keeps crashingRead the reason, fix it, deploy again.Host a music or voice botFFmpeg and Opus are added for you.