LIONFIN
Use case

Discord Bot Hosting

Keep the bot you built with discord.js, discord.py or another library online while your computer is off: a KVM-based Linux VPS with full root access.

See packages From ₺299.00 per month (excl. VAT)
Connection type
Outbound WebSocket connection to the Discord Gateway (no inbound port needed)
Common libraries
discord.js (Node.js), discord.py (Python), JDA (Java), Discord.Net (C#)
Process management
systemd, pm2 or Docker
Access
Full root, SSH
Product group
VPS Server

Quick answer

Discord bot hosting means running your Discord bot’s code on an always-on server instead of your own computer, so the bot stays online 24/7. Discord bots open a persistent outbound connection to the Discord Gateway, so a small Linux VPS server is enough for most bots. The bot runs under a process manager such as systemd or pm2, restarts automatically if it crashes and keeps its token safely on the server.

Discord Bot Hosting packages

Monthly starting prices in Turkish lira, excluding VAT. You complete the order on our Turkish store page.

VPS Business

₺949.00 / month

  • 6 vCPU
  • 16 GB RAM
  • 320 GB NVMe
  • 12 TB Trafik
  • 1 IPv4
  • Öncelikli destek
Order (Turkish checkout)

VPS Enterprise

₺1,749.00 / month

  • 8 vCPU
  • 32 GB RAM
  • 640 GB NVMe
  • 20 TB Trafik
  • 2 IPv4
  • Günlük yedek
Order (Turkish checkout)

Estimated resources by bot type (approximate)

Bot typeRAMvCPUDisk
Moderation and command bot on a few servers1–2 GB1–220–40 GB
Bot with a database on hundreds of servers2–4 GB240–80 GB
Music bot (audio processing)4–8 GB2–440–80 GB
Many bots or a sharded bot8 GB or more4 or more80 GB or more

Estimates; actual needs depend on mods, plugins and settings.

Why do you need Discord bot hosting?

You need Discord bot hosting because a Discord bot is online only while its code is running; the moment you shut down your computer, lose your internet connection or close the terminal window, the bot appears offline on your servers. A bot that handles moderation, welcome messages, role assignment, a ticket system or game stats should keep working while your community sleeps.

Typical problems with running the bot on your own computer:

  • When the computer sleeps or restarts for an update, the bot drops and stays offline until someone notices.
  • When your home IP address changes or the connection drops, the bot may struggle to reconnect.
  • The bot’s database lives on your personal computer; a disk failure can wipe out every server’s settings.
  • Development and production share one machine, so testing can break the live bot.

Some free hosting platforms put the app to sleep after a period of inactivity, limit monthly running hours or offer no persistent disk; for a Discord bot that must stay connected, these limits cause real problems. Your own VPS imposes none of them: the bot runs until you stop it.

Why choose a Linux VPS for a Discord bot?

A Linux VPS is the right choice for a Discord bot because bots are command-line processes that need no graphical interface, and Linux runs such processes with the fewest resources and the most stability. Node.js, Python, Java and .NET are all officially supported on Linux, and the documentation of discord.js, discord.py and other libraries usually assumes a Linux server.

Features of LIONFIN VPS plans that matter for a Discord bot:

  • Full root access: you install the Node.js or Python version, the database and audio tools such as FFmpeg yourself.
  • KVM virtualisation: Docker works without issues if you want to use it.
  • NVMe storage: the bot’s SQLite or PostgreSQL database reads and writes quickly.
  • Network protection: network-level DDoS filtering with the RouteFence firewall helps keep the server reachable during an attack.
  • Scalability: as the bot grows you can add resources without reinstalling.

If your bot uses a Windows-only component, or you want to manage it visually over remote desktop, see the Windows RDP option on the bot server hosting page. If you will host a simple Node.js app alongside a website, Node.js hosting is an alternative, but a VPS is better for bots that hold an always-open WebSocket connection.

How many resources does a Discord bot need?

The resources a Discord bot needs depend on the number of servers (guilds) it is in, how much data it caches, its database use and whether it processes audio. A small moderation bot runs on very little memory, while a bot in thousands of servers that caches every member can use a lot. The table above gives approximate values; compare them with the current package table.

The main factors in resource use:

  • Cache: libraries keep member, message and channel data in memory by default. You can limit this with cache limits in discord.js or member cache settings in discord.py.
  • Intents: the more event types (intents) the bot listens to, the more events it processes and the more memory it uses. Enable only the intents you need.
  • Voice and music: audio encoding and FFmpeg use CPU; separate audio servers such as Lavalink also need memory.
  • Database: if PostgreSQL or MongoDB runs on the same server, add its share.
  • Several bots: running a few bots on one VPS is common; each uses memory as a separate process.

Watch per-process memory with htop while the bot runs. If memory keeps climbing over time there is a leak or an unbounded cache; fixing the code is a more lasting solution than upgrading the plan.

How do you install a Discord bot on a VPS?

Installing a Discord bot on a VPS means preparing the server, installing the runtime, getting the code onto the server, defining the token and starting the bot with a process manager.

  1. Connect: connect over SSH, update the system and create a separate non-root user for the bot: adduser discordbot
  2. Runtime: install the current Node.js LTS for discord.js, or Python and the venv module for discord.py. Check the library’s minimum supported version in its documentation.
  3. Get the code: pull the bot’s code from a private Git repository with git clone.
  4. Dependencies: run npm ci for Node.js, or create a virtual environment and run pip install -r requirements.txt for Python.
  5. Token: write the bot token into a .env file in the project folder and restrict its permissions with chmod 600 .env.
  6. Test: start the bot manually once and confirm it appears online in Discord and responds to commands.
  7. Run persistently: run the bot in the background with systemd or pm2 so it restarts automatically (next section).

How do you keep a Discord bot online 24/7?

The most robust way to keep a Discord bot online 24/7 is to define it as a systemd service; systemd starts the bot at boot, restarts it within seconds if it crashes and keeps its logs centrally. Running node index.js in a terminal and closing the window shuts the bot down too.

An example service file (/etc/systemd/system/discordbot.service):

[Unit]
Description=Discord bot
After=network-online.target
Wants=network-online.target

[Service]
User=discordbot
WorkingDirectory=/home/discordbot/bot
EnvironmentFile=/home/discordbot/bot/.env
ExecStart=/usr/bin/node index.js
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

Enable the service with systemctl daemon-reload and systemctl enable --now discordbot, and follow the logs with journalctl -u discordbot -f. For Python bots, the ExecStart line should point to the Python interpreter in the virtual environment.

Alternatives: in the Node.js world, pm2 is popular for managing several bots with one command and following logs; for start-on-boot you need the pm2 startup command. Packaging the bot as a Docker container improves portability and gives the same continuity with a restart: unless-stopped policy.

How do you keep a Discord bot token safe?

A Discord bot token is your bot’s password and must never end up in a code repository, a screenshot or a public channel; anyone who gets it can send messages as your bot, delete channels and damage every server it is in. If you suspect a leak, reset the token immediately on the bot’s page in the Discord Developer Portal; the old token becomes invalid.

  • .env file: put the token in a .env file, not in the code, and add that file to .gitignore.
  • File permissions: make the .env file readable only by the bot user.
  • Separate user: do not run the bot as root, so a flaw in the bot code cannot become a full server takeover.
  • Least privilege: when inviting the bot to servers, grant only the permissions it needs; do not request Administrator unless it is truly required.
  • SSH security: use keys instead of passwords, open only the SSH port in UFW and add Fail2ban.
  • Dependency updates: track security updates with npm audit or pip list --outdated.

Because Discord bots connect outbound, most setups need no inbound port other than SSH; the fewer open ports, the smaller the attack surface.

What should you watch for as a Discord bot grows?

As a Discord bot grows, verification, privileged intents, sharding and rate limits come into play; these relate more to Discord’s platform rules than to server resources. Knowing them in advance keeps the bot from being interrupted at the moment it takes off.

  • Bot verification: Discord requires bots that reach a certain number of servers to be verified; unverified bots cannot be added to new servers beyond that threshold. The current threshold and requirements are in the Discord Developer Portal documentation.
  • Privileged intents: the Message Content, Server Members and Presence intents are privileged. Small bots can enable them in the portal; verified bots need a justified application. Where possible, work with slash commands to reduce the need for message content.
  • Sharding: Discord requires bots in many servers to split their Gateway connection into shards. discord.js’s ShardingManager and discord.py’s AutoShardedClient automate most of this.
  • Rate limits: Discord API requests are rate-limited. Libraries usually handle limits themselves; for bulk message or role operations you need to spread requests out.

A sharded bot runs several processes, so its memory needs grow. When resources run short you can upgrade your plan from the customer panel, or move to a VDS server with dedicated resources.

What should you consider when hosting a Discord music bot?

Hosting a Discord music bot involves both technical and legal considerations: audio encoding uses CPU, separate audio servers need memory, and the terms of use of your content source decide whether the bot can operate legally.

On the technical side:

  • FFmpeg and Opus: converting the audio stream into the format Discord expects requires FFmpeg and the Opus encoder; install them with the package manager.
  • Lavalink: many music bots hand audio processing to a separate Java-based Lavalink server. This lightens the bot process but needs extra memory for the Java runtime.
  • Number of voice channels: every voice channel playing at the same time uses extra CPU and bandwidth; plan resources for heavy use.

On the legal side, most video and music platforms forbid downloading or rebroadcasting their content this way in their terms of use. Large music bots are known to have shut down for this reason in the past. Using licensed sources, your own audio files or streams the publisher permits is the safest path. Compliance with the content source’s terms is your responsibility, and copyright-infringing use also breaches the service agreement.

How do you back up a Discord bot’s data?

The Discord bot data that needs backing up is the database holding server settings, user points, warning records and ticket history, plus the .env configuration. The code sits in Git and can be pulled again, but your community’s data built up over months exists only in the database.

Backup method by database:

  • SQLite: common for small bots. Instead of copying the file directly while the bot runs, take a consistent copy with sqlite3 bot.db ".backup backup.db".
  • PostgreSQL: take a logical backup with pg_dump.
  • MongoDB: use the mongodump tool.

Combine these commands in a script, run it nightly with a cron job, then compress the output and copy it to storage off the server. Keeping several daily and several weekly backups lets you recover data that was corrupted without anyone noticing.

For an instant copy of the whole server, take a VPS snapshot; doing so before a major library update lets you roll back within minutes if something goes wrong.

How do you update and monitor a Discord bot?

A Discord bot is updated by pulling new code from Git, updating dependencies and restarting the service; it is monitored through the process manager’s logs, error notifications and an external liveness check.

A simple update flow:

  1. Try the change first with a separate test bot on a test server. Creating a second application in the Discord Developer Portal is enough for this.
  2. Update the code on the server with git pull.
  3. Reinstall dependencies (npm ci or pip install -r requirements.txt).
  4. If you changed slash commands, run the command registration again.
  5. Restart the service with systemctl restart discordbot and watch for errors with journalctl.

For monitoring, having the bot send caught errors to a private Discord channel or webhook is a practical method. To catch cases where the bot goes down completely, use an external uptime monitoring service: the bot sends a “heartbeat” request at intervals, and the service alerts you if it stops arriving.

What are the most common Discord bot hosting problems?

The most common problems are a bot that is online but ignores commands, an invalid token error, a bot that does not start after a server restart and running out of memory.

The bot is online but does not respond to messages

If you use commands that read message content, make sure the Message Content intent is enabled both in the Developer Portal and in the code. For slash commands, check that the commands are registered and that the bot has permissions in the channel.

“An invalid token was provided” error

The token may have been reset or copied incompletely, or the service may not be reading the .env file. If you use systemd, check the EnvironmentFile path; write the token without quotes or spaces.

The server restarted and the bot did not come back

Make sure the service was enabled with systemctl enable, or, if you use pm2, that you ran pm2 save and pm2 startup.

The bot crashes every few days

If the logs show memory errors, lower the cache limits and look for leaks. A swap file helps as a temporary measure, but the lasting fix is correcting the code or adding memory.

What should you look for in Discord bot hosting?

The criteria are uninterrupted running, root access, persistent storage, easy upgrades and the flexibility to run several bots or supporting services on one server. Free platforms are fine for testing, but once your community relies on the bot, sleep modes and time limits become a real problem.

  1. Continuous running: the server must not sleep or shut the bot down after a time limit. A VPS has no such limits.
  2. Root access: needed to install the runtime version, tools such as FFmpeg and the database freely.
  3. Persistent, fast storage: bot data must not be wiped on restart; NVMe storage speeds up database operations.
  4. Several bots: a test bot, the live bot and a small web dashboard can run together on one VPS.
  5. Network protection and monitoring: network-level DDoS filtering and 24/7 NOC monitoring help keep the bot’s server reachable.
  6. Support: being able to open a ticket from the customer panel for infrastructure issues matters.

If your bot is written in Python and you will host a small web app alongside it, the Python hosting page summarises the different hosting options.

How do you deploy a Discord bot on a VPS?

  1. 1

    Choose a VPS plan

    Pick a VPS plan that fits your bot’s size and choose a current Ubuntu LTS release as the operating system.

  2. 2

    Prepare the server

    Connect with an SSH key, update the system, open only the SSH port with UFW and create a separate user for the bot.

  3. 3

    Install the runtime

    Install Node.js LTS for discord.js, or Python with a virtual environment for discord.py; add FFmpeg for a music bot.

  4. 4

    Upload the code and token

    Pull the code from your private Git repository, install dependencies and write the token into a .env file with restricted permissions.

  5. 5

    Run it as a service

    Create a systemd service with Restart=always for the bot and start it with systemctl enable --now.

  6. 6

    Set up backups and monitoring

    Add a nightly database backup job and a monitoring mechanism that notifies you when the bot goes down.

Legal note

Discord is a registered trademark of Discord Inc.; LIONFIN is not affiliated with Discord. Compliance of bots with the Discord Developer Terms and with the terms of use of content sources is the customer’s responsibility.

FAQ

Frequently asked questions about Discord Bot Hosting

Entry-level VPS plans are usually enough for moderation or command bots running on a few servers. Bots with a database, bots in hundreds of servers or music bots need more memory. Compare the approximate resource table on this page with the current values in the package table to choose.

In most cases, no. Discord bots open an outbound WebSocket connection to the Discord Gateway and do not wait for inbound connections. Only if you receive interactions over HTTP with an Interactions Endpoint URL, or publish a web dashboard for the bot, do you need to open the HTTPS port and set up a reverse proxy.

Yes. You can run each bot in its own folder as a separate systemd service or pm2 process. The limit is set by the server’s memory and CPU. Keeping a test bot and the live bot as separate services on the same server lets you try updates safely.

Resource use depends more on the bot’s design, cache settings and enabled intents than on the language. Both libraries run comfortably on a small VPS when configured correctly. Choose the language you are comfortable with; setting cache limits and enabling only the intents you need reduces memory on either side.

Go to the bot’s page in the Discord Developer Portal and reset the token immediately; the old token becomes invalid at once. Write the new token into the .env file on the server and restart the service. Investigate how the token got into the repository and make sure .env is listed in .gitignore.

Some free platforms put the app to sleep after inactivity, limit monthly running hours or offer no persistent disk. For a bot that must stay connected, these limits mean downtime. On a VPS the bot runs until you stop it, its data persists and you control the whole environment.

Yes, Node.js and Python also run on Windows, and you can use a Windows RDP server if you want to manage the bot over remote desktop. However, Discord bots need no graphical interface, so a Linux VPS runs them with fewer resources, and most documentation is written for Linux servers.

Discord requires verification for bots that reach a certain number of servers and, at larger scale, mandates splitting the Gateway connection into shards. Privileged intents may also require an application. Follow the current thresholds in the Discord Developer Portal documentation and prepare your code for sharding before you grow.

It is not required; running directly with systemd is the simplest method for small bots. Docker lets you package the bot with its dependencies, move it easily between servers and manage several bots and a database from one Compose file. Docker runs without issues on a KVM-based VPS; see Docker hosting.