How to Install LM Studio on Linux

How to Install LM Studio on Linux

Tested on: Ubuntu 26.04 LTS · Fedora 44 · Debian 12 — Last updated: June 2026

LM Studio is a graphical application for downloading, managing, and running large language models entirely on your own hardware. It ships an OpenAI-compatible API server, which means every tool that already talks to OpenAI — Continue.dev, Aider, shell scripts using curl — works against your local models with a one-line config change.

Contents
  1. System Requirements
  2. Prerequisites
  3. Step 1 — Install LM Studio on Linux
    1. Step 1: Download the AppImage
    2. Step 2: Make It Executable and Run
    3. Step 3: Install System-Wide with a Desktop Launcher
  4. Step 2 — First Launch and Storage Configuration
  5. Step 3 — Download Models
    1. Choosing a Quantization
    2. Recommended Models by Task
  6. Step 4 — Configure GPU Offloading
  7. Step 5 — Run the Local API Server
  8. Using the API
    1. curl — Quick Test
    2. Python — Using the openai Library
    3. Configure Continue.dev (VS Code / JetBrains)
  9. Headless / CLI Mode

System Requirements

Before downloading anything, confirm your hardware meets the minimums. CPU-only inference works, but a mid-range GPU transforms the experience.

ComponentMinimumRecommended
CPUx86_64 with AVX28+ cores, AVX-512 preferred
RAM8 GB32 GB for 13B+ models
Disk20 GB free200 GB+ (models run 2–42 GB each)
GPU (optional)4 GB VRAM, NVIDIA or AMD12–24 GB VRAM
OSUbuntu 24.04+, any modern distroUbuntu 26.04 LTS

On a CPU-only machine with a modern 8-core processor, expect 15–30 tokens/second with a 7B Q4_K_M model. An RTX 3060 (12 GB VRAM) pushes that to 60–80 tokens/second with the entire model in VRAM — the difference between a tool you tolerate and one you actually use.

Check AVX2 support before proceeding:

grep -o 'avx2' /proc/cpuinfo | head -1

If that returns nothing, LM Studio will refuse to run. AVX2 has been standard since Intel Haswell (2013) and AMD Excavator (2015), so this is rarely a problem on modern hardware.

Prerequisites

  • A 64-bit Linux system with a kernel ≥ 5.4
  • wget or curl for downloading the AppImage
  • libfuse2 or libfuse2t64 (Ubuntu 26.04) — required for AppImage execution
  • For NVIDIA GPU acceleration: the proprietary driver (≥ 520) and CUDA runtime. ROCm 5.7+ for AMD.
  • Sufficient disk space — budget at least 50 GB if you plan to experiment with multiple models

Step 1 — Install LM Studio on Linux

LM Studio distributes as an AppImage — a self-contained binary that requires no system-level installation and runs on any modern distro.

Step 1: Download the AppImage

Go to lmstudio.ai, click Download, and select the Linux AppImage. Alternatively, grab it from the terminal — replace the version string with the latest from the releases page:

wget "https://releases.lmstudio.ai/linux/x86/0.3.6/latest/LM_Studio-0.3.6.AppImage" 
     -O ~/Downloads/LMStudio.AppImage

Step 2: Make It Executable and Run

chmod +x ~/Downloads/LMStudio.AppImage
~/Downloads/LMStudio.AppImage

If you hit a FUSE error immediately, install the compatibility library first:

# Ubuntu 24.04
sudo apt install libfuse2 -y

# Ubuntu 26.04 (ships FUSE 3 by default, needs the compat package)
sudo apt install libfuse2t64 -y

# Fedora
sudo dnf install fuse -y

If FUSE installation isn't an option — containerized environments, corporate lockdowns — extract and run directly:

cd ~/Downloads
./LMStudio.AppImage --appimage-extract
./squashfs-root/AppRun --no-sandbox

Step 3: Install System-Wide with a Desktop Launcher

Running the AppImage from ~/Downloads works, but a proper system installation makes it accessible from your application menu and launchable by other tools.

# Move to /opt
sudo mv ~/Downloads/LMStudio.AppImage /opt/lmstudio.AppImage
sudo chmod +x /opt/lmstudio.AppImage

# Create a .desktop entry
cat > ~/.local/share/applications/lmstudio.desktop << 'EOF'
[Desktop Entry]
Name=LM Studio
Comment=Run LLMs locally
Exec=/opt/lmstudio.AppImage --no-sandbox %U
Icon=lmstudio
Terminal=false
Type=Application
Categories=Development;Science;ArtificialIntelligence;
StartupNotify=true
EOF

# Refresh the desktop database so it appears in launchers
update-desktop-database ~/.local/share/applications/

Step 2 — First Launch and Storage Configuration

On first launch, LM Studio prompts you to choose a model storage directory. The default is ~/.cache/lm-studio/models/. If your home partition is small, redirect this before downloading anything — models range from 2 GB to 42 GB and you will accumulate several.

# Set a custom models directory via environment variable before launching:
export LM_STUDIO_MODELS_DIR=/mnt/bigdisk/lm-studio/models
/opt/lmstudio.AppImage

# To make this permanent, add to ~/.bashrc or ~/.zshrc:
echo 'export LM_STUDIO_MODELS_DIR=/mnt/bigdisk/lm-studio/models' >> ~/.bashrc

You can also change the directory inside the app after launch: Settings → Storage → Models Directory.

Step 3 — Download Models

Open the Discover tab (magnifying glass icon in the left sidebar). LM Studio searches Hugging Face for GGUF-format models. GGUF is a quantized binary format that enables efficient inference on both CPU and GPU without the overhead of the original PyTorch weights.

Choosing a Quantization

Each model comes in multiple quantization levels. More bits = higher quality = larger file = more RAM/VRAM required.

FormatQualityApprox. Size (7B)Use When
Q2_KDegraded~2.7 GBSeverely RAM-constrained, last resort
Q4_K_MGood~4.1 GBDefault choice — best quality/size trade-off
Q5_K_MBetter~4.8 GB8 GB+ VRAM, noticeable quality improvement
Q6_KNear-lossless~5.5 GB16 GB+ RAM, quality-critical tasks
Q8_0Highest~7.7 GBBest local quality, 16 GB+ RAM/VRAM

Start with Q4_K_M. The quality difference between Q4_K_M and Q8_0 is measurable in benchmarks but rarely meaningful in day-to-day use.

Recommended Models by Task

TaskModelVRAM Needed
General chat / assistantLlama 3.1 8B Instruct Q4_K_M6 GB
Code generationQwen2.5-Coder 7B Instruct Q4_K_M6 GB
Code (high quality)Codestral 22B v0.1 Q4_K_M14 GB
Long documents (128k ctx)Mistral 7B Instruct v0.3 Q4_K_M6 GB
Low RAM (< 8 GB)Phi-3.5 Mini Instruct Q4_K_M3 GB
Maximum qualityLlama 3.1 70B Q4_K_M42 GB
Embeddings / RAGnomic-embed-text v1.5< 1 GB

Step 4 — Configure GPU Offloading

GPU offloading controls how many model layers run on the GPU. Each layer offloaded to the GPU frees CPU cycles and dramatically increases inference speed. LM Studio auto-detects your GPU and suggests a default, but you can tune it manually.

In the Chat tab, click the gear icon next to the loaded model name. The GPU Layers slider appears. As a starting point:

  • 7B model, 8 GB VRAM: all 33 layers on GPU — full GPU inference
  • 13B model, 8 GB VRAM: 20–25 layers on GPU — partial offload, still much faster than CPU-only
  • No GPU: 0 layers — CPU inference via llama.cpp

After adjusting, reload the model. Check VRAM usage to confirm it isn't over-allocated:

# NVIDIA
nvidia-smi --query-gpu=memory.used,memory.free --format=csv

# AMD
rocm-smi --showmeminfo vram

Step 5 — Run the Local API Server

This is where LM Studio earns its place in a developer workflow. Click the Developer tab (</> icon), select your loaded model from the dropdown, and click Start Server. The server binds to http://localhost:1234 by default and exposes three endpoints:

GET  /v1/models              # list loaded models
POST /v1/chat/completions    # chat (messages array)
POST /v1/completions         # legacy text completion

Verify it's running:

curl -s http://localhost:1234/v1/models | python3 -m json.tool

Expected output:

{
  "object": "list",
  "data": [
    {
      "id": "lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF",
      "object": "model",
      "type": "llm",
      "publisher": "lmstudio-community",
      "arch": "llama"
    }
  ]
}

Using the API

curl — Quick Test

curl http://localhost:1234/v1/chat/completions 
  -H "Content-Type: application/json" 
  -d '{
    "model": "lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF",
    "messages": [
      {"role": "system", "content": "You are a helpful Linux systems engineer."},
      {"role": "user", "content": "How do I find all files larger than 1 GB on this system?"}
    ],
    "temperature": 0.7,
    "max_tokens": 512
  }'

Python — Using the openai Library

No custom SDK needed. Point the official openai library at your local server:

pip install openai
from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:1234/v1",
    api_key="lm-studio"   # required by the library, value is ignored locally
)

response = client.chat.completions.create(
    model="local-model",  # LM Studio ignores this field; it uses the loaded model
    messages=[
        {"role": "system", "content": "You are a Linux systems expert."},
        {"role": "user",   "content": "Write a bash script to monitor disk usage and alert at 90%."}
    ],
    temperature=0.7,
    max_tokens=1024
)

print(response.choices[0].message.content)

Configure Continue.dev (VS Code / JetBrains)

{
  "models": [
    {
      "title": "LM Studio — Llama 3.1 8B",
      "provider": "lmstudio",
      "model": "llama3.1-8b-instruct",
      "apiBase": "http://localhost:1234"
    }
  ],
  "tabAutocompleteModel": {
    "title": "LM Studio — Qwen2.5-Coder",
    "provider": "lmstudio",
    "model": "qwen2.5-coder-7b-instruct",
    "apiBase": "http://localhost:1234"
  }
}

Headless / CLI Mode

Go up