Skip to main content
Your bot works on your PC, but it goes offline when you close the terminal or shut down the computer. This guide moves the bot to Hyze Cloud, where it runs without depending on your machine. It covers bots built with discord.js (Node.js) and discord.py (Python).
A Discord bot does not need a port or a website. Hyze recognizes discord.js and discord.py from your dependencies and considers the bot live once the process stays up.

Before you start

  • The bot already starts on your computer with a single command, such as node index.js or python bot.py.
  • You have the bot token. It lives in the Discord Developer Portal, under Bot → Reset Token.
  • You have a Hyze Cloud account. Every sign-up gets a 7-day trial.

1. Prepare your code

Hyze reads your dependency manifest to find the runtime and the command that starts the bot. Lay out your files like this:
package.json
index.js
  • With a start script, Hyze starts the bot with npm run start.
  • Without it, Hyze looks for an entry file such as index.js, main.js or bot.js.
  • Every library the bot imports must be listed in dependencies (or devDependencies).
  • Include package-lock.json. It makes the installed versions match your PC.
Using Bun? Include bun.lock. Hyze picks the Bun runtime, which runs .ts files directly. The Node.js runtime does not run TypeScript: compile first or use Bun.

2. Keep the token out of your code

The token is the bot’s password. Whoever has it controls the bot. So it never goes in your code or your repository: the bot reads it from the DISCORD_TOKEN environment variable. To test on your PC, create a .env file and add it to .gitignore:
.env
On Hyze, you add DISCORD_TOKEN to the app’s Environment variables (step 3). The .env file does not need to be uploaded.
If the token has ever been pushed to GitHub or pasted in a chat, generate a new one under Bot → Reset Token. The old token stops working immediately.

3. Deploy from GitHub or a ZIP

1

Create the app

In the dashboard, click New project and choose Import from GitHub or ZIP file.
  • GitHub: connect your account and pick the repository and branch. With Automatic deployment on, every push publishes a new version.
  • ZIP: files go at the root of the ZIP, not inside a folder. Leave out node_modules, .venv and .env.
2

Check the configuration

  • Memory: 256 MB is the minimum per app and is usually enough for a small bot.
  • Public access: leave it off. A bot does not serve HTTP.
  • Start command: leave it on Automatic. Use Custom only if the bot starts with a different command, such as node src/index.js.
  • Automatic restart: on by default. Keep it that way.
3

Add the token

Under Environment variables, add the DISCORD_TOKEN key with the bot token. If you already have a .env file, use Import .env.
4

Deploy

Click Deploy application. Hyze installs the dependencies, starts the bot and watches the process.
Prefer automation? The same deploy works through the API. See Deploy an app and Deploy from GitHub.

4. Check the logs

Open the app and go to Observability → Console. Logs stream in real time, just like your PC’s terminal. Look for the Online as ... line: once it shows up, the bot is connected to Discord. If the deploy failed before the bot started, the reason is in the Deployments tab, under Logs for that deploy.
Stop the copy of the bot on your PC. With the same token running in two places, the bot may answer every command twice.

5. What happens when the bot crashes

With Automatic restart on:
  • The process died from an error: Hyze restarts the bot on its own.
  • The machine rebooted: the bot comes back when the machine is up again.
  • The bot died more than 3 times in 10 minutes: Hyze turns the app off and sends you a notification. Restarting in a loop does not fix anything: read the error in the Console, fix it and deploy again.
  • The bot went over its memory limit: Hyze stops the app, without a restart loop, and lets you know. Raise the Memory in Settings and start the app again.
In discord.js, a rejected promise with no catch takes down the whole process. Register a handler so the error goes to the log without taking the bot with it:
index.js
In discord.py, an error inside an event already goes to the log without taking the bot down. Seeing an error with a strange name in the log? Common errors when hosting a Discord bot covers the cause and fix for the most frequent ones.

Pricing

Every sign-up gets a 7-day trial. To keep the bot online after that, the Starter plan costs R$ 5.99 per month, paid in Brazilian reais via Pix. Plan memory is shared across your apps, so several small bots fit in the same plan.

Put your bot online

Open the dashboard

Create the app, add DISCORD_TOKEN and run your first deploy.

Bot stops when I close the terminal

Why it happens and how the options compare.
Last modified on October 18, 2026