Discord bot hosting

Where can I host a Go Discord bot for free?

On FadeHost. Push the repository with its go.mod, or upload the code, and your discordgo bot runs 24/7 on the free plan: 256 MB of RAM, 3 GB of disk, no credit card and nothing to renew.

discordgo, arikawa or disgo: push the repository with its go.mod or upload the code, set the token, deploy. The main package is built on every deploy and the binary runs as the bot. A Go bot idles in a few tens of megabytes, which makes the free tier roomy.

Free
256 MB, always on, no card
Starter
1 GB, $2/mo or $20/yr
Standard
Two bots, 1.5 GB each, $3/mo or $30/yr
Pro
Four bots, 2 GB each, $6/mo or $60/yr

What the repository needs

  1. A go.mod at the root and a main package (the root, or set the start command to the built binary of a sub-package).
  2. The token read from os.Getenv("DISCORD_TOKEN").
  3. A process that blocks: discordgo bots usually wait on a signal channel after session.Open(); a main that returns ends the bot and the panel restarts it.

Modules and build cache

Modules and the build cache live under /data, so the first deploy downloads once and later ones compile only what changed. Private modules need a GOPRIVATE setting and a token in the environment, like anywhere else.

Why Go bots do well on the free tier

256 MB is tight for a JVM and comfortable for Go: a discordgo bot with a few thousand members cached sits well under 100 MB. Standard and Pro exist for bots that stream audio or hold large state, not for the language.

Questions

Which Go version?

The toolchain follows the go directive in go.mod, so a module that asks for a recent Go gets it.

Can I commit a prebuilt binary instead?

Yes, on a paid plan: a committed binary is inspected and runs on Starter and up. The free tier builds from source only, so everything on it can be read.

Where does the token go?

In the environment variables of the app, as BOT_TOKEN or whatever name your code reads, never in the repository. The panel masks the values and injects them when the bot starts.

What happens when I push a commit?

With auto-deploy on, every push to the branch you chose redeploys the bot: install, build if there is one, start. The live console shows each step and the crash doctor explains a failed start in plain words.

What does the free tier include?

One bot with 256 MB of RAM, always on, placed where there is room for it (a paid plan picks the region), with the live console, environment variables and redeploys on push. A second bot or more memory is the Starter plan at $2 a month.

Read on

Put your bot online now

One bot free, 24/7. No credit card, nothing to renew.

Deploy a Go bot free

Free, no credit card

Deploy a Go bot free