Keep your Discord bot online 24/7 without your own PC
Published on 3 October 2026 Updated on 7 October 2026
You’ve built a Discord bot and it works. The only problem: it goes offline as soon as your PC goes to sleep, restarts or installs an update. The fix is simple: run your bot on a server that’s always on. This article covers what you need, how to get your bot online at CakeHosting and what to watch out for, from your token to the processor it runs on.
Why your bot goes offline
A Discord bot is a program that keeps a constant connection open to Discord. As long as that program runs, your bot responds. When it stops, because your computer switches off or your internet drops for a moment, your bot goes offline. A server in a data centre is on all day and has a stable connection, so your bot keeps running even while you sleep.
What do you need?
- A bot application in the Discord Developer Portal, with a token. That token is your bot’s password. Never share it, and reset it straight away if it leaks.
- The right intents. Your bot only receives some data if you switch it on. According to Discord’s documentation, these privileged intents cover presence, server members and message content. You enable them on your app’s Bot page, under Privileged Gateway Intents. If your bot can reach more than 10,000 users across all its servers, Discord has to review those intents first; below that you simply switch them on. That threshold has applied since mid-2026; before, it was a hundred servers.
- An invite link. Under OAuth2 in the Developer Portal you create a link that adds the bot to your Discord server with exactly the permissions it needs.
- A supported version of your programming language. According to npm, discord.js 14 needs Node.js 18 or newer, and according to PyPI, discord.py 2 needs Python 3.8 or newer.
Getting your bot online at CakeHosting
- Pick a plan and complete your order in My CakeHosting.
- Choose your language. In the game panel, under Startup, choose Node.js, Python or Java as the Bot Runtime, and the version under Docker Image. You can pick Node.js 18 to 26, Python 3.11, or Java 17 or 21.
- Put your files on the server, through the file manager, over SFTP or from a Git repository.
- Set your start file, for example
index.jsormain.py, under Startup File. - Put your token in an environment variable, for example in a
.envfile, and keep it out of your code. - Start your bot and check the console to see whether it logs in.
The panel also includes the Bot Studio, aimed mainly at bots built with Node.js and discord.js. It includes an installer, templates for complete bots, an npm package browser, a place for your environment variables and explanations of common error messages.
Want your bot online day and night? See the plans for Discord bot hosting at CakeHosting, with Node.js, Python and Java in the same panel.
Your bot runs on ARM: what to watch for
Our Discord bots run on a server in the United States with an ARM processor. For most bots you won’t notice: JavaScript, Python and Java run on it without changes.
Do keep an eye on packages with their own compiled code, such as libraries for images, audio or databases. Those need an ARM64 build. Most big packages ship one, but check if an installation fails with an error about your platform or architecture.
Safe and stable
- Keep your token out of your code. Store it in an environment variable and never in a public Git repository.
- Only enable the intents you need. Less data means less risk.
- Log errors. That way the console shows you why your bot isn’t doing something.
- Watch your memory. If your bot stops with exit code 137, it ran out of memory. Look for a memory leak or choose a bigger plan.
Common error messages
- Disallowed intent(s), code 4014. Your code requests a privileged intent that’s switched off in the Developer Portal, or that your bot hasn’t been approved for yet.
- Authentication failed, code 4004. The token is wrong. Check your environment variable or reset the token.
- Cannot find module or ModuleNotFoundError. A package is missing. Reinstall your bot’s dependencies.
Updating your bot
Changed your code? Stop your bot, put the new files on the server or pull the latest version from your Git repository, install any new packages and start it again. If you use a package.json or requirements.txt, keep it up to date so the server knows exactly which packages your bot needs. Test big changes on your own computer first.
Which plan suits your bot?
Our Discord bot plans come with 1, 2 or 4 GB of memory. A simple bot for moderation or roles needs very little: the smallest plan is usually enough. Music bots, bots with a database or bots that sit in lots of servers at once need more memory. Start small; you can always move up to a bigger plan.