Orders are paused while we move to a new game panel. Tell me when they reopen
  1. Home
  2. Guides
  3. Minecraft

Minecraft guide

How much RAM does a Minecraft server need for your group?

Short answer. For a small server the Minecraft wiki recommends at least 2 GB of RAM, says 4 GB is very possible for larger servers, and notes that -Xmx2G is more than enough for a home server with 5 players. Set the maximum with -Xmx and scale up only when you see a real problem.

The numbers worth trusting

There is no magic players-per-gigabyte rule, and the wiki does not give one. What it does say is this:

  • For small servers, have at least 2 GB of RAM available.
  • It is very possible that larger servers need 4 GB.
  • -Xmx2G (2 gigabytes) is more than enough for a home server with 5 players, and you should scale it up based on your actual settings.
  • A survival server with 4 to 8 players can run on most modern hardware.

So for a group of four to eight friends playing plain survival, 2 GB is the starting point and 4 GB is the comfortable step up. If you plan to add a lot of mods or a huge amount of redstone, expect to need more, and measure rather than guess.

What -Xmx and -Xms mean

Minecraft's server is a Java program, and memory is set with two flags on the start command:

java -Xmx2G -Xms2G -jar server.jar nogui
  • -Xmx is the maximum memory the server may use. This is the one that matters for "how much RAM".
  • -Xms is the starting amount. For a server that also runs other software, the wiki suggests a quarter of the maximum, for example -Xms512M with a 2 GB maximum. For a Minecraft-only machine, making it equal to the maximum disables heap scaling.

Give the server what the machine can spare, but never the machine's whole memory: the operating system and anything else running need some too. On a hosted server where you pick a memory plan, that choice is the same as picking -Xmx for you.

Before you add RAM, cut the load

If the server lags, more memory is not always the cure. These two server.properties values change how much work the server does for every player:

  • view-distance: chunks of world data sent to each player. Default 10, range 3 to 32.
  • simulation-distance: chunks around each player where living entities are updated. Default 10, range 3 to 32.

Dropping either a couple of points reduces what the server has to send and update. They are described in more detail in the server.properties guide. Restart after editing.

Working out your own number

  1. Start at 2 GB for up to a handful of friends, or 4 GB if the group is larger or you are adding mods.
  2. Play for a normal session with everyone online, doing what your group really does: exploring new chunks, running farms, flying around.
  3. If the server stays smooth, stay where you are. If it stutters, lower view-distance and simulation-distance first, then raise -Xmx one step.
  4. Change one thing at a time so you know what helped.

The player cap is separate from memory

max-players defaults to 20 and only limits how many people can be online at once. Setting it high does not allocate memory, and setting it low does not save any. It is still worth setting it close to the real size of your group, together with a whitelist.

Back up before you experiment

The wiki's advice is blunt: regularly make server backups to safeguard your data against loss or corruption, and if a host makes backups for you, check how often they run. A world you are about to put heavy changes through is a good moment to take one by hand. Run save-all flush from the console to write everything to disk immediately (it freezes the server for a short time), then copy the world folder.

Quick answers

How much RAM does a small Minecraft server need?

The Minecraft wiki recommends at least 2 GB for small servers and says 4 GB is very possible for larger ones.

What is the difference between -Xmx and -Xms?

-Xmx is the maximum memory the server may use; -Xms is the starting amount. On a Minecraft-only machine, setting -Xms equal to -Xmx disables heap scaling.

Does max-players use more RAM?

No. It only limits how many players can be online at once; the default is 20.