Deploy a Node.js Discord bot
Run your discord.js (or any Node.js) bot 24/7 on NGP Cloud bot hosting.
1. Prepare your project
Your bot folder should have:
package.jsonwith your dependencies listed.- Your entry file, for example
index.js. - A
.envfile for your token (see Environment variables for bots).
2. Pick your Node.js version
- Open your bot on panel.ngpcloud.in and go to Startup.
- Under Docker Image, choose the Node.js version your bot needs. discord.js v14 needs Node.js 18 or newer - pick the newest LTS offered.
3. Upload your files
Use the file manager (zip your project, upload, then Unarchive) or SFTP. package.json must end up in the main folder, not inside a subfolder.
4. Set the main file
On the Startup tab, set the main file variable to your entry file (e.g. index.js or src/index.js).
5. Start it
Click Start. On boot the server runs npm install automatically when it finds package.json, then starts your main file. Watch the console for your bot's "logged in" message.
Deploying from GitHub
If your code is on GitHub, fill in the Git Repo Address variable and enable Auto Update. The server then pulls the latest code on every restart. For a private repository, also set the username and a GitHub personal access token in the matching variables.
Common errors
| Console message | Fix |
|---|---|
Cannot find module 'discord.js' | package.json is missing or in a subfolder - move it to the main folder and restart. |
An invalid token was provided | The token is wrong or was reset - update .env. |
Used disallowed intents | Enable the intents your bot uses (e.g. Message Content) in the Discord Developer Portal → Bot. |
SyntaxError: Cannot use import statement | Add "type": "module" to package.json, or use require. |
Still stuck? Open a ticket on Discord - run /ticket in any channel, pick a department, and include your Server ID or Invoice ID so we can jump straight in.