Skip to content

Pentagrade/balena-minecraft-server

 
 

Repository files navigation

Balena Server Logo

A Minecraft server for the Raspberry Pi 4

Starter project enabling you a Minecraft Server using just a Raspberry Pi.

This project has been tested on and Raspberry Pi 4 B 4GB. I do not recommend using a Raspberry Pi 3 or deeper. They have not enough RAM and power to calculate all the things. 💥

Why balenaMinecraftServer?

  • It works out of the box, just start it and it just works. 👍
  • You can play anywhere. You can take the Pi to a friend, connect to his Wifi and enjoy playing. 🎮
  • It is free. No costs, no big server and no complication. 🆓
  • Why hosting on a computer? A Pi is power efficient! 🚀
  • You can easy maintain the files on the Pi by using your PC. 💻

Hardware required

  • Raspberry Pi 4B ( We recommend the 4GB model. 1GB is not enough! )
  • A 16GB or greater micro SD Card (we always recommend SanDisk Extreme Pro SD cards)
  • Power supply

Software required

Setup and use 🌠

To run this project is as simple as deploying it to a balenaCloud application; no additional configuration is required.

Setup the Raspberry Pi 💿

  • Sign up for or login to the balenaCloud dashboard
  • Create an application, selecting the correct device type for your Raspberry Pi
  • Add a device to the application, enabling you to download the OS
  • Flash the downloaded OS to your SD card with balenaEtcher
  • Power up the Pi and check it's online in the dashboard

Deploy this application ✈️

  • Install the balena CLI tools
  • Login with balena login
  • Download this project and from the project directory run balena push <appName> where <appName> is the name you gave your balenaCloud application in the first step.

Connect to the server 📡

Balena Minecraft Server sets automatic your Server hostname to balenaminecraftserver. It is the adress the from your server. You can connect to it like that:

Note: The IP adress also works.

Server-IP

Now you are the one with a balenaServer 😎:

NOTE: This works only in the connected Wifi. If you want to play worldwide click here: https://github.com/AlexProgrammerDE/balena-server/blob/master/README.md#play-worldwide-optional-earth_americas

Minecraft Screenshot

Connect to the terminal 📡

The server has no console input option in the cloud dashboard, so you need RCON. The port is 25575 and the password is balena. It is a protocol for connecting to the server. There are many clients, but you can pick one here:

Connect to the file-directory 📡

You can connect to the server and change your serverfiles. I recommend using a tool like WinSCP or if you are using OSX or a linux distribution you can use Filezilla. The IP Address to connect to is “balenaminecraftserver” (without the quotes), the protocol to choose is SCP (If you got the choice), the port number is 22, the username is “root” (again, without the quotes) and the password is “balenaserver” (no quotes). The files are in the folder named “serverfiles” at the root directory, you can double click to open that directory and browse the files in there.

NOTE: You can also change your SCP password by setting the SCP_PASSWORD Environment Variable within balenaCloud. On the left, simply click on “Device Variables” and then click the “Add Variable” button. Give it a name of SCP_PASSWORD, and set the value to your password.

Connect to another Wifi 📡

balenaMinecraftServer has wifi-connect integrated. You can use it for taking the Pi everywhere. If you want to read more is here the link to the programm: https://github.com/balena-io/wifi-connect (There is explained how it works.)

Change hostname

You can change the hostname by defining the DEVICE_HOSTNAME Environment Variable within balenaCloud.

NOTE: If you decide to change the hostname, you will have to use your new hostname within Minecraft to connect to the server, instead of balenaminecraftserver.

Double RAM (optional) 🔗

Devices like the Raspberry Pi 4B 4GB have enough RAM to run the server with 2GB RAM (the default value used by a Minecraft server is 1GB). If you set DOUBLE_RAM to true it will double the amount of RAM used by the server.

Add plugins (optional) 🔧

balenaMinecraftServer also supports plugins. Just drop the in the plugins folder using SCP. The current Minecraft version is 1.15. You can get your plugins from there(Other work too.):

NOTE: Before adding the plugin and getting an error look if the plugin supports 1.15.

Play worldwide (optional) 🌎

Once you’ve perfected the setup of your server on your local network, you might be interested in unveiling your server to the rest of the world! Here’s how you can enable remote access and allow players to connect via the Internet.

NO-IP Picture

If you’d like to allow friends outside of your local network to join your server, you’ll need to set up dynamic DNS (DDNS) to expose your Pi to the outside world. This example uses a service called No-IP, which has a free tier for people who want to try DDNS out, though other options and methods do exist as well. In the case of this example, you will need to:

  • Create an account with No-IP by visiting their website.
  • After creating the account and logging in, create a Hostname (example: balena.serverminecraft.net) by following their documentation.
  • Set up Port Forwarding: You will need to route your Minecraft traffic to port 25565 on your Pi. To do this, you will log in to your home router and setup Port Forwarding. This step varies by particular brand of modem or router, but the No-IP documentation does a good job of describing the process here. You may need to follow instructions specific to your modem or router if the No-IP documentation does not contain your particular type.
  • Optional: You can login to No-IP with your router to keep the IP Address current in case it changes. That allows the router to connect automatically to No-IP. Here is a guide by No-IP on how to accomplish this.
  • Paste your public / external internet address in the box labeled IP Address into the No-IP dashboard. You're done. 👍

For a deeper look at setting up remote access, please reference this guide (Note: You can skip the DUC part).

Custom Server (optional) 👓

If you want to customize your server even further, but don't know where to start, take a look at some of the servers listed here for ideas:

Note: Balena Minecraft Server uses Paper. It is an efficient and powerful server. It is compatible with spigot and bukkit plugins.

I encourage you to take your server build even further! There are many tutorials out there on server customization-- this article only touches on a few ideas. If you need help, please reach out by submitting an issue on GitHub.

This project is in active development so if you have any feature requests or issues please submit them here on GitHub. PRs are welcome, too. :octocat:

Here is a little server demo 👑:

Server Demo

About

Build a Minecraft Server using a Raspberry Pi 4! Supports common Servers, SCP and Wifi Connect.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%