# Host your own Discord or Slack bot

> I wrote a bot that answers questions in our Discord or Slack using an AI model, and I need somewhere for it to live.

A chat bot is a small program that waits for messages, asks a model and replies. How Discord or Slack delivers those messages decides whether it can ever sleep. No provider hosts your own bot in one click; one provider's guide stands out, and the task-only sandboxes are a poor fit.

Guide page: https://botperch.com/use-cases/chat-bot/

**Short answer:** The cheapest machine that runs it as described is Agent 37 at $5.30 a month, then Runtime ($11.86) and Lizard ($19.00). 12 of 16 providers run it without a catch. The AI model adds about $12.25 a month on top (GLM 5.3, 100 requests a day at 10k tokens each, median zero-retention price; from $5.70 at the cheapest host). List prices checked 29 October 2026.

A support or community bot holds a login token for the chat app, receives each message, assembles some context, calls a model and posts the answer. You write it with a library such as [discord.js](https://github.com/discordjs/discord.js) or Slack's Bolt; the model runs elsewhere and is billed by its own provider.
Discord bots normally keep a **WebSocket** open to Discord: a connection that stays open so messages can be pushed down it at any moment. Discord calls these [persistent connections](https://discord.com/developers/docs/topics/gateway) that the bot must keep alive with regular heartbeats. Slack offers the same in [Socket Mode](https://docs.slack.dev/apis/events-api/using-socket-mode).
The other way is a public web address that Discord or Slack calls for each message ([Slack Request URLs](https://docs.slack.dev/apis/events-api/using-http-request-urls), [Discord interactions](https://discord.com/developers/docs/interactions/overview)). A bot built that way only needs to be awake when a message arrives. A bot that reads every message in a server needs the open connection, and so a machine that stays on.

## What it needs

- **Machine size:** Neither Discord nor Slack publishes one. 1 vCPU / 2 GiB / 10 GiB runs Node or Python, a small history database and one model call at a time, with room for logs. Battleships models this job at 2 vCPU / 4 GiB / 20 GiB. [source](https://battleships.dev/data/presets.json)
- **Does it stay on?:** Yes for a bot with an open connection: if it misses a heartbeat, Discord closes the connection, and a bot may only log in to it 1,000 times a day, so a host that keeps sleeping and waking it is a bad host. A bot that only answers through a web address can sleep if the host wakes it on a request. [source](https://discord.com/developers/docs/topics/gateway)
- **What must survive a restart:** The bot token (anyone with it controls the bot), conversation history and any settings. Lizard's guide keeps them in a database rather than the machine's disk, and warns to run only one copy per token, or every copy answers every message. [source](https://lizard.build/docs/guides/discord-bot)
- **Browser, Docker, GPU:** No browser. Docker is optional. A database is recommended for history; SQLite (a single-file database) is enough for one copy. No GPU. [source](https://lizard.build/docs/guides/discord-bot)
- **How busy it is:** Idle almost all the time, busy in short bursts when a message arrives. Battleships' always-on assistant averages about 6% CPU; one community server sees less traffic, so the calculator uses 3%. [source](https://battleships.dev/data/rankings/employees.json)

## Picks

- **Lizard**, If you wrote the bot yourself: The only provider with a full official Discord bot guide, including the database for history and the one-copy rule. It fits inside the $19 monthly plan that comes back as usage. Watch: Deployed from the command line, and it runs on Lizard's app platform rather than the sandbox sizes the calculator prices. https://lizard.build/docs/guides/discord-bot
- **Runtime**, If you want to pay least for waiting: CPU is billed only while it works, so a bot that mostly waits is about $12 a month at 1 vCPU / 2 GiB, in a sandbox that never idle-pauses. Watch: No bot guide, one US region, and storage keeps billing while the machine is stopped. https://withruntime.com/docs/pricing
- **Agent 37**, If you do not want to write code: A ready-made AI agent (OpenClaw or Hermes) answering in your Discord or Slack, set up from the browser, from $3.99 a month with your own model key. Watch: It is not your own bot: you configure an existing agent rather than run your code. These Personal plans are separate from the Cloud machines the calculator prices. https://www.agent37.com/personal

## How to run it on each provider

- **Agent 37** (one-click; no terminal: yes): Not your own code: pick OpenClaw or Hermes on a Personal plan and connect it to your own Discord or Slack account, on Basic and above. The bot is that ready-made agent. Price: Personal plans from $3.99 a month; Discord and Slack from the Basic plan. [Agent 37 Personal](https://www.agent37.com/personal)
- **Lizard** (guide; no terminal: no): The most complete official walkthrough: a discord.js example deployed with no public port, one copy per token, secrets, and a managed PostgreSQL database for history. Deployed from the command line. [Lizard: host a Discord bot](https://lizard.build/docs/guides/discord-bot)
- **Modal** (guide; no terminal: no): An official example, but only for a bot that answers slash commands through a web address. Modal is not built to hold an open connection. [Modal: Discord bot](https://modal.com/docs/examples/discord_bot)
- **Boat** (manual; no terminal: partly): Boat documents the pattern: run the bot as a service that comes back by itself after a stop, resume or copy, and keep its public address. No bot-specific guide. [Boat: always-on services](https://docs.boat.dev/long-running-tasks/always-on-services)
- **boxd** (manual; no terminal: partly): Turn off auto-hibernate, and turn off bot protection for that machine: it is on by default and "chat apps can't pass" it. [boxd: personal assistants](https://docs.boxd.sh/use-cases/personal-assistants)
- **Daytona** (manual; no terminal: partly): Create a sandbox with auto-stop off (the default is 15 idle minutes), install the bot and keep it running under a process manager. No bot guide. [Daytona: auto-stop](https://www.daytona.io/docs/en/sandboxes#auto-stop-interval)
- **InstaBox** (manual; no terminal: partly): A general Linux machine with Docker. Turn auto-pause off so the connection stays open. No bot guide. [InstaBox: concepts](https://instabox.sh/docs/concepts)
- **Runtime** (manual; no terminal: partly): A persistent sandbox never idle-pauses and can run the bot. No bot guide. [Runtime: pricing and persistent sandboxes](https://withruntime.com/docs/pricing)
- **Sandboxer** (manual; no terminal: partly): Turn idle pause off, or create the keep-awake file Sandboxer documents for work it cannot see, and run the bot as a service. No bot guide. [Sandboxer: long-running tasks](https://sandboxer.com/docs/long-running)
- **Morph** (manual; no terminal: partly): Only for a bot that answers through a web address: a Devbox wakes on a request, but an idle one is paused, which drops an open connection. [Morph: wake on request](https://cloud.morph.so/docs/documentation/instances/wake-on)
- **Sprites** (manual; no terminal: no): Only for a bot that answers through a web address: "services don't keep a Sprite from pausing", so a quiet connection would be paused. [Sprites: services](https://docs.fly.io/sprites/concepts/services.md)
- **Blaxel** (manual; no terminal: no): A poor fit for an open connection: Blaxel treats a WebSocket with no traffic for 15 minutes as idle and puts the sandbox on standby. No bot guide. [Blaxel: active and standby](https://docs.blaxel.ai/knowledge-base/configuration-and-operation/understanding-sandbox-active-vs-standby-states-and-billing.md)
- **Cloudflare Sandbox** (manual; no terminal: no): A Worker can serve a Slack app that answers through a web address, but a Discord bot with an open connection does not fit a sandbox built around requests and stopping. No bot guide. [Cloudflare Sandbox: lifetime](https://developers.cloudflare.com/sandbox/concepts/lifetime/)
- **E2B** (none; no terminal: no): Not suitable: sessions end after one hour on the free plan and 24 hours on Pro. [E2B: pricing](https://e2b.dev/pricing.md)
- **Vercel Sandbox** (none; no terminal: no): Not suitable: sandboxes are made for one task and functions for one request, with no documented way to hold a connection open.

## Monthly machine cost (preset `chatbot`)

One always-on 1 vCPU / 2 GiB / 10 GiB machine that keeps its history: 730 hours, because a bot holding a Discord or Slack connection cannot sleep. About 3% CPU on average, since one community sees little traffic. The model line assumes 100 replies a day at 10,000 tokens each (instructions plus recent messages).

- Agent 37: $5.30
- Runtime: $11.86
- Lizard: $19.00
- Boat: $20.00
- InstaBox: $20.00
- Sandboxer: $20.00
- Morph: $36.50
- Sprites: $38.88
- boxd: $55.45
- Daytona: $60.84
- Blaxel: $61.64
- Tensorlake: $250.00
- Vercel Sandbox: $33.76 (catch: Sessions end after 24 hours, so an always-on machine has to be restarted by your own code.)
- Cloudflare Sandbox: $47.48 (catch: A stopped instance loses its disk; files have to be backed up to R2 or a snapshot and restored.)
- Modal: $56.86 (catch: Sessions end after 24 hours, so an always-on machine has to be restarted by your own code. Modal sandboxes have no stopped state; keeping files needs a Volume or a snapshot.)
- E2B: $60.44 (catch: Sessions end after 1 hour, so an always-on machine has to be restarted by your own code.)

## Outside a sandbox

An ordinary host such as [Render](https://render.com/pricing) runs an always-on background worker from $7 a month for 512 MB, or $25 for 1 CPU / 2 GB. A Slack app that answers through a web address fits [Cloudflare Workers](https://developers.cloudflare.com/workers/platform/pricing/): free up to 100,000 requests a day, or a $5 monthly minimum.

## Sources

- [Discord: Gateway](https://discord.com/developers/docs/topics/gateway)
- [Discord: interactions](https://discord.com/developers/docs/interactions/overview)
- [Slack: Socket Mode](https://docs.slack.dev/apis/events-api/using-socket-mode)
- [Slack: HTTP Request URLs](https://docs.slack.dev/apis/events-api/using-http-request-urls)
- [Lizard: host a Discord bot](https://lizard.build/docs/guides/discord-bot)
- [Render pricing](https://render.com/pricing)
- [Battleships: always-on assistant workload (built by the Boat team)](https://battleships.dev/data/rankings/employees.json)
