• Stars
    star
    200
  • Rank 195,325 (Top 4 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 9 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A buildpack for running a Minecraft Server on Heroku

Heroku Minecraft Buildpack

This is a Heroku Buildpack for running a Minecraft server in a dyno.

Deploy to Heroku

Usage

Create a free ngrok account and copy your Auth token. Then create a new Git project with a eula.txt file:

$ echo 'eula=true' > eula.txt
$ git init
$ git add eula.txt
$ git commit -m "first commit"

Then, install the Heroku CLI. Create a Heroku app, set your ngrok token, and push:

$ heroku create
$ heroku buildpacks:add heroku/python
$ heroku buildpacks:add heroku/jvm
$ heroku buildpacks:add jkutner/minecraft
$ heroku config:set NGROK_API_TOKEN="xxxxx"
$ git push heroku master

Finally, open the app:

$ heroku open

This will display the ngrok logs, which will contain the name of the server (really it's a proxy, but whatever):

Server available at: 0.tcp.ngrok.io:17003

Copy the 0.tcp.ngrok.io:17003 part, and paste it into your local Minecraft app as the server name.

Syncing to S3

The Heroku filesystem is ephemeral, which means files written to the file system will be destroyed when the server is restarted.

Minecraft keeps all of the data for the server in flat files on the file system. Thus, if you want to keep you world, you'll need to sync it to S3.

First, create an AWS account and an S3 bucket. Then configure the bucket and your AWS keys like this:

$ heroku config:set AWS_BUCKET=your-bucket-name
$ heroku config:set AWS_ACCESS_KEY=xxx
$ heroku config:set AWS_SECRET_KEY=xxx

The buildpack will sync your world to the bucket every 60 seconds, but this is configurable by setting the AWS_SYNC_INTERVAL config var.

Connecting to the server console

The Minecraft server runs inside a screen session. You can use Heroku Exec to connect to your server console.

Once you have Heroku Exec installed, you can connect to the console using

$ heroku ps:exec
Establishing credentials... done
Connecting to web.1 on ⬢ lovely-minecraft-2351...
$ screen -r minecraft

WARNING You are now connected to the Minecraft server. Use Ctrl-A Ctrl-D to exit the screen session. (If you hit Ctrl-C while in the session, you'll terminate the Minecraft server.)

Customizing

ngrok

You can customize ngrok by setting the NGROK_OPTS config variable. For example:

$ heroku config:set NGROK_OPTS="--remote-addr 1.tcp.ngrok.io:25565"

Minecraft

You can choose the Minecraft version by setting the MINECRAFT_VERSION like so:

$ heroku config:set MINECRAFT_VERSION="1.18.1"

You can also configure the server properties by creating a server.properties file in your project and adding it to Git. This is how you would set things like Creative mode and Hardcore difficulty. The various options available are described on the Minecraft Wiki.

You can add files such as banned-players.json, banned-ips.json, ops.json, whitelist.json to your Git repository and the Minecraft server will pick them up.

Adding New Minecraft Versions

Please submit Pull Requests to etc/files.json

Using the Buildpack from source

If you want the bleeding edge version of this buildpack run:

$ heroku buildpacks:remove jkutner/minecraft
$ heroku buildpacks:add https://github.com/jkutner/heroku-buildpack-minecraft

More Repositories

1

guard-jruby-rspec

RSpec on JRuby without the startup cost.
Ruby
62
star
2

spring-boot-multi-tenancy

Java
52
star
3

saferegex

A tool for testing regular expressions for ReDoS vulnerabilities.
Java
49
star
4

heroku-metrics-spring

Java
39
star
5

mjruby

A new jruby launcher built with mruby-cli
Ruby
21
star
6

heroku-buildpack-ngrok

Shell
18
star
7

torquebox-remote-deployer

Deploy TorqueBox Knob files to a remote server with ease
Ruby
17
star
8

get_back

Easy Background Jobs for JRuby
Ruby
14
star
9

jruby-trinidad-heroku

An example of a Rack application for dpeloyment on JRuby, Trinidad and Heroku
Ruby
13
star
10

heroku-buildpack-skinny

Shell
10
star
11

lein-jruby

A Leiningen plugin for running JRuby commands.
Clojure
9
star
12

aws-lambda-buildpack

Shell
8
star
13

minecraft-buildpack

Shell
7
star
14

heroku-buildpack-ssh

Shell
7
star
15

warbler-exec

Allows execution of commands from a Warbler WAR file
Ruby
6
star
16

dm-is-temporal

DataMapper plugin implementing temporal patterns
Ruby
6
star
17

sbt-rubygems

Scala
5
star
18

heroku-java-docker

Shell
5
star
19

heroku-buildpack-play2

Shell
5
star
20

ratpack-jruby-example

Ruby
5
star
21

jipsy

Java
5
star
22

ruleby-tmbundle

A TextMate Bundle for Ruleby
4
star
23

hazelcast-heroku-discovery

Hazelcast Discovery Plugin for Heroku Private Spaces
Java
4
star
24

jruby-async-servlets-example

Ruby
4
star
25

sshd-buildpack

SSH Server Buildpack
Shell
4
star
26

heroku-buildpack-wildfly

Shell
3
star
27

web-tty-buildpack

Shell
3
star
28

graal-buildpack

Shell
3
star
29

ngrok-buildpack

secure tunnels for your containers
Shell
3
star
30

adoptopenjdk-buildpack

Heroku Buildpack for AdoptOpenJDK binaries
Shell
3
star
31

jshell-demo

3
star
32

heroku-jdbc

Helper library for parsing Database URL into JDBC connection
Java
3
star
33

no-secrets-buildpack

Shell
3
star
34

HerokuAndroidExample

Java
2
star
35

torquebox-messaging

A patched version of the torquebox-messaging gem (so i don't have build torquebox)
Ruby
2
star
36

activator-sbt-bug

Scala
2
star
37

spring-boot-android-service

Java
2
star
38

opencv-java-leak

Shell
2
star
39

warbler-sinatra-example

Warbler Sinatra example that's ready to run on Heroku
Ruby
2
star
40

heroku-jmx

JavaScript
2
star
41

heroku-jenkins-scala-example

Scala
2
star
42

jkutner.github.com

CSS
2
star
43

mruby-jvm

C
2
star
44

trinidad-resque-error

Ruby
1
star
45

heroku-buildpack-jmx

Shell
1
star
46

torquebox-no-op

Ruby
1
star
47

cnb-registry-api-rails

Ruby
1
star
48

jhipster-gateway-sample

Java
1
star
49

scalagate

Scala
1
star
50

hello-world-buildpack

Cloud Native Buildpack example
Shell
1
star
51

TORQUE-682

sample app to reproduce TORQUE-682
Ruby
1
star
52

tb_selector_bug

Example of a bug with TorqueBox selector
Ruby
1
star
53

blog

CSS
1
star
54

terraform-buildpack

Installs Terraform CLI in a container image
Shell
1
star
55

buildpacks-orb

Shell
1
star
56

healthyprog

The Healthy Programmer
HTML
1
star
57

maven-settings-example

Java
1
star
58

travis-heroku-scala-example

Scala
1
star
59

bpregistry

Go
1
star
60

ibm-jdk

Shell
1
star
61

embedded-jruby-example

Ruby
1
star
62

trinidad-dbpool-example

Ruby
1
star
63

heroku-buildpack-jdwp

Heroku Buildpack that allows remote debugging of a Java process
Shell
1
star
64

jvm

Shell
1
star
65

jruby-ratpack-async-demo

Ruby
1
star
66

dominion-dukes

Algorithms for purchasing Dukes in the best order
IDL
1
star
67

launch-buildpack

Shell
1
star
68

watch-service

Java
1
star
69

td-resque-hang

Reproduce a trinidad_resque bug
Ruby
1
star
70

jruby-ratpack-books-example

Ruby
1
star
71

torquebox-remote-deploy

Deploy TorqueBox Knob files to a remote server with ease
1
star
72

libcnb.bash

A library for common buildpack functions
Shell
1
star
73

asterism

JRuby Concurrency with Akka
Ruby
1
star
74

trinidad-resque-warbler

Only able to get trinidad_resque_ext working when warbler is loaded
Ruby
1
star
75

fll-crab-2018

HTML
1
star
76

spring-break-cve-2017-8046

This is a Java program that exploits Spring Break vulnerability (CVE-2017-8046).
Java
1
star
77

win-java-vms

Tools for creating a Windows VM preloaded with Java, Git, Zip and Heroku toolbelt
Shell
1
star
78

jruby-netty-example

Ruby
1
star