NOWOŚĆ 📢 Zaoszczędź do 30% w pierwszym miesiącu, oferta ograniczona czasowo!

How to host a Java Discord bot

Discord bot hostingUpdated Oct 6, 20263 min read

This guide is for bots packaged as a single runnable jar, for example built with JDA.

Switch the server to Java

A new bot server starts as a Node.js server. Change it before you upload anything, because changing the type reinstalls the server and by default deletes its files.

  1. Open your server in the panel and stay on Overview.
  2. Click Edit Server Type and choose Java Bot. See How to change your server type or game version for the full walkthrough.

Add your jar

  1. Build a jar that runs on its own, with its dependencies included (a "fat" or "shaded" jar).
  2. Open Files and upload it.
  3. Open Settings, then Game Settings, and set Jar file to the name of your jar, for example bot.jar.
  4. Paste your token into Discord bot token (optional). Your code reads it with System.getenv("DISCORD_TOKEN").

Start it

Open Console and start the server. The server runs Java 21 and uses up to 80 percent of your plan's memory for the Java heap, which leaves room for the rest of the process.

Good to know

  • If your bot was built for Java 17, Java 21 runs it without changes in almost every case.
  • Your own start arguments are not available on this type. If your bot needs special Java flags, ask support.

If it stops right away: read Why your Discord bot keeps stopping.

STWÓRZ SWÓJ SERWER GIER
GOTOWY, ABY ZACZĄĆ?

Oszczędź nawet 30% na swoim nowym serwerze gier.
Wydajność premium, natychmiastowa aktywacja i niezawodność bez kompromisów. Wszystko w lepszej cenie.

NASZE OSTATNIE WPISY