1. Give it enough RAM
Open Settings in your server and use the RAM presets or the slider.
- Vanilla or Paper with a few friends: 2–4 GB
- Light modpacks: 4–6 GB
- Big modpacks: 6–8 GB or more
Cubi warns you if you assign too much: your PC and the game need memory too.
2. Paper for vanilla-style servers
If you don't need mods, Paper runs noticeably smoother than vanilla and supports plugins.
3. Pre-generate the world
Plugins like Chunky (Paper) generate the map in advance, so exploring doesn't cause lag spikes.
Lower the view distance in Settings if the server still struggles with many players.