Ready to play?
Pick your game, choose a plan, and start playing in under 60 seconds. No lag, no excuses.
Woof! Let's go!

Your bot works perfectly, right up until you close your laptop. To host a Discord bot 24/7, it has to run on a machine that never sleeps, with your code, its packages and its token in place. This guide walks through the whole setup for Node.js (discord.js) and Python (discord.py), from creating the bot to keeping it online for good.
bot and applications.commands scopes..env file, never in your code or a public repo.A Discord bot is a program that keeps a connection open to Discord. When the program stops, the bot goes offline. That happens when your PC sleeps, restarts for an update or drops its Wi-Fi, and it happens on free hosting tiers that pause apps after a stretch of inactivity. If you want slash commands answered at 3 a.m. and moderation running while you sleep, the bot needs a home that stays on.
package.json for Node.js or requirements.txt for Python.bot and applications.commands, pick the permissions your bot needs, then open the generated link to add the bot to your server.On BruceNode you choose Node.js or Python at checkout, and the server comes ready for that runtime.
Plans start at $1 a month, and you can upgrade your plan from the dashboard any time your bot grows.
discord.js v14 needs Node.js 18 or newer, and discord.py 2.x needs Python 3.8 or newer. If your project needs a specific version, pick it from the Docker Image list on the Startup tab of the game panel.
There are two ways to get your bot onto the server.
Upload the files. Open your server in the game panel, go to Files and upload your project. For big projects, connect with SFTP using the details on the Settings tab. Skip node_modules and any Python virtual environment: the server installs packages itself.
Deploy from Git. If your bot lives on GitHub or GitLab:
git pull every time it starts, so shipping an update is: push, then restart.On the Startup tab:
index.js or dist/index.js. If there's a package.json, the server runs npm install on every start, so new dependencies install themselves. For TypeScript, the simplest route is to build to JavaScript and point Main file at the built file. Deploying from Git? Commit the built folder, or add a prepare script so npm install builds it.bot.py. If there's a requirements.txt, the server installs it on every start. Make sure it lists discord.py.Need one extra package without editing your project? The Startup tab has an Additional Node packages or Additional Python packages field.
Never paste the token into a file you commit. Put it in a .env file instead:
DISCORD_TOKEN=your-token-here
Then load it in your code with dotenv for Node.js or python-dotenv for Python, and add .env to your .gitignore. Upload the .env file through the Files tab. A Git pull never touches it, so your token stays put between deploys.
If a token ever leaks, reset it in the Developer Portal right away and update your .env.
Hit Start on the Console tab and watch the first few lines. The usual suspects:
TokenInvalid or Improper token has been passed: the token is wrong or was reset. Copy a fresh one.Used disallowed intents or PrivilegedIntentsRequired: your code asks for an intent that isn't switched on in the Developer Portal.Cannot find module or ModuleNotFoundError: a package is missing from package.json or requirements.txt.GatewayIntentBits.MessageContent or intents.message_content = True), not just in the portal.Once the console shows your bot logged in, it's online and stays online, no laptop required.
Hosting a Discord bot 24/7 takes three things: a token kept safe, code that installs its own packages, and a server that never sleeps. Set it up once and your bot answers commands around the clock. Discord bot hosting on BruceNode starts at $1 a month with Node.js or Python ready to go, and code BRUCE20 takes 20% off your first month.
Related posts on BruceNode: