Guide
Host a Java bot (JDA or Discord4J)
Upload a runnable .jar, we run it on Java 21.
- Build a runnable jar that includes its libraries:
mvn packagewith the Maven Shade plugin, orgradle shadowJarwith the Shadow plugin. The jar needs a Main-Class in its manifest. - Upload the .jar (up to 40 MB) in the Files tab, plus any config files it reads. It becomes the start file.
- Add DISCORD_TOKEN in Secrets and read it with
System.getenv("DISCORD_TOKEN"). - Press Deploy. We run
java -jaron Java 21 with the heap sized to your plan (75% of its memory), and stop cleanly instead of hanging if memory runs out.
Java bots need more memory than Python or Node.js ones: Pro (512 MB) is the smallest plan we suggest for JDA.
Still stuck? Log in and ask support, or check the service status. New here? See bot hosting plans from $0.70 a month.
More Discord bot guides
Host a Discord bot 24/7 (Python, Node.js or Java)From a bot on your computer to a bot that never goes offline.Host a discord.js (Node.js) botNode.js 22 with your package.json, online 24/7.Keep your Discord bot token safeNever put the token in your code; use an encrypted secret.Upload a multi-file bot (cogs, folders)Projects with cogs, config files and folders work as they are.My Discord bot is offline or keeps crashingRead the reason, fix it, deploy again.Host a music or voice botFFmpeg and Opus are added for you.