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.
System Requirements
Before downloading anything, confirm your hardware meets the minimums. CPU-only inference works, but a mid-range GPU transforms the experience.
| Component | Minimum | Recommended |
|---|---|---|
| CPU | x86_64 with AVX2 | 8+ cores, AVX-512 preferred |
| RAM | 8 GB | 32 GB for 13B+ models |
| Disk | 20 GB free | 200 GB+ (models run 2–42 GB each) |
| GPU (optional) | 4 GB VRAM, NVIDIA or AMD | 12–24 GB VRAM |
| OS | Ubuntu 24.04+, any modern distro | Ubuntu 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 -1If 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
wgetorcurlfor downloading the AppImagelibfuse2orlibfuse2t64(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.AppImageStep 2: Make It Executable and Run
chmod +x ~/Downloads/LMStudio.AppImage
~/Downloads/LMStudio.AppImageIf 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 -yIf FUSE installation isn't an option — containerized environments, corporate lockdowns — extract and run directly:
cd ~/Downloads
./LMStudio.AppImage --appimage-extract
./squashfs-root/AppRun --no-sandboxStep 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' >> ~/.bashrcYou 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.
| Format | Quality | Approx. Size (7B) | Use When |
|---|---|---|---|
| Q2_K | Degraded | ~2.7 GB | Severely RAM-constrained, last resort |
| Q4_K_M | Good | ~4.1 GB | Default choice — best quality/size trade-off |
| Q5_K_M | Better | ~4.8 GB | 8 GB+ VRAM, noticeable quality improvement |
| Q6_K | Near-lossless | ~5.5 GB | 16 GB+ RAM, quality-critical tasks |
| Q8_0 | Highest | ~7.7 GB | Best 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
| Task | Model | VRAM Needed |
|---|---|---|
| General chat / assistant | Llama 3.1 8B Instruct Q4_K_M | 6 GB |
| Code generation | Qwen2.5-Coder 7B Instruct Q4_K_M | 6 GB |
| Code (high quality) | Codestral 22B v0.1 Q4_K_M | 14 GB |
| Long documents (128k ctx) | Mistral 7B Instruct v0.3 Q4_K_M | 6 GB |
| Low RAM (< 8 GB) | Phi-3.5 Mini Instruct Q4_K_M | 3 GB |
| Maximum quality | Llama 3.1 70B Q4_K_M | 42 GB |
| Embeddings / RAG | nomic-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 vramStep 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 completionVerify it's running:
curl -s http://localhost:1234/v1/models | python3 -m json.toolExpected 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 openaifrom 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"
}
}