DEV Community

Cover image for Installing LM Studio – A Graphical Application for Running LLMs
Sanskriti Harmukh for Vultr

Posted on with Aashish Chaurasiya Originally published at docs.vultr.com

Installing LM Studio – A Graphical Application for Running LLMs

LM Studio is a graphical, llama.cpp-based desktop app for running LLMs locally — GGUF models from Hugging Face, browsable and downloadable right from the UI (Llama, DeepSeek-R1, Mistral, Gemma, Granite, Phi, and more). This guide installs it on Linux, runs it as a system service, downloads and chats with a model, enables API access, and puts it behind Nginx with TLS.

Prerequisites: a GUI-capable Linux instance with a GPU (or a desktop with x86 + AVX2), a domain if you want remote TLS access (this guide uses Ubuntu 24.04 and example.com).


Install LM Studio

$ wget https://installers.lmstudio.ai/linux/x64/0.3.15-11/LM-Studio-0.3.15-11-x64.AppImage
$ sudo apt install libatk1.0-0 libatk-bridge2.0-0 libcups2 libgdk-pixbuf2.0-0 libgtk-3-0 libpango-1.0-0 libcairo2 libxcomposite1 libxdamage1 libasound2t64 libatspi2.0-0
$ cd ~/Downloads
$ sudo chmod +x LM-Studio-0.3.15-11-x64.AppImage
$ ./LM-Studio-0.3.15-11-x64.AppImage --appimage-extract
$ cd squashfs-root
$ sudo chown root:root chrome-sandbox
$ sudo chmod 4755 chrome-sandbox
$ ./lm-studio
Enter fullscreen mode Exit fullscreen mode

On a remote server with no GUI, use X11 forwarding (ssh -X linuxuser@hostname) or you'll hit an error trying to launch it.


Run LM Studio as a System Service

Gives you auto-start at boot and consistent management via systemd.

$ sudo mv ~/Downloads/squashfs-root/ /opt/lm-studio
$ echo $DISPLAY
Enter fullscreen mode Exit fullscreen mode

Note the output (e.g. :1).

$ sudo nano /etc/systemd/system/lmstudio.service
Enter fullscreen mode Exit fullscreen mode
[Unit]
Description=LM Studio Service
After=network.target

[Service]
Type=simple
ExecStart=/opt/lm-studio/lm-studio --run-as-a-service
Restart=always
User=<user>
Group=<group>
Environment=DISPLAY=:1
Environment=XDG_RUNTIME_DIR=/run/user/$(id -u <user>)

[Install]
WantedBy=multi-user.target
Enter fullscreen mode Exit fullscreen mode

Replace <user>/<group> with your account, and match DISPLAY to the value from echo $DISPLAY above.

$ sudo systemctl daemon-reload
$ sudo systemctl start lmstudio
$ sudo systemctl status lmstudio
Enter fullscreen mode Exit fullscreen mode

Stop it with sudo systemctl stop lmstudio.service when needed.


First-Run Configuration

  1. Get your first LLMDownload for the default model.
  2. Start New ChatSelect a model to load → pick the downloaded model (e.g. deepseek-r1-distill-qwen-7b).
  3. Enter a prompt (e.g. Add 3 random numbers divisible by 10), check token count, Enter to send.
  4. Power User / Developer on the bottom nav for advanced options.
  5. DiscoverModel Search to find more models, Runtime for runtime packs, Hardware to check system specs, App Settings for interface options, Check for updates.

Download and Run Models

  1. Discover → Model Search, search by name.
  2. Browse LM Studio Staff Picks or Hugging Face listings.
  3. Download to fetch it; monitor progress under Downloads.
  4. Models to see everything downloaded (filter by LLMs or Text Embedding).
  5. Chat → select a model → type a prompt, Enter.
  6. Check processing time/token stats in the output. New Chat / New Folder to organize sessions.

Enable API Access

Runs LM Studio headless, serving an OpenAI-compatible API.

  1. Developer → Settings.
  2. Set a custom port (default 1234).
  3. Serve on Local Network — only enable if you're not putting it behind a reverse proxy; keep off if Nginx will front it.
  4. Just-in-Time Model Loading — load models automatically on first request.
  5. Auto Unload unused JIT loaded models — set a max idle TTL.
  6. Flip server status to Running.
  7. Open the port in your firewall.
  8. Test it:
$ curl -X GET http://SERVER-IP:1234/v1/models
Enter fullscreen mode Exit fullscreen mode
{
  "data": [
    {
      "id": "deepseek-r1-distill-qwen-7b",
      "object": "model",
      "owned_by": "organization_owner"
    },
    {
      "id": "text-embedding-nomic-embed-text-v1.5",
      "object": "model",
      "owned_by": "organization_owner"
    }
  ],
  "object": "list"
}
Enter fullscreen mode Exit fullscreen mode

Put Nginx in Front with TLS

$ sudo apt update
$ sudo apt install nginx -y
$ sudo systemctl start nginx
$ sudo nano /etc/nginx/sites-available/lmstudio.conf
Enter fullscreen mode Exit fullscreen mode
server {
    listen 80;
    server_name lmstudio.example.com;

    location / {
        proxy_pass http://127.0.0.1:1234;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}
Enter fullscreen mode Exit fullscreen mode
$ sudo ln -s /etc/nginx/sites-available/lmstudio.conf /etc/nginx/sites-enabled/
$ sudo nginx -t
$ sudo systemctl restart nginx
$ sudo apt install certbot python3-certbot-nginx -y
$ sudo ufw allow http
$ sudo ufw reload
$ sudo certbot --nginx -d lmstudio.example.com -m email@example.com --agree-tos
$ sudo systemctl restart nginx
$ sudo ufw allow https
$ sudo ufw reload
Enter fullscreen mode Exit fullscreen mode

Confirm it works over HTTPS:

$ curl -X GET https://lmstudio.example.com/v1/models
$ curl https://lmstudio.example.com/api/v0/models/<model-name>
$ curl https://lmstudio.example.com/api/v0/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<model-name>",
    "prompt": "<prompt>",
    "temperature": 0.7,
    "max_tokens": 20,
    "stream": false,
    "stop": "\n"
  }'
Enter fullscreen mode Exit fullscreen mode

Next Steps

LM Studio is running as a service, serving models over an HTTPS API through Nginx. From here:

  • Point application code at the OpenAI-compatible endpoint instead of a cloud API
  • Load multiple models and switch between them per-request
  • Use JIT loading + idle TTL to keep memory usage low when models aren't actively serving traffic

For the full guide, visit the original article on Vultr Docs.

Top comments (0)