Skip to content

Commit 09d6964

Browse files
Merge pull request #3479 from jasonrandrews/review
Tech review of Minecraft on OCI
2 parents 2e97b53 + 072844e commit 09d6964

24 files changed

Lines changed: 99 additions & 74 deletions

content/learning-paths/servers-and-cloud-computing/minecraft-on-oci/_index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ learning_objectives:
1818
- Connect to the running Minecraft server from the Minecraft client application
1919

2020
prerequisites:
21-
- Review [Get started with Oracle Cloud Infrastructure](/learning-paths/servers-and-cloud-computing/csp/oci/)
22-
- Install software that allows you to connect to a running instance over SSH
23-
- You will need a copy of the [Minecraft Java edition client](https://www.minecraft.net/en-us/download) installed, and [a license](https://www.minecraft.net/en-us/store/minecraft-java-bedrock-edition-pc) for the game
21+
- An Oracle Cloud Infrastructure (OCI) account
22+
- A copy of the [Minecraft Java edition client](https://www.minecraft.net/en-us/download) installed, and [a license](https://www.minecraft.net/en-us/store/minecraft-java-bedrock-edition-pc) for the game
2423

2524
author: Dave Neary
2625

14.2 KB
Loading
Binary file not shown.
17.6 KB
Loading

content/learning-paths/servers-and-cloud-computing/minecraft-on-oci/minecraft-client-connect.md

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,64 +7,73 @@ weight: 4
77
layout: learningpathall
88
---
99

10-
## Connecting the Minecraft client to the server
10+
## Connect the Minecraft client to the server
1111

1212
### Opening the port for the Minecraft server
1313

14-
Before you connect to the Minecraft server, you will change the network policy to allow clients
15-
to connect to the Minecraft server over TCP port number 25565. To do this, you need to modify
16-
the networking settings for your instance in the OCI dashboard.
14+
Before you connect to the Minecraft server, change the network policy to allow clients to connect to the Minecraft server over TCP port number 25565. To do this, you need to modify the networking settings for your instance in the OCI dashboard.
1715

1816
1. On the OCI Instances page, choose your Minecraft server instance.
1917
2. In the **Networking** tab, click on the subnet name:
20-
![OCI Networking panel displaying instance subnet configurations#center](oci_instance_networking.png "Open the networking panel in OCI")
18+
![OCI Networking panel displaying instance subnet configurations#center](oci_instance_networking.webp "Open the networking panel in OCI")
2119
3. On the **Security** tab of the subnet page, choose the security list which is active for the instance
2220
(by default, this is called "Default Security List for vcn-xxxxxxxx")
23-
![OCI Subnet Details page highlighting the Default Security List#center](subnet_security_list.png "Select the Default Security List on the Subnet Details page")
21+
![OCI Subnet Details page highlighting the Default Security List#center](subnet_security_list.webp "Select the Default Security List on the Subnet Details page")
2422
4. Under **Security rules**, add a new Ingress rule (this means the rule applies to incoming traffic
25-
from outside the instance). Set **Source CIDR** to "0.0.0.0/0" (this means all IP addresses can
26-
connect), and set the **Destination Port Range** field to 25565.
27-
![OCI Ingress Rules dialog with source CIDR 0.0.0.0/0 and destination port 25565#center](open_minecraft_port.png "Configure an Ingress rule to open port 25565")
23+
from outside the instance). Set **Source CIDR** to the public IP address (or range) of the
24+
players who will connect to your server. For example, if your home IP address is `203.0.113.45`,
25+
set the Source CIDR to `203.0.113.45/32` to allow only that address. You can add multiple
26+
ingress rules if players connect from different networks.
2827

29-
You will also need to update the instance's local firewall to allow connections to port 25565 on
30-
your instance. Reconnect to your instance with SSH, and run the following commands:
31-
```
28+
{{% notice Warning %}}
29+
Avoid using `0.0.0.0/0` as the Source CIDR. This opens the port to the entire internet and
30+
exposes your server to unauthorized access attempts. Always restrict access to only the IP
31+
addresses that need to connect.
32+
{{% /notice %}}
33+
34+
Set the **Destination Port Range** field to 25565.
35+
![OCI Ingress Rules dialog with source CIDR and destination port #center](open_minecraft_port.webp "Configure an Ingress rule to open port 25565")
36+
37+
You can find your current public IP address by searching "what is my IP address" in a web browser
38+
from the network you will use to connect.
39+
40+
You will also need to update the instance's local firewall to allow connections to port 25565 on your instance. Run the following commands:
41+
42+
```console
3243
sudo firewall-cmd --permanent --add-port=25565/tcp
3344
sudo firewall-cmd --reload
3445
```
3546

36-
You should now be able to run your Minecraft server on the OCI instance, then start your client
37-
on your laptop or desktop., You will first be asked to log in with your Microsoft or Mojang account.
47+
You should now be able to run your Minecraft server on the OCI instance, then start your client on your laptop or desktop. You will first be asked to log in with your Microsoft or Mojang account.
48+
3849
Use the credentials you created for your Microsoft account.
3950

4051
### Connecting to the server from the Minecraft client
4152

4253
1. Before connecting to the server with the client for the first time, you will need to
43-
[register for a Microsoft account](https://www.minecraft.net/en-us/download).
54+
[register for a Microsoft account](https://signup.live.com/).
4455
2. Start your Minecraft client and log in with your Microsoft account credentials.
4556
3. Start the "Minecraft Java edition" client from the launcher.
46-
![Minecraft launcher screen](minecraft_launcher.png)
57+
![Minecraft launcher screen](minecraft_launcher.webp)
4758
4. Choose **Multiplayer** mode - read and click through the warning that third party servers are not operated by Mojang.
4859
5. To add your server to the menu of available servers, choose **Add server**, name your server
4960
something meaningful ("My OCI server" for example) and put the IP address of your instance into the
5061
**Server Address** field:
51-
![Minecraft multiplayer server dialog showing Server Name and Server Address fields filled in#center](configuring_new_minecraft_server.png "Add your OCI instance public IP address to the Server Address field")
62+
![Minecraft multiplayer server dialog showing Server Name and Server Address fields filled in#center](configuring_new_minecraft_server.webp "Add your OCI instance public IP address to the Server Address field")
5263

5364
You can now join the server and start building!
5465

55-
![Minecraft game client showing successful connection to the custom multiplayer server#center](connecting_to_server.png "Connect to the custom Minecraft server")
66+
![Minecraft game client showing successful connection to the custom multiplayer server#center](connecting_to_server.webp "Connect to the custom Minecraft server")
5667

5768
### What you've accomplished
5869

5970
In this guide, you successfully:
71+
6072
- Provisioned an Arm-based VM instance on Oracle Cloud Infrastructure.
6173
- Installed Java and deployed the Minecraft server software.
6274
- Configured OCI security ingress rules and server-side firewalls to expose the port.
6375
- Added and connected to the server using the Minecraft client application.
6476

6577
### Next steps
6678

67-
Now that your server is running, you can share the IP address with friends for multiplayer play. You can also explore automated startup scripts to ensure the server automatically recovers from reboots.
68-
69-
70-
79+
Now that your server is running, you can share the IP address with friends for multiplayer play. You can also explore automated startup scripts to ensure the server automatically recovers from reboots.

content/learning-paths/servers-and-cloud-computing/minecraft-on-oci/minecraft-server-install.md

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,56 @@ layout: learningpathall
1111

1212
### Installing the Java Runtime Environment
1313

14-
Before you install the Minecraft server, you need to make sure that there are some prerequisites
15-
installed. For the Minecraft 26 server or earlier, you will need Java 25.
14+
Before you install the Minecraft server, you need to install the required software. For the Minecraft 26 server or earlier, you will need Java 25.
1615

17-
Connect to your instance using SSH as described in the previous step. You can install Java 25 on
18-
Oracle Linux with:
16+
Connect to your instance using SSH as described in the previous step. You can install Java 25 on Oracle Linux 9 with:
1917

2018
```console
21-
sudo dnf install java-25-openjdk -y
19+
sudo dnf install java-25-openjdk.aarch64 -y
2220
```
2321

24-
and on Ubuntu or similar distributions, with
22+
### Keeping the server running after disconnecting
23+
24+
The Minecraft server runs in the foreground of your terminal session. If you close your SSH
25+
connection, the server process will stop. To keep the server running after you disconnect, use
26+
`tmux` to create a persistent terminal session.
27+
28+
While still connected to your instance via SSH, install `tmux` on Oracle Linux 9:
2529

2630
```console
27-
sudo apt install openjdk-25-jre -y
31+
sudo dnf install tmux -y
2832
```
2933

30-
Since the Minecraft server starts on the command line, you might also want to install the `screen` or
31-
`tmux` utilities which allows commands to keep running after you disconnect from the server.
32-
These commands are not strictly necessary, but you will need them to be running if you want to keep
33-
the server running when you disconnect from your SSH session.
34+
Start a new `tmux` session named "minecraft":
35+
36+
```console
37+
tmux new -s minecraft
38+
```
3439

35-
Running the Minecraft server at start-up, or keeping it running when you are not connected, will
36-
not be covered in this learning path.
40+
You are now inside a `tmux` session. Any commands you run here will continue running even after you
41+
disconnect from SSH. You will start the Minecraft server inside this session in the next section.
42+
43+
When you need to disconnect, press `Ctrl+B` then `D` to detach from the session. The server
44+
continues running in the background.
45+
46+
To reattach to the session later (for example, after reconnecting via SSH):
47+
48+
```console
49+
tmux attach -t minecraft
50+
```
3751

3852
### Downloading and installing the Minecraft server
3953

4054
You can find the link for the latest version of the Minecraft server
41-
[on the Minecraft website](https://www.minecraft.net/en-us/download/server). Copy the link to
42-
`server.jar` from this page, and run the following command on your OCI instance to download it:
55+
[on the Minecraft website](https://www.minecraft.net/en-us/download/server).
56+
57+
On that page, right-click the `minecraft_server.x.x.x.jar` link and copy the URL. Then run the following command on your OCI instance to download it:
4358

4459
```console
4560
wget <paste URL to server.jar here>
4661
```
4762

48-
This will download `server.jar` from the Mojang website, and you will have a `server.jar` file on your OCI
49-
instance. To make it easier to keep track of different server versions, rename the `server.jar` file
50-
with a more meaningful name:
63+
This will download `server.jar` from the Mojang website, and you will have a `server.jar` file on your OCI instance. To make it easier to keep track of different server versions, rename the `server.jar` file to a more meaningful name:
5164

5265
```console
5366
mv server.jar minecraft_server.26.2.jar
@@ -59,17 +72,21 @@ To start the Minecraft server, run the command:
5972
java -Xmx8G -Xms8G -jar minecraft_server.26.2.jar nogui
6073
```
6174

62-
This runs the server withough a graphical user interface, and allocates 8GB of memory to it. If you
63-
allocated less than this amount of memory to your instance, set this number to 3/4 of the memory that
64-
you allocated to the instance - the other operating system services need some memory too.
75+
This runs the server without a graphical user interface, and allocates 8GB of memory to it.
76+
77+
The first time you do this, the start-up will fail and a file called `eula.txt` is created in the local folder.
6578

66-
The first time you do this, the start-up will fail expectedly - a file called `eula.txt` is created
67-
in the local folder, and before you start the server, you first need to accept its terms of use. Open
68-
this file and follow the instructions to accept the terms and conditions. Running the server again
69-
after doing this will succeed, and you should see the following messages on the terminal, showing
70-
that the process has completed successfully (timestamps will be different at the start of the lines):
79+
Before you start the server, you first need to accept its terms of use.
7180

81+
Open `eula.txt` and change `eula=false` to `eula=true`, or run:
82+
83+
```console
84+
sed -i 's/eula=false/eula=true/' eula.txt
7285
```
86+
87+
Running the server again after doing this will succeed, and you should see the following messages on the terminal, showing that the process has completed successfully (timestamps will be different at the start of the lines):
88+
89+
```output
7390
[00:40:50] [Server thread/INFO]: Starting minecraft server version 26.2
7491
[00:40:50] [Server thread/INFO]: Loading properties
7592
[00:40:50] [Server thread/INFO]: Default game type: SURVIVAL
@@ -96,6 +113,4 @@ You installed the open-source Java Runtime Environment on your instance, downloa
96113

97114
### Next step
98115

99-
With the server successfully running in the cloud, you will now open the necessary network ports to allow the Minecraft client to connect to your instance.
100-
101-
116+
With the server successfully running in the cloud, you will now open the necessary network ports to allow the Minecraft client to connect to your instance.
Binary file not shown.
68.2 KB
Loading

content/learning-paths/servers-and-cloud-computing/minecraft-on-oci/oci-instance-start.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,23 @@ weight: 2
77
layout: learningpathall
88
---
99

10-
## Starting an OCI A4 or A1 instance
10+
## Starting an OCI A1 instance
1111

12-
Once you have [created an OCI account](/learning-paths/servers-and-cloud-computing/csp/oci/)
13-
and verified that you can start an instance, you will create an Ampere powered A1 instance
14-
and connect to it with SSH to install the Minecraft Java server.
12+
Make sure you have an OCI account. If you need to create an account refer to
13+
[Getting Started with Oracle OCI](/learning-paths/servers-and-cloud-computing/csp/oci/).
14+
15+
Next, create an Ampere powered A1 instance and connect with SSH.
1516

1617
1. Log on to [Oracle Cloud](https://cloud.oracle.com)
1718
2. On the OCI dashboard, navigate to Compute -> Instances to start a new instance:
18-
![OCI Console Compute dashboard showing the Instances section#center](oci_compute_dashboard.png "Navigate to Compute -> Instances in the OCI dashboard")
19+
![OCI Console Compute dashboard showing the Instances section#center](oci_compute_dashboard.webp "Navigate to Compute -> Instances in the OCI dashboard")
1920
3. Click "Create instance", then:
2021
* Choose one of the availability domains offered to you with A1 instances available
2122
* Select "Change shape", and set the instance type to Ampere VM.Standard.A1.Flex:
22-
![OCI instance creation shape settings panel with VM.Standard.A4.Flex selected#center](oci_change_shape.png "Configure the VM instance shape to VM.Standard.A4.Flex")
23+
![OCI instance creation shape settings panel with VM.Standard.A1.Flex selected#center](oci_change_shape.webp "Configure the VM instance shape to VM.Standard.A1.Flex")
2324
* Beside the instance type, click the small black arrow to open options. Allocate 2 OCPUs
2425
and 12 GB of memory to your instance
25-
* Choose "Oracle Linux 9" or one of the other available images of your choice under "Change
26+
* Choose "Oracle Linux 9" under "Change
2627
image", then click Next
2728
4. Use the default security options, click "Next" to get to networking options
2829
5. Configure networking as follows:
@@ -33,20 +34,21 @@ and connect to it with SSH to install the Minecraft Java server.
3334
* Create an SSH key pair if you do not have one (and download both private and public keys),
3435
or upload the public key for an existing key pair so that you can connect to your instance
3536
over SSH once it is created
36-
5. Use default Storage options
37-
6. After verifying that the instance is correctly configured, choose "Create" to provision a new
37+
6. Use default Storage options
38+
7. After verifying that the instance is correctly configured, choose "Create" to provision a new
3839
instance
39-
7. It can take up to 2 minutes for your instance to be created. Once created, you need to ensure
40+
8. It can take up to 2 minutes for your instance to be created. Once created, you need to ensure
4041
that there is a public IP address to connect to by going to the "Networking" tab for the instance:
41-
![Instance details page with the Networking tab selected to show public IP details#center](oci_instance_networking.png "Select the Networking tab on your VM details page")
42-
8. Scroll down and click on the VNIC name - `instance-yyyymmdd-HHmm` by default - then on the IP
43-
administration tab, and click on the three dots on the primary IP row to edit the IP address type
44-
associated with the instance to set its type to "Ephemeral public IP":
45-
![OCI IP management page showing primary private IP and ephemeral public IP configurations#center](oci_network_ip_management.png "Edit IP Address to set type to Ephemeral public IP")
46-
47-
Take note of the IP address under "Public IP address". You should now be able to SSH into your
48-
instance with the command
49-
```
42+
![Instance details page with the Networking tab selected to show public IP details#center](oci_instance_networking.webp "Select the Networking tab on your VM details page")
43+
9. If you did not select "Automatically assign public IPv4 address" during instance creation, you
44+
will need to assign one manually. Scroll down and click on the VNIC name - `instance-yyyymmdd-HHmm`
45+
by default - then on the IP administration tab, and click on the three dots on the primary IP row
46+
to edit the IP address type associated with the instance to set its type to "Ephemeral public IP":
47+
![OCI IP management page showing primary private IP and ephemeral public IP configurations#center](oci_network_ip_management.webp "Edit IP Address to set type to Ephemeral public IP")
48+
49+
Take note of the IP address under "Public IP address". You should now be able to SSH into your instance with the command:
50+
51+
```console
5052
ssh -i <path to private key> opc@<public IP address>
5153
```
5254

@@ -56,4 +58,4 @@ You successfully provisioned an Ampere A1 virtual machine instance on Oracle Clo
5658

5759
### Next step
5860

59-
Now that your VM is running and accessible, you will proceed to install Java and download the Minecraft server software.
61+
Now that your VM is running and accessible, proceed to install Java and download the Minecraft server software.

0 commit comments

Comments
 (0)