Getting Started¶
Installation¶
Select your platform and preferred installation method:
This installs HeadlessMc to ~/.local/bin, which you might have to add to your PATH.
It also installs the shell completions for bash, fish and zsh.
You can install HeadlessMc through Homebrew by using our tap:
You can install HeadlessMc through APT by using our repository:
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://headlesshq.github.io/apt/headlesshq.gpg | sudo tee /etc/apt/keyrings/headlesshq.gpg > /dev/null
curl -fsSL https://headlesshq.github.io/apt/headlesshq.sources | sudo tee /etc/apt/sources.list.d/headlesshq.sources > /dev/null
sudo apt update
sudo apt install headlessmc
This installs HeadlessMc to ~/.local/bin, which you might have to add to your PATH.
It also installs the shell completions for bash, fish and zsh.
Run in PowerShell:
This installs to%LOCALAPPDATA%\headlessmc\bin and adds it to your user PATH.
You can use our Scoop bucket:
HeadlessMc has been written in Java with the Quarkus Framework and runs on Java 25.
You can also download the headlessmc.jar from GitHub, which will run on any operating system.
A preconfigured docker image exists:
Inside the container you can use theheadlessmc.
HeadlessMc can run inside Termux.
- Download Termux from F-Droid, NOT from the PlayStore.
- Install Java:
apt update && apt upgrade $ apt install openjdk-<version> - Download the headlessmc.jar into Termux.
- Disable JLine, as we could not get it to work on Termux for now,
by adding
hmc.jline.enabled=falseto the user/.config/headlessmc/config.properties, or starting with-Dhmc.jline.enabled=false. - Now you can use HeadlessMc as you would on Desktop or Docker.
Shell completions¶
You can start a HeadlessMc shell via by just running the headlessmc command without any subcommands.
This shell provides suggestions and tab-completions.
You can also install completions that run in your terminal.
If you installed one of the Linux packages, the completions for bash, zsh and fish
are already installed and work in every new shell, you do not have to set up anything:
bash needs the bash-completion package
and zsh needs compinit to run, which most distributions and frameworks like Oh-My-Zsh do.
You may need to restart your terminal after installing HeadlessMc for completions to work.
Below are in-depth instructions for each type of shell:
Add this to your ~/.zshrc, after compinit (frameworks like Oh My Zsh run compinit for you):
fpath,
so that HeadlessMc does not have to run whenever a shell starts:
and add fpath=(~/.zsh/completions $fpath) before compinit runs.
If your system runs compinit before your ~/.zshrc, like Ubuntu does in /etc/zsh/zshrc,
add it to your ~/.zshenv instead.
You might have to remove the completion cache with rm ~/.zcompdump* once.
Running the command again overwrites the file, do so after updating HeadlessMc.
Options are shown before you have typed a -, to only show them after a -:
Add this to your ~/.bashrc:
name (description).
Save the script into your completions directory, fish loads it automatically:
Running the command again overwrites the file, do so after updating HeadlessMc.Add this to your PowerShell profile, which you can open with notepad $PROFILE:
Ctrl+Space, or enable a menu for tab:
Below are installation instructions for the platforms:
Linux¶
Linux - Script¶
This installs HeadlessMc to ~/.local/bin, which you might have to add to your PATH.
It also installs the shell completions for bash, fish and zsh.
Linux - Homebrew¶
You can install HeadlessMc through Homebrew by using our tap:
Linux - APT¶
You can install HeadlessMc through APT by using our repository:
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://headlesshq.github.io/apt/headlesshq.gpg | sudo tee /etc/apt/keyrings/headlesshq.gpg > /dev/null
curl -fsSL https://headlesshq.github.io/apt/headlesshq.sources | sudo tee /etc/apt/sources.list.d/headlesshq.sources > /dev/null
sudo apt update
sudo apt install headlessmc
Linux - Nix¶
Run it without installing, or install it into your profile:
You can also install without any experimental features:
MacOS¶
MacOS - Script¶
This installs HeadlessMc to ~/.local/bin, which you might have to add to your PATH.
It also installs the shell completions for bash, fish and zsh.
MacOS - Homebrew¶
You can install HeadlessMc through Homebrew by using our tap:
Windows¶
Windows - Script¶
Run in PowerShell:
This installs to%LOCALAPPDATA%\headlessmc\bin and adds it to your user PATH.
Windows - Scoop¶
You can use our Scoop bucket:
scoop bucket add headlesshq https://github.com/headlesshq/scoop-bucket
scoop install headlesshq/headlessmc
Java¶
HeadlessMc has been written in Java with the Quarkus Framework and runs on Java 25.
You can also download the headlessmc.jar from GitHub, which will run on any operating system.
Docker¶
A preconfigured docker image exists:
Inside the container you can use theheadlessmc.
Android¶
HeadlessMc can run inside Termux.
- Download Termux from F-Droid, NOT from the PlayStore.
- Install Java:
apt update && apt upgrade $ apt install openjdk-<version> - Download the headlessmc.jar into Termux.
- Disable JLine, as we could not get it to work on Termux for now,
by adding
hmc.jline.enabled=falseto the user/.config/headlessmc/config.properties, or starting with-Dhmc.jline.enabled=false. - Now you can use HeadlessMc as you would on Desktop or Docker.
musl, NixOS and older glibc¶
headlessmc-launcher-linux-x64-musl is a fully static executable, built against musl.
It does not need any library or dynamic loader of the system, so it runs on every x64 Linux, e.g.:
- musl based distributions, like Alpine Linux, Void Linux (musl) or Chimera Linux,
- NixOS and Guix, which have no
/lib64/ld-linux-x86-64.so.2(Minecraft needs a Java of the system there, see below), - distributions with a glibc older than 2.34, like RHEL 8, Debian 11 or Ubuntu 20.04.
NixOS & Guix Java¶
To run Minecraft on NixOS and Guix, HeadlessMc does not support Java installations.
Either install a Java of your system, e.g. the jdk package of nixpkgs or openjdk of Guix.
HeadlessMc finds Java installed into the system profile or your user profile
(/run/current-system/sw, /etc/profiles/per-user/$USER, ~/.nix-profile, ~/.guix-profile, ...)
and the Java in JAVA_HOME or on the PATH, e.g. in nix shell nixpkgs#jdk, nix-shell -p jdk, a dev shell or with direnv.
Any other Java can be added via its Java home:
programs.nix-ld.enable = true; on NixOS,
which provides the loader, so that the downloaded Java runtimes start.
gcompat for musl¶
On musl systems HeadlessMc downloads Java runtimes built against musl, e.g. Temurin for Alpine Linux.
Minecraft ships natives, e.g. of LWJGL, that are only built against glibc.
The headless client does not load the LWJGL natives, a Minecraft server needs none at all.
To run the client with a window, install gcompat,
a glibc compatibility layer for musl, e.g. with apk add gcompat on Alpine Linux.
HeadlessMc warns if it launches the client with a window on musl without a glibc loader.
The jemalloc bundled with LWJGL 3.3.1 and newer (Minecraft 1.19 and newer) crashes on load with gcompat,
so HeadlessMc launches the client with -Dorg.lwjgl.system.allocator=system on musl.
Web¶
HeadlessMc v2
This is a legacy HeadlessMc v2 feature that will eventually come back. Maybe even better as it could be possible to compile HeadlessMc to webassembly with GraalVM. However, it is currently not supported.
HeadlessMc can run inside the browser, kinda. First, there is CheerpJ, a WebAssembly JVM, but it does not support all features we need to launch the game. Secondly, there is headlessmc-wasm, which compiles HeadlessMc to WebAssembly using GraalVM. In this mode, however, HeadlessMc has no way to launch the game. Maybe this can be achieved via trufl. Thirdly, there is container2wasm, which can translate the HeadlessMc Docker container to WebAssembly and the run it inside the browser, but this is extremely slow. Lastly, you can use headlessmc-gui to give HeadlessMc a GUI in your browser.