Bots and messaging

Discord bot hosting on a VPS

A Discord bot is a process that has to stay connected. When your laptop closes, the bot goes offline. On a VPS the process keeps running, restarts after a crash and comes back after a reboot. NodeRings lets you compare live plans from independent providers and deploy one with root access.

We measured a small discord.js bot under PM2: 70.5 MiB of memory at idle, plus 53.5 MiB for the PM2 daemon. That leaves plenty of room on a 1 GB plan for the system and a few more bots.

Recommended start: 1 vCPU, 1 GB RAM · from $5.00/mo on live plans

Live marketplace offers

Plans for a Discord bot

These are live offers that meet the size you pick. Prices and regions come from the providers and change when they do.

What are you running?

One small discord.js or discord.py bot fits easily. Leave headroom for updates.

Enzonix logo
Enzonix

Shared Compute - General Compute

$5.00/mo

1 vCPU · 1 GB · 20 GB

Choose location

Ashburn, United States

1 provider

Why run your Discord bot here

  • Compare before you commit

    Live prices, sizes and regions from independent providers in one list.

  • Root access

    Use Node, Python, Java or Go, with PM2, systemd or Docker.

  • Hourly or monthly

    Test a bot by the hour, or keep a monthly plan for one that stays.

  • Automate it

    Create the server with Terraform, OpenTofu or an MCP assistant, then deploy your bot from CI.

  • Measured, not guessed

    The sizing below comes from a real run, with the numbers and the method published on our blog.

  • Your token stays with you

    Keep it in a settings file on your server, not on a third-party platform.

How much memory does a Discord bot need?

Start small, then watch memory after a day of real use.

How much memory does a Discord bot need?
WorkloadStart withNote
One small slash-command bot1 vCPU, 1 GBAbout 124 MiB for the bot plus PM2 in our lab run, before the system.
Two to four small bots1 vCPU, 2 GBUse one service per bot so a crash stays contained.
Bot with a local database2 vCPU, 4 GBA database server wants its own memory.
Music bot2 vCPU, 4 GBAudio streaming needs steady CPU and bandwidth. Measure with your own tracks.
Bot in many servers, with sharding2 vCPU, 4 GB and upCaches grow with servers and members. Limit intents and sweep old data.

Starting points, not guarantees. Measure your own workload.

Measured on a NodeRings lab host

What a small bot really uses

Bot idle memory (discord.js 14.25.1 under PM2 6.0.14)
70.5 MiBDiscord bot on a VPS: idle RSS and uptime
PM2 daemon idle memory
53.5 MiBDiscord bot on a VPS: idle RSS and uptime
Restart after kill -9
Online again within secondsDiscord bot on a VPS: idle RSS and uptime

The lab bot ran without a live Discord token, so it measures the process, not gateway traffic. Memory grows with guild count and caches.

Quickstart: deploy a discord.js bot with PM2

About fifteen minutes. You need a Discord account, an SSH key and a bot application.

  1. Create the bot

    In the Discord Developer Portal, create an application, add a bot, and copy the token. Treat it like a password. Use a bot application. Automating a normal user account is against Discord's rules.

  2. Create the server

    Choose Deploy on a plan that fits, pick Ubuntu 24.04, add your SSH key and confirm. A default payment method is required.

  3. Install Node.js and PM2

    Log in as root and install Node.js 22 and PM2.

    Install
    ssh root@YOUR_SERVER_IP
    curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
    apt install -y nodejs
    npm install -g pm2@6.0.14
  4. Create the project

    Make a folder for the bot and install discord.js and dotenv at fixed versions.

    Project
    mkdir -p /opt/discord-bot && cd /opt/discord-bot
    npm init -y
    npm install discord.js@14.25.1 dotenv@16.4.7 --save-exact
  5. Add your code and settings

    Put your bot code in index.js, and the token in a .env file that stays out of git. The blog post has a complete starter bot with a /ping command you can copy.

    Settings file
    printf 'DISCORD_TOKEN=\nDISCORD_CLIENT_ID=\n' > .env
    chmod 600 .env
    nano .env
    index.js
    require("dotenv").config();
    const { Client, Events, GatewayIntentBits } = require("discord.js");
    
    const client = new Client({ intents: [GatewayIntentBits.Guilds] });
    
    client.once(Events.ClientReady, (c) => {
      console.log(`Ready as ${c.user.tag}`);
    });
    
    client.login(process.env.DISCORD_TOKEN);
  6. Run it under PM2 and keep it across reboots

    As root, pm2 startup adds a systemd service for PM2 straight away. pm2 save stores the process list that comes back after a reboot, so run it again whenever you add or remove a process.

    PM2
    pm2 start index.js --name discord-bot --max-memory-restart 300M
    pm2 startup
    pm2 save
  7. Check it

    Run pm2 status and pm2 logs discord-bot. In your Discord server the bot should show as online. Use max-memory-restart as a safety net, not as a plan. If memory climbs every hour, look for caches that never expire.

Good fit and not a fit

Ideal for

  • Slash command and moderation bots
  • Bots that post alerts or feeds
  • Several small bots on one server
  • Bots you deploy from CI

Not ideal for

  • User account automation (selfbots) or anything against Discord's terms
  • Running a large language model on a small plan
  • Large sharded bots without measuring first

Acceptable use is covered in section 6 of the Terms of Service. Read the Terms of Service

Questions

How much RAM does a Discord bot need?

In our lab run a discord.js bot used 70.5 MiB at idle and the PM2 daemon used 53.5 MiB. A 1 GB plan holds a small bot comfortably. Music, big caches and sharding need more, so measure your own bot.

Is PM2 or systemd better?

Both work. systemd has no extra dependency. PM2 is handy if you already use npm and want pm2 logs and pm2 monit. The Telegram page shows the systemd route.

Does my bot need an open port?

No. Your server connects out to Discord. If you add a health check, keep it on the loopback address.

Can I run Python bots instead?

Yes. discord.py runs fine on the same plans. Use a virtual environment and a systemd service, as in the Telegram quickstart.

How do I update my bot?

Pull your code over SSH or from CI, then run pm2 restart discord-bot. To skip the hand work, deploy from a GitHub Action over SSH.

What if I outgrow the plan?

Compare larger plans in the list, create a new server, copy your project and settings, and delete the old one. Hourly plans make that cheap to try.

Related use cases

Keep your bot online

Pick a plan and have your bot running in minutes.

Discord Bot Hosting on a VPS · NodeRings