Tips for running a Minecraft server — plugins, admins, automatic restarts
This is the next step after opening a server with Creating a Minecraft server (Java Edition, Paper and vanilla). It covers installing plugins, setting up admins and a whitelist, starting again automatically when it stops, and automatic backups.
1. Create a start script
Create a start file so you don't have to type the long command every time. If the server stops (including crashes), it starts again automatically after 10 seconds.
cd ~/minecraft
nano start.sh
#!/bin/bash
cd ~/minecraft
while true; do
java -Xms1G -Xmx3G -jar server.jar nogui
echo "Server stopped. Restarting in 10 seconds. (To stop it completely, press Ctrl + C)"
sleep 10
done
chmod +x start.sh
screen -S mc ./start.sh
Set the -Xmx value leaving 1–2GB of the server's memory free. (4GB server → 3G, 8GB server → 6G)
2. Admins (OP) and the whitelist
Enter these in the server console (screen -r mc).
op yourname # Give admin privileges
whitelist add friendname # Add to the whitelist
whitelist on # Only players on the whitelist can join
whitelist list # Show the list
For a friends-only server that isn't open to the public, we strongly recommend turning on the whitelist. It keeps strangers from coming in and wrecking your world.
3. Commonly changed settings (server.properties)
With the server stopped, open it with nano server.properties, edit it, and start the server again.
| Setting | Description |
|---|---|
motd | The description shown in the server list |
max-players | Maximum number of players |
difficulty | Difficulty (peaceful, easy, normal, hard) |
gamemode | Default game mode (survival, creative) |
view-distance | View distance. Lowering it reduces lag (8–10 recommended) |
online-mode | Keeping it true is recommended. If you turn off account verification, others can join under your nickname |
4. Install plugins (Paper server)
Plugins don't work on a vanilla server. Switch to a Paper server.jar from papermc.io before using them. (You can keep using your existing world folder.)
- On a plugin site like Modrinth, Hangar or SpigotMC, copy the download link for the
.jarfile that matches your server version. - Download it into the
pluginsfolder.
cd ~/minecraft/plugins
wget "copied download link"
- Restart the server to apply it. Type
pluginsin the console to see the installed plugins listed in green.
Don't install plugins from unknown sources. They can put your whole server at risk.
5. Automatic world backups
Schedule the world to be compressed every day at 5 a.m., with backups older than 7 days deleted. (How to use cron)
mkdir -p ~/mc-backups
crontab -e
0 5 * * * tar -czf ~/mc-backups/world-$(date +\%F).tar.gz -C ~/minecraft world >> ~/mc-backups/backup.log 2>&1
30 5 * * * find ~/mc-backups -name "*.tar.gz" -mtime +7 -delete
Backups that exist only on the server disappear along with it if the server goes away. Download them to your PC from time to time. On a Paper server, the Nether and the End are saved separately in the
world_netherandworld_the_endfolders, so addworld_nether world_the_endafterworldin the command.
6. Reducing lag
- Use a Paper server. It's much lighter than vanilla.
- Lower
view-distanceto 8–10. - If it's very laggy when people first join, it's because the map is still being generated. Generating the map in advance with a plugin like Chunky reduces this.
- If memory keeps running short, increase
-Xmxor consider moving to a plan with more memory. - To check whether the server itself is slow, see Checking a slow server.