|
| 1 | +--- |
| 2 | +title: Installing the Minecraft server |
| 3 | +weight: 3 |
| 4 | + |
| 5 | +### FIXED, DO NOT MODIFY |
| 6 | +layout: learningpathall |
| 7 | +--- |
| 8 | + |
| 9 | +## Installing the Minecraft server |
| 10 | + |
| 11 | +### Installing the Java Runtime Environment |
| 12 | + |
| 13 | +Before we install the Minecraft server, we need to make sure that there are some prerequisites installed. |
| 14 | +For the Minecraft 26 server or earlier, we will need Java 25. We can install this on Oracle Linux with: |
| 15 | +``` |
| 16 | +sudo dnf install java-25-openjdk |
| 17 | +``` |
| 18 | +and on Ubuntu or similar distributions, with |
| 19 | +``` |
| 20 | +sudo apt install openjdk-25-jre |
| 21 | +``` |
| 22 | +Since the Minecraft server starts on the command line, you may also want to install the `screen` or |
| 23 | +`tmux` utilities which allows commands to keep running after you disconnect from the server. |
| 24 | + |
| 25 | +### Downloading and installing the Minecraft server |
| 26 | + |
| 27 | +You can find the link for the latest version of the Minecraft server |
| 28 | +[on the Minecraft website](https://www.minecraft.net/en-us/download/server). Copy the link to |
| 29 | +`server.jar` from this page, and run the following command on your OCI instance to download it: |
| 30 | +``` |
| 31 | +wget <paste URL to server.jar here> |
| 32 | +``` |
| 33 | + |
| 34 | +This will download server.jar from the Mojang website, and we will have a server.jar file on our OCI |
| 35 | +instance. To make it easier to keep track of different server versions, rename the server.jar file |
| 36 | +with a more meaningful name: `mv server.jar minecraft_server.26.2.jar` |
| 37 | + |
| 38 | +To start the Minecraft server, run the command: |
| 39 | +``` |
| 40 | +java -Xmx8G -Xms8G -jar minecraft_server.26.2.jar nogui |
| 41 | +``` |
| 42 | + |
| 43 | +This runs the server withough a graphical user interface, and allocates 8GB of memory to it. If you |
| 44 | +allocated less than this amount of memory to your instance, set this number to 3/4 of the memory that |
| 45 | +you allocated to the instance - the other operating system services need some memory too. |
| 46 | + |
| 47 | +The first time you do this, the start-up will fail expectedly - a file called `eula.txt` is created |
| 48 | +in the local folder, and before you start the server, you first need to accept its terms of use. Open |
| 49 | +this file and follow the instructions to accept the terms and conditions. Running the server again |
| 50 | +after doing this will succeed, and you should see the following messages on the terminal, showing |
| 51 | +that the process has completed successfully (timestamps will be different at the start of the lines): |
| 52 | + |
| 53 | +``` |
| 54 | +[00:40:50] [Server thread/INFO]: Starting minecraft server version 26.2 |
| 55 | +[00:40:50] [Server thread/INFO]: Loading properties |
| 56 | +[00:40:50] [Server thread/INFO]: Default game type: SURVIVAL |
| 57 | +[00:40:50] [Server thread/INFO]: Generating keypair |
| 58 | +[00:40:51] [Server thread/INFO]: Starting Minecraft server on *:25565 |
| 59 | +[00:40:51] [Server thread/INFO]: Preparing level "world" |
| 60 | +[00:40:51] [Server thread/INFO]: Selecting global world spawn... |
| 61 | +[00:41:04] [Server thread/INFO]: Loading 0 persistent chunks... |
| 62 | +[00:41:04] [Server thread/INFO]: Preparing spawn area: 100% |
| 63 | +[00:41:04] [Server thread/INFO]: Time elapsed: 13099 ms |
| 64 | +[00:41:04] [Server thread/INFO]: Done (13.448s)! For help, type "help" |
| 65 | +[00:41:04] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld |
| 66 | +[00:41:04] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world]'/minecraft:the_nether |
| 67 | +[00:41:04] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world]'/minecraft:the_end |
| 68 | +[00:41:04] [Server thread/INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved |
| 69 | +[00:41:04] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved |
| 70 | +[00:41:04] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved |
| 71 | +[00:41:04] [Server thread/INFO]: ThreadedAnvilChunkStorage: All dimensions are saved |
| 72 | +``` |
| 73 | + |
| 74 | +Your Minecraft server is now running - you can connect to it with the Minecraft client. |
| 75 | + |
0 commit comments