- Do you want your Minecraft server to be public (anyone who learns your IP) or private (just you and your friends.)
- What mods you want to install. You'll need to read carefully to see if a mod is client side or client and server. If it's client and server, you'll need to make sure your friends download the same mod versions you have installed on the server. They'll obviously need to be using Minecraft Forge as well as that's what we're using on the server.
Definitions:x.x.x.x or Server: The Ubuntu 18.04 Server with Minecraft Server
y.y.y.y or Host: The IP of your computer with Minecraft game on it
z.z.z.z: IP(s) for friends you want to allow to play Minecraft on your server (optional for private server.)
Configuring the Minecraft Server
Installing Java 8
Verify Default Java VersionIf your openjdk version is not 1.8.0_191, type the below and select it from the list.
You'll need to accept the end user license agreement (EULA) so type the below.
After lots of text going by (look for anything in red which denotes an error) you'll know it's done and ready when you see text about preparing the spawn area and Unloading dimensions. The '>' is your Minecraft prompt.
NOTE: If you and your friends will only be connecting to your Minecraft server from your network (your house), then you can skip to Configuring a Static IP.
I'll walk you through how to do this on a Comcast modem as that's what I have. If you have something different, you'll need to do a little Googling, or call their tech support. If you happen to have an all-in-one modem with wifi built in, then this will be much simpler as you won't be dealing with two different subnets.
The easiest way is to now plug your Minecraft server directly into your Comcast modem. Then you need to check what IP address it gives you. Let's say it gave you 10.1.15.100, then the Comcast modem's web interface is going to be the same first three octets (10.1.15) with a '1' as the last octet. i.e. 10.1.15.1.
Assuming your IP was 10.1.15.100, in a browser, go to http://10.1.15.1. At the login page enter the following credentials:
- Username: cusadmin
- Password: highspeed
The first thing we want to do is figure out what your DHCP pool is so we can static the IP of your Minecraft server to an IP outside that range. Click on LAN on the left side and look at the DHCP Start IP and DHCP End IP. Let's assume these values are 10.1.15.10 and 10.1.15.199 respectively. We're going to want to pick an IP address either above or below that range. For purposes of this tutorial, let's go with 10.1.15.9 as the IP we want to give our Minecraft server.
On the left, click on Firewall, then at the top, click on the Port Configuration tab.
Click on the Add New button and enter the following information like the screenshot, replacing x.x.x.x with the IP of your Minecraft Server (we used 10.1.15.9 as an example previously).
Click on apply and give it a few moments to write the configuration. At this point, we're done with the modem and we will now move on to configuring the static IP on the Minecraft server.
Configuring a Static IP:On the Minecraft server, type the below:
NOTE: Consistent spacing is important. Everything below should line up the way it shows. eno1 is the name of my network interface, if yours is different, leave it alone.
If everything goes right, you should have no errors.
Configuring Universal Firewall (UFW):
Let's create a rule that says anyone on your home network with the Minecraft server on it is going to be able to connect and play.
Now, let's say you want your friends to be able to play from their house. Ask them to go to https://whatismyip.com and tell you the numbers after the text "Your Public IPv4 is:". Type the below command, replacing z.z.z.z with the IP they gave you. x.x.x.x is going to be the IP address you set up in Configuring a Static IP
Let's Test it Out!
Launch Minecraft on the host and go to Multiplayer
Then click on Add Server
Then Enter server information in the form of SERVER-IP:PORT. Port 25565 is the default port for the Minecraft server. Server name can be anything you want. Mine is called PCWize in the previous screenshot.
Click Done when finished. If everything is going right, you should see something like the PCWize entry two screenshots above.
Click on the little picture to the left of your newly added server and you should get spawned into a new world.
Your friends, if they are at their house, will need to put in your public IP address (go to https://whatismyip.com) and they'll put that in place of the x.x.x.x in the screenshot above.
Well, that should just about do it. Happy mining!