|
| 1 | +--- |
| 2 | +title: Connecting the Minecraft client to the server |
| 3 | +weight: 4 |
| 4 | + |
| 5 | +### FIXED, DO NOT MODIFY |
| 6 | +layout: learningpathall |
| 7 | +--- |
| 8 | + |
| 9 | +## Connecting the Minecraft client to the server |
| 10 | + |
| 11 | +### Opening the port for the Minecraft server |
| 12 | + |
| 13 | +Before we connect to the Minecraft server, we will change the network policy to allow clients to |
| 14 | +connect to the Minecraft server over TCP port number 25565. To do this, we need to modify the |
| 15 | +networking settings for our instance in the OCI dashboard. |
| 16 | + |
| 17 | +1. On the OCI Instances page, choose your Minecraft server instance. |
| 18 | +2. In the Networking tab, click on the subnet name: |
| 19 | +  |
| 20 | +3. On the Security tab of the subnet page, choose the security list which is active for the instance |
| 21 | + (by default, this is called "Default Security List for vcn-xxxxxxxx") |
| 22 | +  |
| 23 | +4. Under "Security rules", add a new Ingress rule (this means the rule applies to incoming traffic |
| 24 | + from outside the instance). Set "Source CIDR" to "0.0.0.0/0" (this means all IP addresses can |
| 25 | + connect), and set the "Destination Port Range" field to 25565. |
| 26 | +  |
| 27 | + |
| 28 | +You will also need to update your local firewall to allow connections to port 25565 on your instance. |
| 29 | +Reconnect to your instance with SSH, and run the following commands on Oracle Linux: |
| 30 | +``` |
| 31 | +sudo firewall-cmd --permanent --add-port=25565/tcp |
| 32 | +sudo firewall-cmd --reload |
| 33 | +``` |
| 34 | +or the following commands on Ubuntu: |
| 35 | +``` |
| 36 | +sudo ufw allow 25565/tcp |
| 37 | +sudo ufw reload |
| 38 | +``` |
| 39 | + |
| 40 | +You should now be able to run your Minecraft server on the OCI instance, then start your client, log in as |
| 41 | +usual, and connect to your brand new server! |
| 42 | + |
| 43 | +### Connecting to the server from the Minecraft client |
| 44 | + |
| 45 | +1. Start your Minecraft client and log in as usual. |
| 46 | +2. Choose "Multiplayer" mode - read and click through the warning that third party servers are not operated |
| 47 | +by Mojang. |
| 48 | +3. To add your server to the menu of available servers, choose "Add server", name your server |
| 49 | +something meaningful ("My OCI server" for example) and put the IP address of your instance into the |
| 50 | +"Server Address" field: |
| 51 | +  |
| 52 | + |
| 53 | +You can now join the server and start building! |
| 54 | +  |
| 55 | + |
| 56 | +You can also share the address with your friends to start building a shared world. Have fun! |
| 57 | + |
| 58 | + |
| 59 | + |
0 commit comments