Host a Discord bot 24/7: bot plan or VPS, without downtime
A bot that goes offline when you close your PC is not a bot, it is a demo. Here is how to host a Discord bot on a server, with a bot host or on a VPS, for real availability, 24 hours a day.
ACLClouds teamPublished on September 7, 2026Updated on November 17, 20269 min read
The essentials
Store the token in an environment variable, never in your code.
Entrust the restart to a process manager with an increasing delay.
Monitor gateway latency and command error rate.
Store data on a persistent volume and back up the database every day.
A bot host for a single bot, a VPS when several services run together.
Your cookie choice
With your consent, we measure which ads bring us customers and how the site is used. Without it, nothing is measured and the site works exactly the same. You can change your mind at any time.Analytics and advertising, only with your consent. The site works the same without.
Host a Discord bot 24/7: bot plan or VPS, without downtime
·
Discord bot hosting 24/7: bot host or VPS, process manager, environment variables, logs and backups for a bot that never goes down.
A bot that goes offline when you close your PC is not a bot, it is a demo. Here is how to host a Discord bot on a server, with a bot host or on a VPS, for real availability, 24 hours a day.
Store the token in an environment variable, never in your code.
Entrust the restart to a process manager with an increasing delay.
Monitor gateway latency and command error rate.
Store data on a persistent volume and back up the database every day.
A bot host for a single bot, a VPS when several services run together.
A pinned runtime and secrets kept out of the code
The classic first incident: the bot token committed to GitHub, revoked by Discord in the middle of the night. Store it in an environment variable, pin the Node.js or Python version, and version an example file (.env.example) without the values.
Never commit the token: environment variables only.
Pin the runtime version (e.g. Node 22 LTS) for reproducible deployments.
Document each required variable in a README.
To choose the host, compare free Discord bot hosting plans.
A process manager that restarts intelligently
PM2, systemd or Docker with a restart policy: the tool matters less than the policy. Restart automatically on crash, but with an increasing delay (backoff) so you don't loop on a configuration error, and keep persistent logs to understand what happened.
Configure automatic restart with exponential backoff.
Keep logs outside the container to diagnose crashes.
Add a health check: is the bot still responding to commands?
Monitor what really matters
Being online is not enough: a bot that is connected but no longer responds to interactions is broken. Monitor Discord gateway latency, command error rate and memory. A simple alert (webhook, email) is worth more than a dashboard nobody looks at.
Monitor Discord gateway latency and command error rate.
Alert on repeated disconnections and memory leaks.
Keep 7 days of logs for post-incident analysis.
Separate data from code
As soon as the bot stores anything (levels, economy, moderation), that data must survive a redeployment. A SQLite database on a persistent volume is enough to start; PostgreSQL takes over as the bot grows, with regular backups in both cases. For a bot that stays online around the clock without keeping your PC on, see Discord bot hosting.
Store data on a persistent volume, never in the image.
Back up the database daily to external storage.
Test restores before you need them.
Apply the 3-2-1 rule to database backups.
Discord bot host or VPS: which one to choose?
There are two ways to host a Discord bot on a server. A bot host provides a panel: you upload the code, pick Node.js, Python or Java, paste the token and the bot runs, with logs, automatic restart and DDoS protection already in place. Hosting a Discord bot on a VPS gives you the whole system: you install the runtime, PM2 or systemd, the security updates and the backups yourself. A VPS makes sense when the bot needs other services (web API, several processes, a dedicated database) or more than 2 GB of RAM.
Bot host: a free plan to start (1 bot, 315 MB of RAM), then paid plans with more RAM and CPU, no commitment.
VPS: a full server to host several bots, a website and a database, with at least 2 GB of RAM.
In both cases the bot stays online 24/7 without keeping your PC on, and you manage your bot from a browser or over SSH.
Compare: the Discord bot host and the Linux VPS.
On a VPS, the step-by-step setup: install Node.js with NodeSource or nvm, then PM2.
First bot: the tutorial to host a Discord bot for free, from the token to the logs.
How much RAM for a Discord bot online 24/7?
A moderation or slash-command bot in Node.js or Python uses between 100 and 250 MB at rest. A music bot that decodes audio with ffmpeg quickly exceeds 512 MB, and a Java bot (JDA) rarely starts under 300 MB because of the JVM. Measure the real memory in the logs or the panel after 24 hours of operation, then keep a 30% margin: a bot that hits its limit is killed by the system (exit code 137) and restarts in a loop.
Node.js or Python command bot: 256 to 512 MB is enough, the free plan (315 MB) suits a small Discord server.
Music bot or bot present on many Discord servers: 1 GB of RAM or more.
Java bot or bot with a large cache: 1 to 2 GB, and a VPS if several bots run side by side.
Frequently asked questions
Do I need to leave my computer on?
No. The bot runs on ACLClouds infrastructure and stays online regardless of your computer or internet connection.
Is it better to host a Discord bot on a VPS or with a bot host?
A bot host is enough for a single bot: panel, logs, automatic restart and DDoS protection are included, and the free plan lets you start. A VPS suits you when you run several bots, an API or a database, and accept to administer the system yourself.
Can I host a Discord bot 24/7 for free and without a credit card?
Yes. The ACLClouds free plan hosts 1 Node.js or Python bot with 315 MB of RAM, without a credit card, with a free renewal every 4 days from the bot page.
Does my bot restart automatically after a crash?
Yes. The process restarts automatically after an unexpected stop, and logs remain viewable live in the panel.