Setup llmster as a Startup Task on Linux
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.
Info
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.
Install the Daemon
Run the following command to install llmster:
curl -fsSL https://lmstudio.ai/install.sh | bashVerify the installation:
lms --helpDownload a Model
Download a model to use with the server:
lms get openai/gpt-oss-20bThe output will show the model path. You'll need this for the systemd configuration.
Manual Test
Before configuring systemd, verify everything works manually.
Load the model:
lms load openai/gpt-oss-20bStart the server:
lms server startVerify the API is responding:
curl http://localhost:1234/v1/modelsStop the server when done testing:
lms server stopCreate Systemd Service
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.targetThis 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.
Enable and Start the Service
sudo systemctl daemon-reload
sudo systemctl enable lmstudio.service
sudo systemctl start lmstudio.serviceVerify
Check the service status:
systemctl status lmstudioTest the API:
curl http://localhost:1234/v1/modelsService Management
# Stop the service
sudo systemctl stop lmstudio
# Restart the service
sudo systemctl restart lmstudio
# Disable auto-start
sudo systemctl disable lmstudioCommunity
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.