How to install and configure a super cool Minecraft server to be able to play and coding!


In this post we’ll have a look at how to install McMyAdmin, Minecraft Server, Forge and ComputerCraft to be able to run a full professional Minecraft Server to play with our friends and even to code in Minecraft!

Holidays time for many around the world, so what about something very much holidays orientated like some good game that still involves coding and playing with technology? So, let’s “uber expand” Minecraft! Why? Because it’s fun and because… we can 😉

What are we going to use to setup all this?

  1. CentOS 7.x Linux (64 bits) because we want to run our Minecraft server on an Enterprise grade System and have enough RAM to run some cool mods
  2. Mono (.NET) (64 bits)
  3. Java 8 sdk (64 bits)
  4. McMyAdmin 2
  5. Minecraft Server 1.8.9
  6. Forge for MC 1.8.9 (or visit Forge official WebSite for latest recommended)
  7. ComputerCraft for Forge and MC 1.8.9 (or visit ComputerCraft official Website for latest recommended)

Minimal Requirements:

Minecraft Server is cheap in terms of resources, but still requires some memory and few cores to run smoothly and allow you to use certain mods, so here is the minimal requirememnts:

  1. Quad core x86 64bits System (or dual core system with Hyperthreading enabled)
  2. Between 6 to 8 GB of RAM
  3. 20 GB disk space
  4. 1Gbps Network Card

– 1st Step: CentOS Installation

First off let’s install CentOS 7.x minimal. We’ll start from a minimal System to avoi dinstallation of stuff we don’t need and to make sure to reduce to the minimum Surface Security.

So, download CentOS Minimal ISO from the closer server to your place. If you want to create your uber Minecraft Server in a Virtual machine you can use KVM or VMware (there are also other choices out there but I haven’t tried them, so I can’t list them here).

Please Note: If you are going to create your Minecraft Server in a VMware Virtual Macine then CentOS 7.x comes already with vmware tools open source edition which I reccommend over the proprietary one provided by VMware hosts.

Install your CentOS without any graphic user interface, there is no need for this and if you install guis they will only such resources to your server in this case.

As you start your CentOS installation, Anaconda Installer will ask you to verify your DVD/ISO Images, please do that, because if you have downloaded them corrupted then most likely your installation will hang at some point, so you better check if you’ve got everything ina good shape before starting…

Once DVD/ISO Image test is done proceed with the System Installation and follow the instructions that will appear on the screen.

Default Disc partitioning is fine for this tutorial and remember to create a user non root called minecraft (with password of your choice).

Remember to assign a static IP to your Server. You can use DHCP (of course) but I reccommend to use static IP addresses with servers before something goes wild with your router and the Server gets a new IP and so you have to find it again in your LAN 😉

Choose Install Minimal System, because we want to really install the minimal possible set of RPMs here.

Once the installation is terminated boot your CentOS system and login with root privileges.

First thing to do at thi spoint is to enable EPEL, we’ll need some RPMs from there for the next steps, to enable EPEL repository type:

# yum -y install epel-release

Once done that let install wget and screen tool, we’ll need them later:

# yum -y install wget screen

And also let’s install java sdk 1.8.x because minecraft needs Java:

# yum -y install java-1.8.0-openjdk

If you want to administer your server using WEBMIN this is a good moment to add WEBMIN to your CentOS:

# yum -y install perl perl-Net-SSLeay openssl perl-IO-Tty

Create a yum .repo file to keep your WEBMIN up-to-date:

# vi /etc/yum.repos.d/webmin.repo

And add the following text:

[Webmin]
name=Webmin Distribution Neutral
#baseurl=http://download.webmin.com/download/yum
mirrorlist=http://download.webmin.com/download/yum/mirrorlist
enabled=1

Save and add webmin repo key:

# rpm --import "http://www.webmin.com/jcameron-key.asc"

And finally install webmin on your CentOS 7 Server:

# yum -y install webmin

Before you can connect to WEBMIN WEB GUI, you need to open port 10000 on FirewalID which is up by default on CentOS 7.

Open ports on a Firewal should be done carefully, so I reccommend to open ports for administrative services only internally, but for now let’s use the defualt active profile, so first of all check which profile is active:

# firewall-cmd --get-active-zones

On my tutorial example CentOS the default profile resulted to be “public”, so I’ll use this one in the next command, in case your CentOS display something different than pubblic (like dmz and such) please use the one your centos will display.

Let’s open WEBMIN port on FirewallID:

# firewall-cmd --zone=public --add-port=10000/tcp --permanent

And now let’s update the firewall:

# firewall-cmd --reload

At this point your Server is ready for the next steps and you can also fully administer it via WEBMIN WEB GUI.

– 2nd Step: Installing Mono (.NET)

To install Mono (.NET for Linux and such) it’s quite simple at this point:

# rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"

# yum-config-manager --add-repo http://download.mono-project.com/repo/centos/

# yum -y install mono-complete

If all commands succeed you will have Mono perfectly installed on your CentOS 7 Server.

– 3rd Step: Installing McMyAdmin 2

To install McMyAdmin 2 (still as root user):

# cd /usr/local

# wget http://mcmyadmin.com/Downloads/etc.zip

# unzip etc.zip; rm etc.zip

And now you can finally logout from root account and login with your minecraft user and then:

# wget http://mcmyadmin.com/Downloads/MCMA2_glibc26_2.zip

# unzip MCMA2_glibc26_2.zip; rm MCMA2_glibc26_2.zip

# screen -S minecraft

# ./MCMA2_Linux_x86_64 -setpass [YOURPASSWORD] -configonly

Where [YOURPASSWORD] is the administrative password you will use for access McMyAdmin WEB GUI.

At this point we need to open McMyAdmin WEB Port and also Minecraft Server Network port on FirewallID, so again using your active zone type:

# firewall-cmd --zone=public --add-port=8080/tcp --permanent

# firewall-cmd --zone=public --add-port=25565/tcp --permanent

And again let’s update the active firewall policies by using:

# firewall-cmd --reload

At thi spoint open McMyAdmin.conf with vi and edit few options that won’t be available on the WEB GUI.

# vi McMyAdmin.conf

first parameter to edit is

is IP address for your McMyAdmin web gui:

Server.Name=[yourservername.yourlocaldomain]
Server.Address=[your-minecraft-server-ip]:8080

Change [yourservername.yourlocaldomain] with the name of your server and your domain (if you have any), for example: minecraft.localdomain

Change [your-minecraft-server-ip] with your server IP Address, for example: 192.168.0.100

Then the Java JVM max memory for your Minecraft Server:

Java.Memory=6144

(in this example I gave Java 6GB of RAM for minecraft server, forge mods and all other mods you’ll want to add to your server)

Then edit the java VM type, usually McMyAdmin is configured to run java client, but to run a minecraft server you probably want to use java server, so:

Java.VM=server

Now last bits by adding java extra options:

Java.CustomOpts=-Xincgc -Xms1G -XX:+UseConcMarkSweepGC -XX:ParallelGCThreads=4 -XX:+AggressiveOpts

These are my default option, you may have a better set for your needs, however, ParallelGCThreads tells Java how many threads you want for your minecraft server, I usually assign one per Processor, so in my example I use 4 Processors. You can put there the number that will suit more your Server System configuration. If you are going to have many clients connected you probably want to run your server on a server system with many processors and use many threads to keep you rminecraft server responsive. If, instead you are going to be the only user or you and few friends of yours then 2 or 4 threads are more than enough.

Please Note: Java options depends on the specific JVM release you are running, so you may get some warning or even some error messages (in case of unsupported parameters). In these cases remove the wrong parameter.

Save and exit.

Ok now it’s time to fireup McMyAdmin by typing:

# screen -S minecraft

# ./MCMA2_Linux_x86_64

At this point check if no error messages have been displayed by McMyAdmin and if everything is ok you can proceed to connect to McMyAdmin WEB GUI and finish installation and configuration. To login in McMyadmin load you rinternet browser on your client system and go to the following URL:

http://[your-minecraft-server-ip]:8080/

insert your administrative account which is:

username: admin

password: the one you decided when you configured McMyAdmin above

Configure your Minecraft with all your favorite options and save the configuration. The important thing not to be changed is in the Configuration -> Server Settings -> Server type field leave the “Official” default parameter. Don’t try to Select Forge (as you may think you have to do).

The truth about McMyAdmin and Forge is that I rarely saw that option working fine. This can happen because usually releases of modules like Forge come after the latest Minecraft release and such, so I personally prefer to manage Minecraft release and Forge release manually and make sure they are ALWAYS allineed to avoid troubles.

DON’T START MINECRAFT Server yet…, when you’ve done configuring your minecraft you can get back at the terminal console to proceed with the next step.

– 4th Step: Installing Forge

To install forge on your Minecraft server please follow the instructions on this extra tutorial here.

– 5th Step: Installing ComputerCraft (and some other cool mods!)

When Forge is fully installed on your Server you can finally proceed to install ComputerCraft mod to add the Lua programming language to your Minecraft within the game!

To install ComputerCraft (and also get the latest release of it for your Minecraft) check out this tutorial here.

– 6th Step: Some extra Security consideration

Minecraft offer the possibility to let your Server be public and let all your friends to connect and play together, however exposing a server over the internet can be dangerous as it may offer Hackers an open door to access and control your home network.

So, I don’t recommend to run a Minecraft Server publicly. You have other solutions to make it possible for your friends from their home to join your Minecraft server at your place. We will cover them on another article in the future, so stay tuned!

That’s it, thanks for reading and, if you enjoyed this post, please support my blog by visiting my on-line hacking and engineering merchandise shop on redbubble.com by clicking here, thank you!:)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s