Join our Discord Server
Ajeet Raina Ajeet Singh Raina is a former Docker Captain, Community Leader and Distinguished Arm Ambassador. He is a founder of Collabnix blogging site and has authored more than 700+ blogs on Docker, Kubernetes and Cloud-Native Technology. He runs a community Slack of 9800+ members and discord server close to 2600+ members. You can follow him on Twitter(@ajeetsraina).

Running Minecraft Server on NVIDIA Jetson Nano using Docker

2 min read

With over 126 million monthly users, 200 million games sold & 40 million MAU, Minecraft still remains one of the biggest games on the planet. It is an incredibly popular game that was created for the first time in the year 2009. Microsoft acquired Minecraft for a $2.5-billion deal in early 2017 and ever since over 30 million copies of Minecraft have been sold for PC and Mac. There is a general perception that its player base skews more towards children. The simple graphics and LEGO-like design feed into this perception – but according to Microsoft, it’s simply not the case, and the average age of a Minecraft player is older than you might think. (24 years old)

Minecraft is educational

Yes, you heard it right. Minecraft is an educational game. It is unique in that it’s an unlimited world where kids can create literally anything they can imagine, but within the constraint that everything is made up of blocks that must fit within the 3D grid of the game.. One primary reason Minecraft is good for kids is the promotion of creativity, problem-solving, self-direction, and collaboration—all of which stand out as the less-tangible, non-academic benefits Minecraft provides. It is these life skills that will give kids the boost needed when they eventually work their way towards succeeding in college and future careers.

Why Minecraft inside Docker container?

  • It’s fun.
  • It allows my kid to build up his own Minecraft Server in just 2 minutes
  • No deep knowledge of Docker is required(for my kid). Just one single liner command and everything is all up and running
  • Can be run locally or hosted over the Cloud
  • Can be run on IoT boards like Jetson Nano & Raspberry Pi
  • Highly customizable

In this article, I will show you how you can set up Minecraft running inside Jetson Nano using Docker in just 2 minutes.

Hardware

  • NVIDIA Jetson Nano
  • SD Card
  • 5V 4A Power Adapter
  • HDMI Cable
  • 16GB/64GB SD card

Software

1. Preparing Your Jetson board

  • Unzip the SD card image
  • Insert SD card into your system.
  • Bring up Etcher tool and select the target SD card to which you want to flash the image.

2. Verifying if it is shipped with Docker Binaries

ajeetraina@ajeetraina-desktop:~$ sudo docker version
[sudo] password for ajeetraina: 
Client:
 Version:           19.03.6
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        369ce74a3c
 Built:             Fri Feb 28 23:47:53 2020
 OS/Arch:           linux/arm64
 Experimental:      false

Server:
 Engine:
  Version:          19.03.6
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       369ce74a3c
  Built:            Wed Feb 19 01:06:16 2020
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.3.3-0ubuntu1~18.04.2
  GitCommit:        
 runc:
  Version:          spec: 1.0.1-dev
  GitCommit:        
 docker-init:
  Version:          0.18.0
  GitCommit:    

3. Running the Minecraft Server using Docker

sudo docker run -d -p 25565:25565 -e EULA=true -e ONLINE_MODE       =false -e DIFFICULTY=hard -e OPS=collabnix  -e MAX_PLAYERS=50 -e MOTD="welcome to Collabnix" -v /tmp/minecraft_data:/data --name mc itzg/minecraft-server:multiarch

where,

  • itzg/minecraft-server:multiarch is the right Docker image for ARM
  • /tmp/minecraft_data:/data is for persistence
  • MAX_PLAYERS is the maximum number of players you are allowing to participate
  • OPS is to add more “op” (aka adminstrator) users to your Minecraft server
  • DIFFICULTY is for the difficulty level (default: easy)
  • MOTD is for the message of the day

Almost done!

Open up your Minecraft client and look out for Server Name (which will be your host name) and use 25565 as port number (optional)

Key Takeaways:

  • You will need a dedicated Minecraft Docker Image(multiarch) to make it work on IoT devices like Raspberry Pi and Jetson Board
  • Minecraft is CPU intensive, hence even passing –gpus all option won’t help in improving the performance

Using Docker Compose

If you want to use Docker compose, you will need to install it first as Jetson Nano SD card image doesn’t come with it by default:

export DOCKER_COMPOSE_VERSION=1.27.4
sudo apt-get install libhdf5-dev
sudo apt-get install libssl-dev
sudo pip3 install docker-compose=="${DOCKER_COMPOSE_VERSION}"
apt install python3
apt install python3-pip
pip install docker-compose

Create a file called docker-compose.yml and add the below content:

version: '3.7'
services:
 minecraft:
   image: itzg/minecraft-server:multiarch
   ports:
     - "25565:25565"
   environment:
     EULA: "TRUE"
   deploy:
     resources:
       limits:
         memory: 1.5G

Now you should be able to run docker-compose as shown below:


sudo docker-compose up
WARNING: Some services (minecraft) use the 'deploy' key, which will be ignored. Compose does not support 'deploy' configuration - use `docker stack deploy` to deploy to a swarm.
Creating network "pico_default" with the default driver
Creating pico_minecraft_1 ... done
Attaching to pico_minecraft_1
minecraft_1  | [init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 2 1000 1000 4096 Aug  9 18:11 /data'
minecraft_1  | [init] Resolved version given LATEST into 1.16.3
minecraft_1  | [init] Resolving type given VANILLA
minecraft_1  | [init] Downloading minecraft_server.1.16.3.jar ...
minecraft_1  | [init] Creating server.properties in /data/server.properties
minecraft_1  | [init] Setting server-name to 'Dedicated Server' in /data/server.properties
minecraft_1  | [init] Skip setting server-ip
minecraft_1  | [init] Setting server-port to '25565' in /data/server.properties
....

Have Queries? Join https://launchpass.com/collabnix

Ajeet Raina Ajeet Singh Raina is a former Docker Captain, Community Leader and Distinguished Arm Ambassador. He is a founder of Collabnix blogging site and has authored more than 700+ blogs on Docker, Kubernetes and Cloud-Native Technology. He runs a community Slack of 9800+ members and discord server close to 2600+ members. You can follow him on Twitter(@ajeetsraina).
Join our Discord Server
Index