A system to dynamically launch DigitalOcean droplets as Minecraft servers if people are trying to connect, and creates a snapshot and destroys the droplet when there's nobody on the server to save running costs. A "launch on demand" model similar to toffer/minecloud, except instead of using a web browser, everything can be interacted with through the Minecraft multiplayer server list.
You can see the status of the server on the server list, and connect to it if it's not running to start it. It has an intelligent reverse proxy which automatically routes connections based on hostnames, essentially VirtualHosts for Minecraft allowing you to run and manage multiple severs routed through a single server/IP address. The reverse proxy can provide helpful error messages if issues occur, and is able to detect issues on its own and put up an "unavailability" warning for users trying to connect.
No web browser is required as it is controlled by people trying to connect, and configuration is done through .json files, so no database required either. Configuration is live reloaded and is automatically applied when they are changed, which allows for zero downtime modifications, even people who are already connected and playing on the server won't disconnect.
Everyone's IP addresses will appear to be the same in the logs of the back end server due to the front end server acting as a reverse proxy. This means you effectively cannot IP ban players, unless you do so through the use of the front end server's firewall. Unfortunately at this time, people's IP addresses are not recorded anywhere.
Grab the binaries from releases, or run go get github.com/1lann/dynamicserver/reverse_proxy
for the "front end" reverse proxy, or go get github.com/1lann/dynamicserver/backend
for the "back end" helper to be installed in your $GOPATH/bin
folder.
The front end server is what people will connect to start the servers and route them, and is also manages the droplets running the back end servers. Note that the front end server should be running 24/7, and requires very little resources. You can run it on a droplet you already run 24/7, or use a 512 MB droplet which only costs $5/month.
config.json
.reverse_proxy
front end software and make sure it's in the same directory as config.json
reverse_proxy
. You may want to add it as a service to run on boot.The back end server is what the actual Minecraft server is running on. You need to repeat these steps for every Minecraft server you wish to setup.
{name}-automated
where you replace {name}
with the name you chose in your front end's configuration file. For example if I had "name": "vanilla",
in my configuration file, the droplet would be called vanilla-automated
.config.json
.backend
software onto the server and make sure it's in the same directory as config.json
./path/to/backend >> /path/to/backend.log 2>&1 &
to /etc/rc.local
, which also writes logs to /path/to/backend.log
.backend
, which should also start your minecraft server, and see if it is recognised by the front end server by adding the server's hostname to your Minecraft server list.Need help? Have any questions or queries? Want to give praise, criticism, or feedback? Feel free to email me at me@chuie.io with anything, or create a new GitHub issue.
dynamicserver is licensed under the MIT license that can be found here.