Minecraft is a sandbox-type game where you gather materials and use them to create things, which is about as understated a description as "the sun is a big bright light in the sky." The poster child for indie gaming success, Minecraft began as a basement coding project by hat-wearing Swede Markus Persson in 2010; it has since become a bona fide phenomenon.

In Minecraft, you play a mute protagonist in an unending retro-blocky landscape populated by lots and lots of NPCs, with no traditional adventure game-type goal other than survival. This seems easy at first. When the game begins, you invariably find yourself on a sandy beach somewhere, and a bit of experimentation quickly yields the knowledge that you can affect your environment by punching things. You can punch trees to break them apart and collect wood, for instance, which you can use to make tools, which you can use to gather more materials, which you can use to make more things. You'll just be getting the hang of the basic mechanics when night falls—and the zombies and skeletons and spiders and creepers come out to collect your soul.

As the game grew more popular, Persson (known to fans by his in-game handle "Notch") hired staff and eventually turned over daily programming duties to other folks. These days, Notch spends his days developing other games and being interviewed by famous Internet journalists, while Minecraft thrives on multiple platforms including PC, Mac, Linux, and XBox 360.

The game has an engrossing single-player component, with a core gameplay mechanism that feels like a LEGO block set—go build stuff!—but it's much more fun to make things with your friends than to labor alone. Public Minecraft servers are widely available (here's a good list), but they have an unfortunate dark side: as with any public online game, keeping out folks bent on making mischief is ultimately impossible. If you want to play Minecraft with just your friends, the easiest way to do so is to run your own server.

Your first choice, should you go this route, is whether you want to use a managed hosting provider, use a regular non-Minecraft host, or just run the server yourself. Each option has tradeoffs. Choosing to use a fully managed Minecraft host like Servercraft or BeastNode means that you'll be up and hosting within minutes of forking over your credit card number, but you may have less control.

A non-Minecraft Web host, like a virtual private server from A Small Orange, might cost more, but it gives you additional flexibility in configuration (what if you want to add mods or tweak things later, or install additional server software?).

Finally, hosting the code yourself on a dedicated server in your closet is the most complex option, but can also be the cheapest and most flexible, assuming you have spare hardware lying around. For smaller Minecraft instances where you expect to only have a couple of players—for example, if you just want to play Minecraft with your kids—you can even run the server on your main computer without needing a separate piece of hardware.

In this guide, bits of which have appeared on my personal blog over the last few months, we will walk through some fairly generic instructions which should apply to both a VPS and self-hosting. After that, we'll move on to more advanced options that you can implement to spice up your Minecraft hosting experience. We're going to burn more words talking about how to make this all work with Linux than with other operating systems, since Linux is the most common option for hosting; if you're using a VPS, you'll almost certainly be using Linux, and if you're hosting out of your home, that's probably what you should use as well. However, don't feel left out if you want to get a Minecraft server running on Windows or OS X—we'll include you, too!

One quick note: this guide assumes that you're interested in running a Minecraft server because you're already a Minecraft player. We're not going to spend any time explaining how to actually download and set up the Minecraft client, nor will we talk about Minecraft basics like gameplay or strategy. This guide is long enough as it is!

Quick start

The Minecraft server binaries can be downloaded from the same page as the full game. The server package is free and available as either a Windows executable or a Java .jar file for Linux and OS X (and for Windows, too, if you don't want the executable version). Grab whichever one you need.

Windows users have it easiest: simply download the executable and run it. If you don't have a Java runtime environment installed, the executable will direct you to a download page where you can get it; once installed, re-run the Minecraft server binary. This gets you a Minecraft server up and available on TCP port 25565. Connect to it with your Minecraft client and explore your shiny new world.

To run Minecraft on OS X and Linux, you'll also need a Java runtime environment installed. For OS X, you can quickly install the latest Apple-approved version of Java by opening a Terminal window (click the Spotlight icon, type " terminal ") and executing the command " java ". If you don't already have Java installed, OS X will automatically grab it for you.

On a Debian-derived flavor of Linux like Ubuntu or Mint, the OpenJDK Java project is available from the default repositories and can be installed with a quick sudo aptitude install openjdk-7-jre (yes, we're using aptitude instead of apt-get , and so should you! Aptitude is available by default in Ubuntu server, but you might have to install it via apt-get for the desktop version). If you feel like you need the actual, genuine, Oracle-produced Java runtime environment instead of OpenJDK, you need to follow a few more steps.

With Java installed, you can immediately start your Minecraft server by opening a terminal window and invoking it with:



$ java -Xmx1024M -Xms1024M -jar /path/to/minecraft_server.jar nogui



That's it—just like your PC brethren, you're up and running with a Minecraft world available on port 25565.

The first time you start your Minecraft server, it checks for any existing Minecraft world and configuration files. If it doesn't find any, it creates everything it needs. In a fresh install, you'll end up with a world directory containing the newly generated Minecraft map, some configuration files, and a log file. If you plan on running Minecraft under a dedicated Minecraft user account, like on a real server, you might want to pre-create that account before firing up the server, though it's not strictly necessary to do so. (We'll cover how to move the Minecraft directory shortly.)

Now it's on to the fun stuff: tweaking your server.