HOWTO: Setting up a NixOS Minecraft server using the newest version of Minecraft

After setting up a Minecraft server I noticed that my game refused to connect to the server, because the server version was already too old (1.14 at the time), despite being the newest one available on Nixpkgs. I figured out a way to override the version to the newest one (1.14.3 at the time of writing).

First, you need to find out the download url to the newest version of Minecraft, see here:

You also need the SHA-256 checksum of the file.

You can either use nix-prefetch-url command

[34.3 MiB DL]
path is '/nix/store/4fi6dfqf4i74zbinnbwsmnbcmqv0gqbi-server.jar'

or download the file and run

sha256sum server.jar 
942256f0bfec40f2331b1b0c55d7a683b86ee40e51fa500a2aa76cf1f1041b38  server.jar

Then create a Minecraft server configuration where you override the package with the desired version. Here’s an example:

  services.minecraft-server = {
    enable = true;
    eula = true; #required

    # other options go here. see

    package = let 
      version = "1.14.3";
      url = "";
      sha256 = "942256f0bfec40f2331b1b0c55d7a683b86ee40e51fa500a2aa76cf1f1041b38";
    in (pkgs.minecraft-server_1_14.overrideAttrs (old: rec {
      name = "minecraft-server-${version}";
      inherit version;

      src = pkgs.fetchurl {
        inherit url sha256;

Happy mining and crafting!


FWIW you can use nix-prefetch-url to fetch the file and calculate its hash, so you don’t need to download it separately.


I’ve updated minecraft-server to the latest version in nixpkgs, so your extra config shouldn’t be necessary for much longer if you’re on nixos-unstable. You’re also welcome to make PRs updating it yourself — see NixOS - Nixpkgs 21.05 manual for an explanation of how, and feel free to ask here or on IRC if you need any help with it!


Thanks for the quick update!

Because Minecraft is a game that gets constantly updated (and newer versions of the game don’t work with older versions of the server), I figured that my solution will also be useful in the future.

Imagine this: New version of the game comes out on a Friday, the kids are going to spend a good portion of the weekend playing the game, the server admin needs to quickly bump up the version number of the server to match the clients, effective immediately. This is where I hope my solution will be helpful.

1 Like

You can have a local clone of nixpkgs and build from there — if you edit pkgs/games/minecraft-server/default.nix to reflect the new version, you can then run nixos-rebuild switch -I nixpkgs=path/to/your/nixpkgs, the kids will be happy and you can make a PR from there :wink:

1 Like

Or if you don’t want to maintain a local nixpkgs clone, create an overlay.

Of course, a PR benefits everyone :wink: .

1 Like

You can also use a matching version on the client. Don’t Minecraft support this in the official Launcher?

You can also use MultiMC.