Pi4 Docker



在Ubuntu系统中我们可以通过apt-get 命令很方便的安装 / 卸载软件,由于默认的软件包仓库是位于国外的,安装软件的时候就可能遇到各种网络问题或者下载到的一些资源不完整,因此就需要切换数据源为国内的镜像站点来改善。. Thanks for the speed test! I am using my Raspberry Pi 4B with Docker now, and am running about 14 containers. It is slow to start up all the containers when I reboot (load is at 17+ after a few min, then drops to under 1 after about 15 minutes). So I am looking for a faster storage medium than the Samsung EVO microSD card. Ubuntu is an open-source operating system for cross platform development, there's no better place to get started than with Ubuntu on a Raspberry Pi. You can workaround this in a few ways. You can gently overclock your Pi4 if it has a fan by adding this to the end of your /boot/config.txt (read articles on overclocking a Pi to be safe) overvoltage=3 armfreq=1850. And/or you can disable the Minecraft internal watchdog for ticks by setting max-tick-time to -1 in your server's server. Just to let you know, this is the approach that balenaOS takes. Applications are containerized and deployed using Docker. The OS uses read-only system partitions to store the engine, kernel, firmware, etc, and has an A/B partition layout for resiliency and atomic updates.

Sponsored By

My 14 year old got tired of paying $7.99 for Minecraft Realm so he could host his friends in their world. He was just hosting on his laptop and then forwarding a port but that means his friends can't connect unless he's actively running. I was running a Minecraft Server in a Docker container on my Synology NAS but I thought teaching him how to run Minecraft Server on a Raspberry Pi 4 we had lying around would be a good learning moment.

First, set up your Raspberry Pi. I like NOOBS as it's super easy to setup. If you want to make things faster for setup and possibly set up your Pi without having to connect a monitor, mouse, or keyboard, mount your SSD card and create a new empty file named ssh, without any extension, inside the boot directory to enable ssh on boot. Remember the default user name is pi and the password is raspberry.

Pi4

SSH over to your Raspberry Pi. You can use Putty, but I like using Windows 10's built-in SSH. Do your standard update stuff, and also install a JDK:

P4 docker

There are other Minecraft 3rd party Java Servers you can use, the most popular being Spigot, but the easiest server you can run is the one from Minecraft themselves.

Go to https://www.minecraft.net/en-us/download/server in a browser. It'll say something like 'Download minecraft_server.1.16.2.jar and run it with the following command.' That version number and URL will change in the future. Right-click and copy link into your clipboard We are going to PASTE it (right click with your mouse) after the 'wget' below. So we'll make a folder, download the server.jar, then run it.

You'll get a warning that you didn't accept the EULA, so now open 'pico eula.txt' and set eula=true, then hit Ctrl-X and Yes to save the new file. Press the up key and run your command again.

You could also make a start.sh text file with pico then chmod +x to make it an easier single command way to start your server. Since I have a Raspberry Pi 4 with 4g gigs of RAM and it'll be doing just this one server, I felt 2500 megs of RAM was a sweet spot. Java ran out of memory at 3 gigs.

You can then run ifconfig at and command line and get your Pi's IP address, or type hostname to get its name. Then you can connect to your world with that name or ip.

Performance Issues with Complex Worlds

With very large Minecraft worlds or worlds like my son's with 500+ Iron Golems and Chickens, you may get an error like

You can workaround this in a few ways. You can gently overclock your Pi4 if it has a fan by adding this to the end of your /boot/config.txt (read articles on overclocking a Pi to be safe)

And/or you can disable the Minecraft internal watchdog for ticks by setting max-tick-time to -1 in your server's server.properties file.

We solved our issue by killing about 480+ Iron Golems with

but that's up to you. Just be aware that the Pi is fast but not thousands of moving entities in Minecraft fast. For us this works great though and is teaching my kids about the command line, editing text files, and ssh'ing into things.

Sponsor: Never miss a beat with Seq. Live application logs and health checks. Download the Windows installer or pull the Docker image now.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.


Pi 4 Docker

Pi 4 docker mysql

Pi 4 Docker Swarm

AboutNewsletter