Console version
stuzhik-cli is Stuzhik without a window: Minecraft servers from a terminal, as a systemd service or in a container. It is one file with no dependencies for any Linux on x86_64 and on ARM (aarch64: Raspberry Pi 4 and newer, ARM servers).
It works on the same data as the window app: a server created in the window runs from the terminal, and the other way round.
Installing
The files for x86_64 and ARM, and the commands that download and install them, are on the download page. For ARM the names say arm64 or aarch64 instead of amd64 and x86_64.
| System | How to install |
|---|---|
| Debian, Ubuntu, Mint | sudo apt install ./stuzhik-cli_*_amd64.deb |
| Fedora, RHEL, Alma, Rocky | sudo dnf install ./stuzhik-cli-*.x86_64.rpm |
| openSUSE | sudo rpm -i ./stuzhik-cli-*.x86_64.rpm |
| Arch and any other | tar xzf stuzhik-cli-*-x86_64-linux.tar.gz, then sudo install -m 0755 stuzhik-cli-*-x86_64-linux/stuzhik-cli /usr/local/bin/ |
The packages are not signed yet: dnf warns «skipped OpenPGP checks», which is expected. The files can be checked against SHA256SUMS: sha256sum -c SHA256SUMS --ignore-missing.
The launcher downloads Java for the server by itself. It is built for glibc: on Alpine and other musl systems you need the gcompat package or your own Java in the build's settings.
Quick start
stuzhik-cli create "My server" --mc 1.21.1 --loader fabric --accept-eula
stuzhik-cli run "My server"The server console is in the same terminal: type commands as usual. Ctrl+C stops the server with stop (the world is saved), a second Ctrl+C ends it at once.
A build can be named by its id, its name or the start of either.
A server from a modpack
stuzhik-cli create "Pack" --modpack ./pack.mrpack --accept-eulaThe modpack comes from a file (.mrpack, a CurseForge .zip, .stzhk), an address on modrinth.com, modrinth:<project>[@<version>] or curseforge:<project id>[@<file id>]. It is installed as a server right away, without the game's client files, and the pack's client mods are turned off. Mods it could not find out about are listed at the end, so you can check them by hand.
Updating the pack:
stuzhik-cli update "Pack"First you see what will change: which mods are added, updated and removed. It is applied after «yes». A backup is made before the update (--no-backup skips it), configs already there stay (--overwrite-configs replaces them with the pack's), --to picks the version. Updating to a pack version for another game version is done only in the window: there it can be rolled back.
After editing mods/ by hand, the build can be brought back to the installed pack version, like «Restore as in the pack» in the window:
stuzhik-cli update "Pack" --restoreRemoved pack mods come back, changed files are replaced with the pack's. Pack mods you turned off stay off (--enable-pack-mods turns them on), mods you added stay (--remove-own-mods removes them), --overwrite-configs puts the pack's configs back.
Commands
| Command | What it does |
|---|---|
list, info <build> | builds and details (--json for scripts) |
create <name> --mc <version> [--loader …] [--port] [--memory MB] [--accept-eula] | create and install a server |
create <name> --modpack <pack> | a server from a modpack |
run <build> | run in this terminal |
console <build> | the console of a server that run holds in another terminal or as a service |
tui | a terminal screen: builds, the server console and its server.properties |
update <build> | update the build's modpack, with a preview; --restore: bring it back as in the pack |
backup <build>, backups <build>, restore <backup> [--worlds] | backups |
eula <build> [--accept], props <build> [key=value…] | EULA and server.properties |
analyze <build or log file> | log analysis: problems and what to do |
logs <build> [-n lines] [-f] | a server's log without attaching to its console; -f keeps printing new lines |
service <build> [--install] [--system] | a systemd service |
paths | where the data is |
Loaders: vanilla, fabric, quilt, forge, neoforge. All commands and options: stuzhik-cli --help.
A systemd service
stuzhik-cli service "My server" --install
systemctl --user daemon-reload
systemctl --user enable --now stuzhik-<name>
loginctl enable-linger $USERThe first command prints the exact name of the service. enable-linger keeps the server running while you are logged out; --system writes a system service (needs root), which runs as the current user.
systemctl stop saves the world: the server gets stop rather than being cut off. A crashed server restarts by itself, while a setup error (an EULA not accepted, for example) does not, so the service doesn't spin uselessly.
The console of a running service: stuzhik-cli console "My server" shows the last lines of output, then live ones, and your commands go to the server. Ctrl+C only detaches the console; the server keeps running. To only read the log, sending nothing: stuzhik-cli logs "My server" -f.
To control a server a service or stuzhik-cli run in another terminal keeps:
stuzhik-cli status "My server" # whether it runs, how long, who plays
stuzhik-cli restart "My server" --warn 60 # warn the players in the chat and restart
stuzhik-cli stop "My server" # stop with the world saved, and wait for itrestart restarts the server inside the same service; systemd sees no gap. status exits with code 3 when the server is not running; --json gives the same for scripts and monitoring. A scheduled restart is a systemd timer or cron running stuzhik-cli restart.
Players
stuzhik-cli players "My server" # whitelist, operators, bans
stuzhik-cli players "My server" whitelist add Steve Alex # let in; whitelist on turns the list on
stuzhik-cli players "My server" op Steve --level 2 # an operator of level 1-4
stuzhik-cli players "My server" ban Griefer --reason "griefed the spawn"
stuzhik-cli players "My server" pardon Griefer # lift a ban; ban-ip and pardon-ip by address
stuzhik-cli players "My server" kick Steve # on a running server onlyThe lists are the server's own files, as in the window app, so they change with the server off too. A server run by stuzhik-cli run or the service gets the change at once. Sometimes a running server cannot take it as a command: an operator level other than the one /op gives, an IPv6 address, or an offline-mode server that has not seen the name yet. Then the change waits for the restart, and the command says so. In offline mode a name is case-sensitive: Steve and steve are different players to the server.
A container
The image is built from the console version archive, the same way on Podman and on Docker. The server's data lives in the stuzhik volume and survives recreating the container.
Build the image from the console version archive:
curl -fLOJ https://get.stuzhik.ru/linux/cli
tar xzf stuzhik-cli-*-x86_64-linux.tar.gz
cd stuzhik-cli-*-x86_64-linux
cat > Containerfile <<'EOF'
FROM docker.io/library/debian:13-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& useradd --system --uid 10001 --user-group --home-dir /data --create-home stuzhik
COPY stuzhik-cli /usr/local/bin/stuzhik-cli
USER stuzhik
ENV STUZHIK_DATA=/data
VOLUME ["/data"]
EXPOSE 25565
STOPSIGNAL SIGTERM
ENTRYPOINT ["/usr/local/bin/stuzhik-cli"]
CMD ["list"]
EOF
podman build -f Containerfile -t stuzhik-cli .Create a server, start it in the background, then attach to its console:
podman run --rm -it -e STUZHIK_LANG=en -v stuzhik:/data stuzhik-cli create "My server" --mc 1.21.1 --loader fabric --accept-eula
podman run -dit --name mc -e STUZHIK_LANG=en -v stuzhik:/data -p 25565:25565 --stop-timeout 120 stuzhik-cli run "My server"
podman attach mcTo leave the console with the server running: Ctrl+P, then Ctrl+Q. stop (or podman stop mc, docker stop mc) saves the world: the container gets 120 seconds for it.
Data
By default it is the same folder as the window app's. Another one: --data-dir /srv/stuzhik or the variable STUZHIK_DATA=/srv/stuzhik.
While a command is running, the window does not move the data folder to another disk and says why, and a command started in the middle of a move will not wait: it asks you to let the move finish.
Language and exit codes
Messages follow the system language; STUZHIK_LANG=ru or en sets it explicitly (a server often has C, which means Russian).
Exit codes: 0 done, 1 the server crashed, 2 a refusal (no such build, EULA not accepted, a wrong option), 3 analyze found a critical problem. The service relies on them: code 2 is not restarted.