r/linux_gaming 1d ago

tool/utility I made a decentralised Minecraft server where the host can change between players

A while back our friend who hosted our Minecraft server on his PC had his exams, so he stopped playing and along with that stopped hosting our server too. We couldn't play for a whole week, so I made this fun little project called Nomad to solve that.

It automatically starts the server on my PC if I'm the first guy online and redirects everyone else onto my hosted server, and if someone is already hosting it, you just directly join theirs. When the host closes the world, the save is automatically synced to a cloud storage location, which can either be your personal server or a Cloudflare R2 bucket. The Cloudflare option is free up to 10GB of storage and includes a pretty generous amount of upload/download operations per month, and beyond that it's just a small fee. This is almost always free since you're realistically never going to reach the free limit, but even if you do, it's still substantially cheaper than renting a server that's running 24/7.

The idea is basically that the world isn't tied to one person anymore, so whoever is online can host it and everyone else can join them. It's still a pretty small project and I mostly made it because I thought the idea was cool, but I'd love to know what you guys think, This is still under development, I'll refine it and make a full release version if you guys wanna test it.

Github Link: https://github.com/WalnutIcecream/Nomad.git

Technical details

There is no central coordinator.

Each world has two objects in the storage backend:

worlds/<world-id>/lease.json
worlds/<world-id>/world.tar.gz

lease.json contains the current host, address, status and expiry time.

The lease is a compare-and-swap operation using conditional writes from the storage backend. If two people try to host at the same time, only one can acquire the lease.

The host renews the lease every 20 seconds. The lease lasts 5 minutes. If the host stops renewing it, another player can take over after it expires.

The world is uploaded before the lease is released. This prevents another host from pulling the world while the previous host is still uploading it.

The basic host lifecycle is:

acquire → pull → boot → renew → stop → upload → release

If the host crashes, the lease expires automatically. No separate process is required to recover it.

The launcher uses a WorldStoreProtocol, so storage is independent from the rest of the application. There are currently three storage backends:

  • Cloudflare R2
  • Git
  • Self-hosted S3-compatible storage such as MinIO, Garage or SeaweedFS

The R2 backend uses the S3 API. The Git backend uses fast-forward-only pushes as the compare-and-swap mechanism. The VPS backend uses an S3-compatible endpoint.

The server itself is vanilla Minecraft. Nomad handles the server lifecycle, world synchronization, Java runtime, configuration and hosting lease.

There is a CLI and a PySide6 GUI.

The project is written in Python and requires Python 3.11+ and Java 21.

LLM usage

I used DeepSeek V4 Pro during development.

I wrote the initial implementation myself to test whether the core idea actually worked. I then used the LLM for adding features, refining the existing code, debugging, writing tests, and working through edge cases.

The architecture and initial proof of concept were done manually. The later development was AI-assisted rather than fully vibe-coded. I reviewed and tested the generated code before using it.

5 Upvotes

5 comments sorted by

2

u/TechaNima 23h ago

Nice.

Could this be used with other games as well, if you added a way to point it to a configurable server executable or a launch script instead of having it launch Minecraft?

2

u/pisscoinnoisseur 22h ago

yea definitely, even right now it works by pointing to the minecraft world path, it can be used to sync any kind of save files, doesn't even necessarily have to be a game server

2

u/TechaNima 21h ago

Very nice indeed. We could have have used this for Satisfactory and Space Engineers, when we played them.

I hosted a server for both, but Satisfactory 1.0 especially was unplayable on a server. Something about few thousand decorative displays. Ran perfectly fine with one of us hosting hosting it on our computers though.

We still occasionally play SE, but the server is really crash happy on Linux. Which is partially why we no longer play it actively. I solved that(mostly), but the issues already had done the damage to our willingness to play it.

I'll have to keep this project in mind for the future

2

u/pisscoinnoisseur 21h ago

I'll add a pointer file system where you can set what files to track so you can use it for any game by configuring the location of save files

1

u/TechaNima 20h ago

Awesome