From Desktop to Server – How Minecraft Taught Me Server Administration

Has anyone here ever played Minecraft? I’m finding many people of the older generation take one look at the game and immediately are put off by it. They can’t even admit that they play it unless it’s “with their kids”, and even then they make it sound like an annoying thing they do out of obligation. It’s almost as if the game’s not all that great, but they play it “because their kids like it”. I find this very interesting seeing as Minecraft to me would appeal to people of an older generation a lot more than the younger one. If the majority of farmville players are middle-aged women, then why wouldn’t more middle-aged people be interested in this game? It’s a sandbox game full of things you can do… explore, fight, collect, build, craft, farm, breed animals, discover… and some of these you can do while you’re doing other ones. What’s with the “I’m too cool for this” attitude I keep seeing?

Ah well, that’s a debate for another time. I’ll never understand why so many older generations are so put off by Minecraft…

I initially started a minecraft server on a Windows desktop. You start by running it on Windows, and seeing it in action. Naturally, you don’t want minecraft eating up resources you’d rather be using to play the game, so you want it on another dedicated place.

I had to have it on a dedicated server. I had already set up a webserver on a repurposed dell desktop tower, so I figured “I have a machine I can do it on, and you never know, this might be fun! I get to learn how to do something… in linux!” I didn’t need the server to be up all the time… just up while my friends and I all played together. Even my website didn’t need to be up all the time as far as I was concerned. I started it just like I did the Windows server: double-click on the jar, watch it appear.

This was the minecraft server for quite a few weeks. If there were any problems, I’d use vnc to remote to the desktop and fix it.

After playing with my friends for a while, they mentioned the server was just a BIT laggy… and the performance was shifty, with some days being better than others. Some of that could be attributed to the fact that we were playing on minecraft right after the halloween beta 1.3 update, so survival multiplayer was still kinda new…

By this point, I’d learned everything there was to learn with regards to running linux through a command line, as well as the services that needed to run. All the training of the webserver taught me that. I knew if I wasn’t devoting so many resources towards the graphical desktop environment, the server would run better. And so, I made a pretty monumental decision: do away with Ubuntu Desktop, and deploy Ubuntu Server. Ubuntu Server is completely command-line-based, so there is no graphical user interface (unless you bother to download one, but really… why?).

The first thing I learned was SSH. What is SSH? Secure Shell… Previously, I was using VNC to bring up a remote desktop session of the Ubuntu desktop. Now I no longer have a desktop… just a command line. SSH is what you use to remotely gain access to the server’s command line interface. PuTTY is a great example of a commonly used ssh client. A black window pops up, and white text displays. Now you can run commands on your server through this terminal as if you were typing it right into the physical server machine itself. At this point, I don’t even need a computer monitor for the server, thus granting it a term I read called “headless”.

The next challenge I had was running the server. Thankfully, minecraft.net posted the command that needed to run, but the problem is that I had no way of getting back to the server’s command window once I’d closed the session.

Some googling later, and I found a perfect solution: Screen.

Specifically, how to run minecraft using screen.

Needless to say, the minecraft server ran much better.

I had one other problem though… If I ever had to reboot the machine (or if there was a power flicker in the middle of the night), I had to go into the server and manually start it. I wanted the server to always start the minecraft server every time it turned on.

Some googling later, and I learned a new solution: Crontab.

Crontab allowed me to specify commands that run at certain times of the day, or at the system boot time.

Just in trying to get minecraft to run on a dedicated machine efficiently, I learned how to remote to the machine using secure shell, how to run commands and services inside a screen window that I can access any time I want, and how to run commands at startup so I didn’t have to worry about it or remember all of what needs to run at startup.

These things are all easy to google… ‘linux set up ssh’, ‘linux set up automatic start’. Ubuntu is amazing for learning things because of how massive the community is. I’ve never run into an issue someone hasn’t had before, and never one that hasn’t been fixed. Learning about ssh quickly turned into learning about using filezilla to transfer files back and forth to the server, and what the hell sftp was.

And in the end, what did I get from all of that? A minecraft server my friends and I use, and a configuration that makes all of it easy for me to manage. That and the satisfaction of saying “and I got it all running in linux!”.