# Wie man die LM Studio CLI im Linux-Terminal installiert

1. Öffnen Sie ein neues Terminal, um die LM Studio CLI auszuführen, oder verwenden Sie `tmux`
2. Hol dir [LM Studio](https://lmstudio.ai/download) oder führen Sie unten aus (Downloadgröße etwa 1 GB)

{% code overflow="wrap" %}

```bash
wget https://lmstudio.ai/download/latest/linux/x64?format=AppImage -O 'LM_Studio.AppImage'
chmod u+x ./LM_Studio.AppImage
```

{% endcode %}

<figure><img src="/files/d488e71ebe2788053aa9221de0b6b90108dbef5a" alt=""><figcaption></figcaption></figure>

2. Starten Sie LM Studio über

```bash
./LM_Studio.AppImage
```

Sie könnten Folgendes sehen:

<figure><img src="/files/687e7a6c1f727c1a88b17d9c775bfa293ad73b77" alt=""><figcaption></figcaption></figure>

{% code overflow="wrap" %}

```
[802435:0215/073628.027773:FATAL:sandbox/linux/suid/client/setuid_sandbox_host.cc:166] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now.
```

{% endcode %}

Falls ja, machen Sie stattdessen Folgendes:

```bash
./LM_Studio.AppImage --no-sandbox
```

3. Sie könnten dann Folgendes sehen, besonders wenn Sie sich in einer Cloud-Instanz ohne Desktop befinden:

<figure><img src="/files/4b0b56d19b7c469666d1e77c7dc44b4105ac3fdf" alt=""><figcaption></figcaption></figure>

{% code overflow="wrap" %}

```
[807101:0215/073740.801969:ERROR:ui/ozone/platform/x11/ozone_platform_x11.cc:249] Missing X server or $DISPLAY
[807101:0215/073740.802000:ERROR:ui/aura/env.cc:257] The platform failed to initialize.  Exiting.
Segmentation fault (core dumped)
```

{% endcode %}

Falls ja, installieren Sie einen "Fake"-Desktop-Simulator im Terminal:

```bash
sudo apt-get install xvfb
```

4. Verwenden Sie dann `xvfb` und starten Sie LM Studio:

```bash
xvfb-run --auto-servernum ./LM_Studio.AppImage --no-sandbox
```

<figure><img src="/files/05e208091ebb8d460f5b01ff3525bcc08c4f5fd2" alt=""><figcaption></figcaption></figure>

5. Holen Sie sich dann LM Studios LMS / CLI in einem anderen Terminal, oder nach CTRL+B+D für `tmux`

```bash
~/.lmstudio/bin/lms bootstrap
```

<figure><img src="/files/9b3327db75be7849d794aac2044238b581005824" alt=""><figcaption></figcaption></figure>

6. Öffnen Sie ein neues Terminal oder `tmux`  führen Sie dann aus:

```bash
lms
```

<figure><img src="/files/8365d80d7cc1bee42b7f232bcee7942513473b8f" alt="" width="375"><figcaption></figcaption></figure>

Wenn Sie sehen `-bash: lms: command not found` führen Sie bitte aus `lms` in einem neuen Terminalfenster!

7. Laden Sie nun ein Modell wie [Qwen3-Coder-Next](/docs/de/modelle/qwen3-coder-next.md) wie unten. Wenn Downloads hängen bleiben, siehe [Hugging Face Hub, XET-Debugging](/docs/de/grundlagen/troubleshooting-and-faqs/hugging-face-hub-xet-debugging.md)

{% code overflow="wrap" %}

```bash
pip install -U huggingface_hub
hf download unsloth/Qwen3-Coder-Next-GGUF \
    --local-dir unsloth/Qwen3-Coder-Next-GGUF \
    --include "*UD-Q4_K_XL*"
```

{% endcode %}

8. Wir importieren das Modell dann über:

{% code overflow="wrap" %}

```bash
lms import \
    unsloth/Qwen3-Coder-Next-GGUF/Qwen3-Coder-Next-UD-Q4_K_XL.gguf \
    --symbolic-link --user-repo "unsloth/Qwen3-Coder-Next-GGUF" -y
```

{% endcode %}

Sie könnten sehen `EEXIST: file already exists, symlink 'unsloth/Qwen3-Coder-Next-GGUF/UD-Q6_K_XL/Qwen3-Coder-Next-UD-Q6_K_XL-00001-of-00003.gguf' -> '~/.lmstudio/models/unsloth/Qwen3-Coder-Next-GGUF/Qwen3-Coder-Next-UD-Q6_K_XL-00001-of-00003.gguf'` was nur bedeutet, dass Sie das Modell bereits in LM Studio geladen haben.

Sie können auch alle LM Studio-Modelle prüfen über:

```bash
ls ~/.lmstudio/models
```

8. Sie können Modelle auch erhalten via `lms get` über Folgendes:

```bash
lms get https://huggingface.co/unsloth/Qwen3-Coder-Next-GGUF@Q4_K_XL
```

<figure><img src="/files/00c4b876b082f5ad8f05f54487f0069d06c76e41" alt=""><figcaption></figcaption></figure>

Sie werden dann sehen:

```
Finalizing download...
Download abgeschlossen. Sie können das Modell laden mit: 
lms load qwen3-coder-next
```

<figure><img src="/files/2c2611a077317d743d6a95a7a57548de74bb0099" alt=""><figcaption></figcaption></figure>

Dann laden `lms load qwen3-coder-next`:

<figure><img src="/files/2ff271f36547bd9c951cc792287b0df76dd37c94" alt=""><figcaption></figcaption></figure>

9. Starten Sie dann den Server von LM Studio:

```bash
lms server start --port 8001 --bind 127.0.0.1
```

Sie werden sehen `Erfolg! Server läuft jetzt auf Port 8001`

9. Dann verwenden Sie in einem neuen Terminal das Modell über den OpenAI-kompatiblen Endpunkt:

```python
from openai import OpenAI
import json
openai_client = OpenAI(
    base_url = "http://127.0.0.1:8001/v1",
    api_key = "null",
)
model_name = next(iter(openai_client.models.list())).id
print(model_name)
completion = openai_client.chat.completions.create(
    model = model_name,
    messages = [{"role": "user", "content": "What is 2+2?"},],
)
print(completion.choices[0].message.content)
```

<figure><img src="/files/aabbb483bea2180db13f43b2168095e202fba6a7" alt=""><figcaption></figcaption></figure>

Und fertig!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://unsloth.ai/docs/de/grundlagen/inference-and-deployment/lm-studio/how-to-install-lm-studio-cli-in-linux-terminal.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
