ESN SYSTEMS

Initializing ESN

NETWORKARCADESMPTOOLS
LOADING THE SITE
ESN // 2026
BUILD • PLAY • CREATE
SITE TOOLS
FROST SIGNALCold-season network lighting active.
NEWWebsite updateSee what changed →
Discord Bot Guide

How to host a Discord bot 24/7 (cheaply)

Compare your own PC, free tiers, a VPS and bot hosting, then put a Discord bot online 24/7 on ESN step by step, with your token kept safe.

ESDISCOVERBUILD • PLAY • CREATE
01

What "online 24/7" really means

A Discord bot is a program that keeps a live connection open to Discord (the gateway). Your bot shows as online only while that program is running on a computer that is switched on and connected to the internet. Close the laptop, let the PC go to sleep, or lose Wi-Fi, and the bot goes offline with it. So hosting a bot 24/7 is really one question: which computer will run your code all day, every day, and restart it when something goes wrong? There are four common answers, and each one trades money against effort.

02

Option 1: your own PC or a Raspberry Pi

Running the bot on your own machine costs nothing extra and is the best place to build and test it. Bots connect out to Discord, so you do not need to open ports or forward anything on your router. The catch is that the machine must stay on and awake, and the bot drops whenever your power, internet or Windows updates do. A Raspberry Pi or an old laptop left plugged in works for a small bot, but you still handle restarts, updates and backups yourself, and the electricity is not free either.

03

Option 2: free tiers on cloud platforms

Several platforms offer a free plan, and they are fine for experiments. Before you rely on one for a public bot, read its current limits, because free plans commonly put apps to sleep when idle, cap the hours you can run each month, ask for a card, or change their terms. Tricks that ping a sleeping app to keep it awake usually break the platform rules and still leave gaps. Many free plans also share IP addresses between lots of apps, which can lead to Discord rate limits that are not your fault.

04

Option 3: a VPS

A virtual private server is a Linux machine you rent and fully control. It can run several bots, a database and a website at once, and you can install anything. In exchange you are the system administrator: you secure SSH, apply updates, configure a firewall, set up a process manager such as systemd or pm2 so the bot restarts after a crash or reboot, and arrange your own backups. If you want to learn Linux, a VPS is a great teacher. If you just want the bot online, it is more work than you need.

05

Option 4: dedicated bot hosting

Bot hosting gives you a ready-made container for one bot with a web panel. You upload your files, choose which file starts the bot, and press Start. The host installs your packages when the server starts, shows a live console, and keeps the machine running and backed up. You give up root access, but you skip the server admin work. ESN Hosting is built for exactly this: Python, Node.js and Java bot servers, set up automatically after checkout, with plans from $0.50/month.

06

How much power does a bot need?

Most small bots that answer slash commands in a handful of servers use very little memory and CPU. What makes a bot hungrier is caching lots of members and messages, playing music, joining many large servers, or keeping a big database in memory. Start with a small plan, run the bot for a day with real users, then look at the memory graph on the console page. If it sits close to the limit, move up a plan. The ESN docs have a longer guide on how much RAM a Discord bot needs.

07

Step 1: get a bot server on ESN

Go to panel.esnoffical.com, sign in (or create an account), and open Buy a server. Choose a Discord bot type that matches your language: Python, Node.js or Java. Pick a plan and pay on Stripe. The server is created automatically and appears on your dashboard within moments. If your bot is not written yet, the ESN docs walk through creating an application in the Discord Developer Portal, adding a bot user, and inviting it to your server with the right scopes and permissions.

08

Step 2: upload your code

Open the server and go to Files. Upload your files, or upload a single .zip and use Unarchive from its menu. Make sure your main file sits in the top folder rather than inside a folder from the zip. Do not upload node_modules, venv, __pycache__ or .git: they are large, and the server installs packages itself. If you prefer a desktop app such as FileZilla or WinSCP, you can use SFTP with your panel login instead of the browser.

09

Step 3: set the start file and packages

Open Startup and check the variable that says which file runs: Main Python File (main.py by default) for Python, Main JavaScript File (index.js) for Node.js, or JAR FILE for Java. File names are case sensitive, so Bot.py and bot.py are different. For Python, list your libraries in requirements.txt; for Node.js, upload package.json (and package-lock.json). Both are installed every time the server starts. For Java, upload one jar that already includes its libraries.

10

Step 4: keep your token secret

Your bot token is a password for your bot. Anyone who has it can log in as your bot, so never paste it into your code, a screenshot, a support ticket or a public repository. On ESN, create a file named .env in the top folder with one line, DISCORD_TOKEN= followed by your token, then read it in code with python-dotenv (Python) or dotenv (Node.js). Add .env to your .gitignore so it never reaches GitHub. If a token leaks, open the Developer Portal, go to Bot and choose Reset Token straight away, then update .env.

11

Step 5: start it and read the console

Press Start on the Console page. You will see packages install, then whatever your bot prints when it connects; a line such as "Logged in as YourBot" is a good sign. If it stops instead, read the last red lines. "Improper token" means the token in .env is wrong or was reset. An error about privileged intents means you must switch on the matching intent (Message Content, Server Members or Presence) under Bot in the Developer Portal, or remove it from your code.

12

Keeping the bot online for months

Good hosting keeps the machine up; your code keeps the bot up. Catch errors inside command handlers so one bad command cannot crash everything, and in Node.js handle rejected promises. discord.py and discord.js reconnect to the gateway on their own after short network drops, so you rarely need your own reconnect loop. Respect rate limits rather than sending messages in tight loops. Use the panel Schedules page for a nightly restart if your bot slowly uses more memory, and take a backup before every big update.

13

Quick checklist

Pick hosting that matches how much admin work you want. Keep the token in .env, out of your code and out of Git. Set the right start file and list your packages. Watch the console on the first start and fix intent or token errors. Check memory after a day and size up only if you need to. Back up before changes. When you are ready, ESN bot hosting starts from $0.50/month on the panel, and the ESN Discord can help if you get stuck.