Documentation
Core
LM Studio REST API
Core
LM Studio REST API
Configure llmster to run on startup using systemctl on Linux
llmster, LM Studio's headless daemon, can be configured to run on startup. This guide covers setting up llmster to launch, load a model, and start an HTTP server automatically using systemctl on Linux.
This guide is for Linux systems without a graphical interface. For machines with a GUI, you can configure LM Studio to run as a service on login instead.
Run the following command to install llmster:
curl -fsSL https://lmstudio.ai/install.sh | bash
Verify the installation:
lms --help
Download a model to use with the server:
lms get openai/gpt-oss-20b
The output will show the model path. You'll need this for the systemd configuration.
Before configuring systemd, verify everything works manually.
Load the model:
lms load openai/gpt-oss-20b
Start the server:
lms server start
Verify the API is responding:
curl http://localhost:1234/v1/models
Stop the server when done testing:
lms server stop
Create /etc/systemd/system/lmstudio.service. Replace YOUR_USERNAME with your username.
[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
This unit automatically loads the openai/gpt-oss-20b model on startup. Alternatively, you can avoid loading a specific model on startup and instead rely on Just-In-Time (JIT) loading and Eviction in the server.
sudo systemctl daemon-reload sudo systemctl enable lmstudio.service sudo systemctl start lmstudio.service
Check the service status:
systemctl status lmstudio
Test the API:
curl http://localhost:1234/v1/models
# Stop the service sudo systemctl stop lmstudio # Restart the service sudo systemctl restart lmstudio # Disable auto-start sudo systemctl disable lmstudio
Chat with other LM Studio developers, discuss LLMs, hardware, and more on the LM Studio Discord server.
Please report bugs and issues in the lmstudio-bug-tracker GitHub repository.
This page's source is available on GitHub
On this page
Install the Daemon
Download a Model
Manual Test
Create Systemd Service
Enable and Start the Service
Verify
Service Management
Community