Discord bot hosting

Where can I host a Java Discord bot for free?

On FadeHost. Push a Maven or Gradle project (or upload it), or a jar, and your JDA bot runs 24/7 on Java 21. A small bot fits the free plan's 256 MB with its cache trimmed: no credit card, nothing to renew.

JDA, Discord4J or Javacord: push the repository with its pom.xml or Gradle build, or upload the project, set the token, deploy. The bot is built with Maven or Gradle (tests skipped) and started with java -jar. A committed jar at the root skips the build.

Runtime
Java 21
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

What the repository needs

  1. A pom.xml or build.gradle that produces a runnable jar with its dependencies (the Maven shade or assembly plugin, or Gradle's shadow plugin).
  2. The token read from the environment: System.getenv("DISCORD_TOKEN").
  3. Nothing else. The build runs on deploy and the resulting jar starts with java -jar. Set a start command when the jar name is not what the build's default produces.

Memory on a JVM bot

A JDA bot idles around 150 MB and grows with the guilds it caches. The free tier's 256 MB fits a small bot with cache flags trimmed (disableCache, ChunkingFilter.NONE); a bot in many guilds is happier on Starter at 1 GB. The panel shows the live memory of the process.

Build times and caching

The first build downloads the dependency tree; later builds reuse the cache under /data, so a redeploy after a small commit takes well under a minute. A committed, prebuilt jar deploys in seconds and needs no build at all.

Questions

Which Java version runs?

Java 21. Code targeting 17 runs on it; code that needs 8 or 11 does not, so set the compiler release accordingly or commit a jar built for 21.

Maven or Gradle?

Either. mvn package for a pom.xml, gradlew build for a Gradle project, tests skipped in both. Kotlin DSL builds work.

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 Java bot free

Free, no credit card

Deploy a Java bot free