Host a Minecraft Server
Minecraft + DreamCompute
The internet is a wonderful tool with many magical places to visit. One crowd favorite is the world of Minecraft. If you wish to control your own virtual world, then follow along as I help guide you through setting up a Minecraft server on DreamCompute.
Watch out creepers!
Minecraft Server Quick Setup Guide
For those who are impatient, here are the steps required:
- Launch Ubuntu-14.04 image (lightspeed).
- Add security group rules (TCP 25565).
- Install required software (apt-get -y install wget screen openjdk-7-jre-headless)
- Download Minecraft Server (wget https://s3.amazonaws.com/Minecraft.Download/versions/1.8.9/minecraft_server.1.8.9.jar -O mcserver.jar).
- Agree to the EULA (echo ‘eula=true’ > eula.txt).
- Run Minecraft Server (java -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -d64 -Xms512M -Xmx2G -jar mcserver.jar).
The best way to level up your productivity at work? Gamify it!
Minecraft Server Walkthrough
For the more patient-minded out there, you will be rewarded with wonderful technical talk about what is going on in each step!
1. Create a Security Group
First, let’s create the security group bits we need. Click on the “Access & Security” section on the left of the dashboard, then click the “Create Security Group” button. We’ll call our security group “minecraft” and give the description of “minecraft”.
2. Manage Rules
Next, click the “Manage Rules” button next to the “minecraft” security group we just created. Finally, click the “Add Rule” button and add an ingress TCP rule allowing port 25565.
Next, we need to make a VM for our server. We’ll use Ubuntu-14.04, but anything that runs Java should work equally well. After clicking “Launch Instance” in the DreamCompute dashboard, give your server a name, select a boot type, select a flavor (lightspeed has 4GB of RAM which is a good starting point), and choose the Ubuntu-14.04 image.
After these things are set, select the “Security Groups” section and click the plus-sign button next to “minecraft” (the security group we created). Last but not least, click on the “Configuration” section and paste the bash script below.
One thing worth mentioning here is the “-Xms512M -Xmx2G”. These tell Java the minimum memory to use (-Xms512M) and the maximum allowed memory (-Xmx2G). If you select a flavor other than lightspeed, these values may not be appropriate.
#!/bin/bash apt-get update && apt-get -y install wget screen openjdk-7-jre-headless su - dhc-user -c 'wget https://s3.amazonaws.com/Minecraft.Download/versions/1.8.9/minecraft_server.1.8.9.jar -O ~/mcserver.jar' su - dhc-user -c 'echo 'eula=true' > ~/eula.txt' su - dhc-user -c 'screen -S mcserver -d -m java -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -d64 -Xms512M -Xmx2G -jar mcserver.jar'
Now click the “Launch” button. In a couple minutes, your server will be online with the Minecraft server software installed and running!
Keep your notes neat and organized while you code — it’s possible! — with these 6 tools.
At this point, you should be able to add your server to your client by clicking “Multiplayer”, then “Add server”, then giving it a name of your choosing and providing the IPv4 address assigned to your VM.
Now you have a very basic Minecraft server running in the cloud. Minecraft servers have a plethora of customizations (mods) available if you want to trick yours out.
One last thing to note is that you can log in to your server (via ssh) as ubuntu and there should be a server.properties file that you can edit to modify the default server settings (things like MOTD and max allowed players).
Ready to build your (Minecraft) castle in the sky? DreamHost can help.
Let us know in the comments below!