---
title: "LM Studio — llmster Startup Service (systemd)"
aliases: [llmster-systemd, lmstudio-startup, lmstudio-daemon-linux]
tags: [lmstudio, llmster, systemd, linux, headless, local-llm]
sources: [raw/Setup llmster as a Startup Task on Linux.md]
created: 2026-04-30
updated: 2026-04-30
---

# LM Studio — llmster Startup Service (systemd)

Configure `llmster` (LM Studio's headless daemon) to launch automatically at boot, load a model, and start the HTTP API server — all via a systemd unit file.

## Install llmster

```bash
curl -fsSL https://lmstudio.ai/install.sh | bash
lms --help   # verify
```

## Download a Model

```bash
lms get openai/gpt-oss-20b
# note the model path printed — used in service config
```

## Manual Test (before systemd)

```bash
lms load openai/gpt-oss-20b
lms server start
curl http://localhost:1234/v1/models   # should return model list
lms server stop
```

## systemd Unit File

Create `/etc/systemd/system/lmstudio.service` (replace `YOUR_USERNAME`):

```ini
[Unit]
Description=LM Studio Server

[Service]
Type=oneshot
RemainAfterExit=yes
User=YOUR_USERNAME
Environment="HOME=/home/YOUR_USERNAME"
ExecStartPre=/home/YOUR_USERNAME/.lmstudio/bin/lms daemon up
ExecStartPre=/home/YOUR_USERNAME/.lmstudio/bin/lms load openai/gpt-oss-20b --yes
ExecStart=/home/YOUR_USERNAME/.lmstudio/bin/lms server start
ExecStop=/home/YOUR_USERNAME/.lmstudio/bin/lms daemon down

[Install]
WantedBy=multi-user.target
```

- `Type=oneshot` + `RemainAfterExit=yes` — service is considered "active" after `ExecStart` exits
- `ExecStartPre` runs sequentially before `ExecStart`
- Skip the `lms load` line to rely on [[wiki/claude-code/lmstudio-idle-ttl-auto-evict|JIT loading + auto-evict]] instead

## Enable and Start

```bash
sudo systemctl daemon-reload
sudo systemctl enable lmstudio.service
sudo systemctl start lmstudio.service
```

## Verify

```bash
systemctl status lmstudio
curl http://localhost:1234/v1/models
```

## Service Management

```bash
sudo systemctl stop lmstudio       # stop
sudo systemctl restart lmstudio    # restart
sudo systemctl disable lmstudio    # remove from boot
```

## Key Takeaways

- Use `lms daemon up` in `ExecStartPre` — the daemon must be running before `lms load` or `lms server start`
- Binary path is `~/.lmstudio/bin/lms` — use the absolute path in the unit file (systemd has a minimal `$PATH`)
- `Type=oneshot` + `RemainAfterExit=yes` keeps the service "active" so `ExecStop` runs on shutdown
- Omit the `lms load` step and use [[wiki/claude-code/lmstudio-idle-ttl-auto-evict|JIT loading]] to avoid pinning a model at boot
- API is served on `http://localhost:1234` — see [[wiki/claude-code/lmstudio-headless-service|headless service overview]] for non-systemd options and [[wiki/claude-code/lmstudio-serve-on-network|LAN serving]] to expose to other devices

## Sources

- [LM Studio Headless llmster Docs](https://lmstudio.ai/docs/developer/core/headless_llmster)
