Home › Guides › Discord bot hosting

How to host a Discord bot, online 24/7

Your bot works, but only while your computer is on. In this guide you move it to a server that runs day and night, with discord.js or discord.py, and with your token safely out of your code.

By Waseem Idoe · Updated 25 October 2026

Why your bot shouldn't run on your own PC

As long as your bot runs on your own computer, it goes offline when your PC shuts down, goes to sleep or your internet drops for a moment. For a server with members that's annoying: commands stop working, moderation stops and welcome messages don't arrive. A host keeps your bot online 24/7 and restarts it if it crashes.

On the Pro plan of Zeno hosting (€10 a month) you run Node.js and Python bots with 1 GB of memory. The platform recognises a Discord bot by itself: a bot doesn't need a web page, so it's started as a background process and kept an eye on.

Step 1: take the token out of your code

Your bot token is your bot's password. Never put it in your code and never on GitHub: whoever has the token has your bot. Read it from an environment variable instead.

discord.js (JavaScript)

const { Client, GatewayIntentBits } = require("discord.js");
const client = new Client({ intents: [GatewayIntentBits.Guilds] });

client.once("ready", () => console.log(`Online as ${client.user.tag}`));
client.login(process.env.DISCORD_TOKEN);

discord.py (Python)

import os
import discord

client = discord.Client(intents=discord.Intents.default())

@client.event
async def on_ready():
    print(f"Online as {client.user}")

client.run(os.environ["DISCORD_TOKEN"])

Using a .env file locally is fine. The Zeno CLI never uploads .env.

Step 2: check your project files

The platform installs and starts your bot automatically if your project looks like this:

discord.jsdiscord.py
Dependenciespackage.json with discord.jsrequirements.txt with discord.py
Installnpm install (or pnpm/yarn, based on your lockfile)pip install -r requirements.txt
Startthe start script, otherwise index.js, server.js, app.js or main.jsmain.py, app.py, server.py or bot.py

Is your project different? Then set your own Start command in your project's settings.

Step 3: create a server project

Log in to the dashboard, click New project and choose Server. Add your code by uploading it or connecting a GitHub repository. Prefer the terminal? Go to your bot's folder and type:

zeno login
zeno --prod

The CLI asks whether it's a website or a server. Choose server.

Step 4: set your token as an environment variable

Open your project's settings and under Environment variables add a variable named DISCORD_TOKEN with your token as its value. You'll find your token in the Discord Developer Portal, under your application at Bot. Got more secrets, like an API key for AI? Add them the same way.

Step 5: deploy

Click Deploy. You'll see live how the dependencies are installed and the bot is started. When Online as … appears in the logs, your bot is live. From now on it:

Storing data

Does your bot store data, such as warnings, levels or settings per server? Put it in the data folder the platform gives you through the environment variable ZENODEV_DATA_DIR, for example a SQLite database or a JSON file. That folder is kept when you deploy a new version; files anywhere else are not.

Troubleshooting

Rather have a bot built?

Don't have a bot yet, or want one with AI, moderation and its own dashboard? Zeno Innovations builds them to order too, just like our own bot JARVIS. Have a look at Discord bot development.

Frequently asked questions

Can I host a Discord bot for free?

The free Hobby plan at Zeno is for websites. For bots and other servers that keep running you need Pro, for €10 a month and cancellable monthly.

Does this work with languages other than JavaScript and Python?

Yes, as long as you can give a command that starts your bot and keeps it running. Set it as the Start command in your project's settings.

Is my token safe?

Your token is stored as an environment variable in your project, not in your code. User code runs isolated in its own container, separate from other projects.

How many bots can I run?

On Pro you run several servers at once, each with 1 GB of memory. That's plenty for most bots.