💾 Archived View for snowcode.ovh › en › gaming › minecraft › tutorials › minecraft.gmi captured on 2024-08-18 at 17:22:42. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2024-05-10)
-=-=-=-=-=-=-
Download the sevrer.jar file from the following website:
Then place the file into an empty directory:
$ mkdir minecraft-server/ $ cd minecraft-server/ $ mv ~/Downloads/server.jar .
Then you have to run the file:
$ java -Xmx1024M -Xms1024M -jar server.jar nogui
Then, replace "false" by "true" in eula.txt
$ sed -i "s/false/true/g" eula.txt
Re-run the server.jar file. Then type /stop.
$ java -Xmx1024M -Xms1024M -jar server.jar nogui
Now you can edit the server.properties file. For instance, you can change "online-mode" to false if you want to allow cracked players to join the server.
$ nano server.properties
Now, we can finally run the server:
$ java -Xmx1024M -Xms1024M -jar server.jar nogui
Now, into that console and change some gamerules. Those are my personal favorites:
/whitelist on /whitelist add <player names> /op <your player name> /gamerule mobGriefing false /gamerule doWeatherCycle false
We will now create a systemd service:
# nano /etc/systemd/system/minecraft.service
Paste the following code:
[Unit] Description=Minecraft Vanilla Server After=network.target [Service] Restart=always RestartSec=1 WorkingDirectory=<path to minecraft-server> ExecStart=java -Xmx1024M -Xms1024M -jar server.jar nogui [Install] WantedBy=multi-user.target
Finally, you can run the service:
# systemctl start minecraft # systemctl enable minecraft
You now have a working Vanilla Miencraft Server. If you want to stop the server join the game and run /stop. Or run:
# systemctl stop minecraft
Also, if you want to make your server accessible world wide, you can open the port 25565. Your IP will be: