Run the web UI in the background
lmm serve stops when you close the terminal it runs in. If you’d rather have the web interface there all the time, lmm can run it as a background service that starts when you log in. Then you just open http://127.0.0.1:7420/ in your browser whenever you want it.
lmm uses systemd for this, which almost every Linux distribution has. The service is called lmm-serve, and it runs as you, not as root, so it uses the same games, mods and logins as your lmm commands.
If you installed lmm from a package
The .deb, .rpm and .apk packages and the Arch PKGBUILD already include the service, turned off. Turn it on with:
systemctl --user enable --now lmm-serve
To turn it off again:
systemctl --user disable --now lmm-serve
If you installed lmm any other way
If you unpacked the .tar.gz file, or built lmm yourself, let lmm set the service up for you:
lmm service install
That writes the service file to ~/.config/systemd/user/ (or wherever systemd looks for your own services, if you’ve moved your config folder), pointing at the lmm program you ran, then turns the service on and starts it. A moment later it checks the service is still running, and prints the address the web interface is on, or tells you to look at its log if it stopped.
The service uses the same games, mods and settings as the lmm you ran it from. If you gave lmm service install the --config or --data options, or you set XDG_CONFIG_HOME or XDG_DATA_HOME in your shell, the service gets those too.
To use a different address, give it the same --addr you would give lmm serve:
lmm service install --addr 127.0.0.1:8080
Running lmm service install again, say with a new address, or after you move the lmm program, rewrites the service file and restarts the service.
To have lmm also install new versions of itself once a day, add --auto-update (see Update lmm automatically):
lmm service install --auto-update
To take the service out again:
lmm service uninstall
If a package already installed the service, lmm service install doesn’t make a second copy. It tells you the systemctl command that turns the packaged one on instead. If you have both, lmm service uninstall turns the packaged one off as well, because the two share the setting that turns the service on; it prints the command that turns the packaged one back on.
lmm only changes or removes a service file it wrote itself. If you wrote your own lmm-serve.service in ~/.config/systemd/user/, or put a link there, lmm leaves it alone and tells you to change or remove it yourself.
Is it running?
lmm service status
This shows whether the service is installed (and whether lmm or a package put it there), whether it starts when you log in, whether it is running now, and whether it starts at boot. Add --json for a version a script can read.
If it isn’t running, its log says why:
journalctl --user -u lmm-serve
Starting at boot, without logging in
The service starts when you log in. If you want it running from the moment the computer starts, for example to reach it from another device on your network, turn on “lingering” for your user once:
loginctl enable-linger $USER
This is a setting for your whole user account, so lmm only tells you about it and never changes it for you. lmm service status shows whether it is on.
The web interface has no password. It only listens on your own computer (127.0.0.1) unless you give it another address. Only do that on a network you trust: anyone who can reach the address can manage your mods.
Things to know
- The service can write anywhere
lmmcan, so mods deploy into your game folders as usual, wherever they are. - A hook script (a script you set lmm to run around a deploy) can’t use
sudowhen the service runs it. - The service doesn’t see your shell’s
PATH: it gets systemd’s, whichsystemctl --user show-environmentshows. Programs lmm runs, such as7z,unrarandsteamcmd, must be somewhere on that one. If one is only on your shell’sPATH(say, added in~/.bashrc), setPATHin a file under~/.config/environment.d/, which takes effect the next time you log in; or, for now,systemctl --user set-environment PATH=...followed bysystemctl --user restart lmm-serve. - If your computer doesn’t use systemd,
lmm servicesays so and changes nothing. Runlmm servein a terminal instead.