- Developer Tools
Matthew Fisher, March 5, 2013
Crafters and cloud users, rejoice! the CraftBukkit server has been recently deployed onto Stackato’s App Store, enabling users and ActiveState devs to start playing one of their favourite sandbox indie game on the cloud.
CraftBukkit, the free and open-source Minecraft server that has been developed and worked on by the Bukkit developers operates quite well on Stackato. This was made possible through a new feature in Stackato 2.8 called Harbor, a “port-forwarding-as-a-service” node that helps provide Bukkit an external IP for players to connect to. It also relies on the Persistent File System service so that the Minecraft world and any installed plugins can be saved on the server without having to rebuild your world every time you restart Bukkit.
This blog is a short tutorial so that you can start playing Minecraft on Stackato with little hassle. For this tutorial, we are going to be hosting a private Stackato instance on Amazon EC2, install the Bukkit server from the Stackato 2.8 app store, run the server, and start playing on a computer from home.
Bukkit and Stackato
The Bukkit application hosted on the Stackato-Apps repository relies on two services: Harbor and File System.
Harbor is a new feature introduced in Stackato 2.8 that provisions TCP, UDP, or dual TCP/UDP ports to an installed application. Bukkit relies on Harbor so that it can be run from an external TCP port, allowing users to connect and play on the server. Without Harbor, you could only host a Bukkit server, but nobody could play on it. What fun would a Bukkit server be without any players? You can read more about Harbor in the Stackato docs.
Stackato’s application containers are volatile and last only as the instance is running. When an application instance is stopped or restarted, all the data within these application containers is lost. For Bukkit, this normally spells bad news, because every time you have to restart the application, the files that save your world data are lost. Nobody wants to play on a Bukkit server that has no persistence (unless you like blowing things up)! That’s where the File System service comes into play. The Persistent File System service allows applications to store files that will not be deleted when the app is removed (as long as you don’t delete the service as well). The service also conserves space allocated within the container.
That’s Great, but How do I Start Playing Minecraft?
Here are some instructions on how to start playing Minecraft on an EC2 instance:
- To start, create an account on Amazon Web Services.
- Request access to Stackato AMI.
- Install the Stackato Command Line Interface, if you haven’t done so already.
- After creating your account, go to the AWS Management Console to start managing your Amazon EC2 instances.
- Set up your Stackato AMI on the EC2 platform. Please note that a Medium or larger instance is recommended to keep up with the processing needs to run a Bukkit server.
- Log into your EC2 instance and install Bukkit Server from the App Store, making sure to check “start app after installation.”
- After a few seconds, the app will start running. Even though it is running, Bukkit will take a little longer to start up before you can connect to the game, so give it about five minutes or so.
- Open the web application to get your connection details, log into your Minecraft client and enter the details found on the web interface.
- Connect and craft to your heart’s content.
Adding Plugins from BukkitDev
One of the great benefits that CraftBukkit has over the vanilla Minecraft server is the ability to use plugins. Software developers have created those plugins, using the API exposed by the Bukkit devs. For this example, I am going to install a popular Bukkit server plugin called WorldEdit, which allows you to manipulate blocks, create geometric shapes, or save instances of areas within Minecraft, and use them later. To install WorldEdit on your Bukkit server, we’ll need to do three things: install CraftBukkit, deploy the plugin into the /plugins folder, and then configure the server.
- Pull the bukkit-server from the GitHub repository.
- Using the Stackato CLI, target your Stackato cloud on your EC2 instance.
- Push the application by running:
stackato push -n
- Go to WorldEdit on BukkitDev, click on download, and it will go to the latest build. Right-click on the ‘Download’ link and click ‘Copy Link Location’ to get the URL of the ZIP file we want to download.
- SSH into your application instance by running ‘stackato ssh bukkit-server.’
- Type ‘ls -l’ to get a list of all the files, and their symbolic links. Take a note of the ‘plugins’ folder’s true location and change directories into the plugins folder (it will be something like ‘/app/fs/plugins’).
- Type ‘wget ’, let it download, and unzip it.
- Restart the Bukkit server to let the plugin load.
Configure the Server to Play Nicely
Now that we have WorldEdit running, we’re going to need administrative privileges to use this plugin. To do this, we’ll have to add ourselves to the Operators list. Here’s how:
SSH into the Bukkit app and type ‘ls -l’ to get a list of the symbolic links to all of the files. This time, we are looking for the ‘ops.txt’ file. It should be in a /data folder, held by the File System service (same as the plugins folder we configured earlier).
Change directories to the /data folder and add your Minecraft username into the ops.txt file.
Restart the bukkit server.
I hope you enjoyed this tutorial on how to install a Bukkit server on your Amazon EC2 instance. Enjoy crafting on your Stackato instance!
Subscribe to ActiveState Blogs by Email
Share this post: