FREE Minecraft Server Hosting on OpenShift (Tech Tip #15)

minecraft-logo

Are you looking for free Minecraft server hosting and invite your friends to join the party ?

If yes, then read on!

First some context …

bukkit-logo

Bukkit is a free, open source project that provides the API and runtime to extend Minecraft. It is one of the most popular ways to write Minecraft mods. Bukkit uses a more general terminology of “plugin” but essentially they are mods in Minecraft context. Developers write plugins using Bukkit API.

CraftBukkit is a mod for the Minecraft server that implements Bukkit API. Developers can download CraftBukkit JAR for a particular version of Minecraft and use it to run a Minecraft server. This allows plugins, or mods in Minecraft parlance, written using Bukkit API to be installed in the CraftBukkit server.

Tech Tip #7 introduced OpenShift – Red Hat’s PaaS platform.

OpenShift-logo

This tip will show how to host a CraftBukkit server on public PaaS (sign up for free) version of OpenShift.

  1. Install OpenShift client tools. For simplicity, Mac commands are given below:
    sudo gem install rhc
    rhc setup

    Note, you need to use MRI Ruby, not JRuby. Install RVM to manage different versions of Ruby on your machine. For example, install Ruby 2.1.0 as:

    rvm install ruby-2.1.0

    And set the default Ruby version using:

    rvm default ruby-2.1.0
  2. Create OpenShift DIY application as:
    rhc app-create craftbukkit diy --from-code=git://github.com/jyeary/openshift-craftbukkit-quickstart.git

    This command uses an OpenShift QuickStart, created by John Yeary, to create an OpenShift application. CraftBukkit JAR is downloaded and Minecraft server is started using it by the time application is ready.

    Note, a free account gives 3 small gears where each gear is 512 MB RAM and 1GB of disk space. Minecraft wiki recommends 512 MB of RAM and 2GB of disk space for 6-10 players.

  3. As mentioned in Steven Citron-Pousty’s blog:At this time, OpenShift is primarily a HTTP server platform – we proxy HTTP calls but no other protocols. In addition, we only expose ports 80 (HTTP), 443 (HTTPS), and 22 (SSH) to the outside world from your gear. While we can start up Minecraft Server on any port we want (and tell the client to listen on that port), the Minecraft server and client do not talk HTTP so we can not proxy the calls. To get this to work we are going to have to SSH port-forward either from your laptop to the server or vice versa (both configurations are supported on OpenShift).So lets forward a port from our local machine to the Minecraft server port on OpenShift using the following command:
    rhc port-forward craftbukkit

    This should show an output something similar to as shown:

    Checking available ports ... done
    Forwarding ports ...
    
    To connect to a service running on OpenShift, use the Local address
    
    Service Local                OpenShift
    ------- --------------- ---- --------------------
    java    127.0.0.1:25565  =>  127.13.137.129:25565
    
    Press CTRL-C to terminate port forwarding

    And now you are ready to connect your Minecraft client.

  4. Login to OpenShift using the command:
    rhc ssh craftbukkit

    Change the directory to view Miencraft logs as:

    cd $OPENSHIFT_DIY_LOG_DIR

    Read through server.log file in that directory to check the Minecraft server version. Its 1.7.2 as of this writing and shows a message like:

    Starting minecraft server version 1.7.2

    Now run Minecraft launcher and select the matching version as explained in this video. Click on Play to start the game.

    Now click on Multiplayer:

    tt15-minecraft-multiplayer

    Click on Add Server and specify the server details as:

    tt15-craftbukkit-openshift-server

    Click on Done. Select the recently added server and click on Join Server:

    tt15-join-server

    And now you are playing a CraftBukkit server hosted on OpenShift.

  5. Set up the administrative player (or operator in Minecraft parlance) by following the instructions here.

Minecraft is a lot more fun when played with other friends. The instructions above allow you to host a server and be the operator. The following instructions are needed on each player who wants to join the same server:

  1. Install and setup RHC
    gem install rhc
    rhc setup
  2. The following steps need to be done by the player hosting the server.
    • Each player’s public key (typically in .ssh directory and file named id_rsa.pub) needs to be added to the domain hosting the server. This can be done at https://openshift.redhat.com/app/console/settings.
    • Each player’s OpenShift account (email id) needs to be added to the domain hosting the server (for example: https://openshift.redhat.com/app/console/domain/milestogo)
  3. For Windows machines only: Download Putty (used for ssh shell verification) and PuttyGen (used for importing the id_rsa key so that it can be recognized by Putty). Import the id_rsa key using PuttyGen as explained here.
  4. Port forward using the following command:
    rhc port-forward -n milestogo -a craftbukkit

And now the players can connect to the same server using the multiplayer setup instructions explained above!

Note that even though server requirements for Minecraft state that 6-10 players can join in 512 MB of RAM but practically speaking only 2 players could play in this much memory. More memory can always be added to your existing account by signing up for Silver Plan.

minecraft-steve

Happy minecrafting!

Be Sociable, Share!
  • Tweet
This entry was posted in java, techtip and tagged , . Bookmark the permalink.

7 Responses to FREE Minecraft Server Hosting on OpenShift (Tech Tip #15)

  1. Marl Gems says:

    Hi, I have noticed that sometimes this webpage renders a 404 server error. I figured that you would like to know. Thanks

  2. rank well says:

    Hey there. Thanks for the good article. Perfectly timed guidance just like what I’m trying to find a
    very long time. Lucky to find this article and I am going to share it on some social media platforms.
    I’ve bookmarked this too for future reference as well.
    Sustain the great work.

  3. adriel wilson says:

    Really a nice post … For free minecraft server hosting visit http://minecraftserverhostingservices.blogspot.in/2014/04/free-online-minecraft-server-hosting.html

  4. serwery minecraft 1.7.2 says:

    I am curious to find out what blog system you have been working with?
    I’m experiencing some small security issues with my latest blog and I’d
    like to find something more risk-free. Do you have any solutions?

  5. Romain Romain says:

    How do you install plugins on it ?! Bukkit is useless if you can’t use plugins on it !

  6. arungupta says:

    Romain,

    You’ve access to the shell running Bukkit so can install plugins that way ?

  7. shisha pens for sale bradford says:

    Halo Premium All USA created e-liquid is right
    here. Technically, inhaling nicotine vapor isn’t
    smoking. The Blu Cig Review introduces you to the brand
    of Blu electronic cigarette.

Leave a Reply

Your email address will not be published. Required fields are marked *


three + 8 =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>