Manage a Minecraft Server
After you get your Minecraft server up and running on a Cloud Server with Linux, there are many ongoing tasks to perform and changes you can make. Learn how to perform management and administrative tasks on a Minecraft server, including how to start and stop the Minecraft server, change the map seed, and use console commands.
Minecraft is one of the most popular games in the world right now. We’ve got a list of Minecraft servers to help you find the best servers for Minecraft for your gameplay style.
Requirements
- A Cloud Server with Linux.
- Minecraft server installed and running.
- Root access to the server.
- Unlimited traffic
- Fast SSD NVMe storage
- Free Plesk Web Host Edition
Stop the Minecraft Server from the command line
There are several reasons why you might want to stop the Minecraft server from the command line. When the server is stopped from the command line, it automatically saves all player and map data to the files. This lets you make changes to the game or back up a clean copy of the files without worrying about creating a conflict.
This procedure must be done as the root user.
If you are running Minecraft in a detached screen session, as we covered in the article Install and Run a Minecraft Server, reattach to that screen session with the command:
screen -r
You will see the current output of the game, including messages about which players have joined or left the game, player deaths, and so forth.
To stop the Minecraft server, hit CTRL+C. The session will finalize and quit, and you will be returned to the command line:
[18:08:31] [Server Shutdown Thread/INFO]: Stopping server
[18:08:32] [Server Shutdown Thread/INFO]: Saving players
[18:08:32] [Server Shutdown Thread/INFO]: Saving worlds
[18:08:32] [Server Shutdown Thread/INFO]: Saving chunks for level 'world'/Overworld
root@localhost:~/minecraft#
Start the Minecraft Server from the command line
First, begin a new screen session with the command:
This procedure must be done as the root user.
screen -r
Next, start the Minecraft server with the command:
java -Xms1G -Xmx1G -jar minecraft_server.jar nogui
The start-up process will take a few moments to complete.
[17:04:55] [Server thread/INFO]: Preparing spawn area: 82%
[17:04:56] [Server thread/INFO]: Preparing spawn area: 90%
[17:04:57] [Server thread/INFO]: Preparing spawn area: 97%
[17:04:57] [Server thread/INFO]: Done (17.525s)! For help, type "help" or "?"
At this point, your server is running. Use ctrl+a+d to detach this window, so that it continues to run after you exit.
Changing the seed
Every map begins with a seed, a long string of digits which (among other things) specify the map's spawn point. To change your map's spawn point, you will need to change the seed.
Generating a new random seed
To get a new, random seed, first stop the Minecraft server as described in the section above.
Then rename the world folder original-world with the command:
sudo mv /minecraft/world /minecraft/original-world
Start the Minecraft server as described in the section above. It will automatically generate a new world folder, with a new random seed.
Use a specific new seed
To set a specific new seed, first stop the Minecraft server as described in the section above.
Then save a copy of your existing world by renaming the folder to original-world with the command:
sudo mv /minecraft/world /minecraft/original-world
Next, you will need to edit the server.properties file:
sudo nano /minecraft/server.properties
Scroll down until you find the line:
level-seed=
Put the seed at the end of this line. For example, to use the seed 1168863261 you would edit the line to read:
level-seed=1168863261
Then start the server as described in the section above. It will automatically generate a new world from that seed.
Restoring your original world
If you want to restore your original world, first rename the original-world folder back to world with the command:
sudo mv /minecraft/original-world /minecraft/world
If you created a new world from a random seed, all you need to do now is start the Minecraft server.
If you created a new world from a specific new seed, a few more steps are involved.
Edit the server.properties file:
sudo nano /minecraft/server.properties
Scroll down until you find the line:
level-seed=[seed number]
Delete the seed number so that the line reads:
level-seed=
Save and exit the file.
Next you will need to create a fresh world, then replace that with your original world. Delete the existing world folder:
sudo rmdir /minecraft/world
Start the Minecraft server. Wait for it to finish generating a new world. Then stop the Minecraft server.
Now replace the world folder with original-world:
sudo mv /minecraft/original-world /minecraft/world
Finally, start the Minecraft server.
- Dedicated enterprise hardware
- Intel® Xeon® or AMD processors
- Leading security technologies
Console commands
As the server administrator, there are many console commands which you can issue from the command line on your server.
You can issue console commands from the active screen session. If you have detached from the screen where the Minecraft server is running, you can reattach to it with the command:
screen -r
You will see the most recent output from the game's log, lines like:
[19:16:14] [Server thread/INFO]: Preparing start region for level 0
[19:16:15] [Server thread/INFO]: Preparing spawn area: 5%
[19:16:16] [Server thread/INFO]: Preparing spawn area: 52%
[19:16:17] [Server thread/INFO]: Done (3.155s)! For help, type "help" or "?"
/op mechagrue
[19:16:52] [Server thread/INFO]: Opped mechagrue
[19:21:16] [User Authenticator #1/INFO]: UUID of player mechagrue is 1913411c-1b11-4f69-a0f1-bb64ee119b5b
[19:21:16] [Server thread/INFO]: jdoe[/45.01.69.102:61579] logged in with entity id 366 at (68.72628356970813, 74.0, 263.6769861238363)
[19:21:16] [Server thread/INFO]: jdoe joined the game
[19:21:59] [Server thread/INFO]: jdoe drowned
Type out the console command and hit Enter. If the command is correct, the server will respond with a confirmation message. If the command is incorrect, the server will suggest you use the /help command:
[19:21:16] [Server thread/INFO]: jdoe joined the game
[19:21:59] [Server thread/INFO]: jdoe drowned
/test
[19:23:09] [Server thread/INFO]: Unknown command. Try /help for a list of commands
Grant yourself operator status
By default, a Minecraft server does not have any server operators (OPs) set. A player with OP status is granted the highest level of admin rights, and can kick, ban, grant other players OP status, and more.
You will most likely want to grant yourself OP rights. If you have just set up your Minecraft server, you will first need to open your desktop Minecraft and connect to your server, if you have not already done so. This lets your server find and save your UUID.
You will need to issue this console command from the active screen session, as described above.
To grant yourself operator rights, use the /op command:
/op [player name]
For example, if your player name was jdoe the command would be:
/op jdoe
If the command is successful, the server with respond with:
[19:16:52] [Server thread/INFO]: Opped jdoe
Set up a whitelist
A whitelist blocks anyone who is not on the list from connecting to your Minecraft server. This lets you create a list of players who you want to allow on your server, and blocks everyone else.
You will need to issue this console command from the active screen session, as described above.
To enable the whitelist, use the command:
whitelist on
The server will respond with:
whitelist on
[19:27:44] [Server thread/INFO]: Turned on the whitelist
To add a player to the whitelist, use the command:
/whitelist add [player name]
For example, to add the player jdoe to your whitelist, the command would be:
/whitelist add jdoe
The server will respond with:
/whitelist add jdoe
[19:28:47] [Server thread/INFO]: Added jdoe to the whitelist
Server ops are always automatically added to the whitelist by default.
To remove a player from the whitelist, use the command:
/whitelist remove [player name]
For example, to remove the player jdoe from the whitelist, the command would be:
/whitelist remove jdoe
The server will respond with:
/whitelist remove jdoe
[19:35:03] [Server thread/INFO]: Removed jdoe from the whitelist