Back to blog
14 min read

Ollama vs LM Studio: Which to Run on a Linux Server

Ollama vs LM Studio for local AI models on a server without a GPU: Ollama sets itself up as a service, while LM Studio suits teams that already use its app.

TL;DR:

  • Ollama vs LM Studio on a Linux server: choose Ollama for an installer that sets up a systemd service under an unprivileged user, LM Studio when your team already uses the LM Studio app, and llama.cpp when you pick GGUF files and server options yourself.
  • Ollama serves its API on 127.0.0.1:11434 from ollama.service. llmster, LM Studio's headless daemon, installs into your home folder, serves on port 1234 and starts at boot with a systemd unit from LM Studio's docs.
  • Ollama and llama.cpp are open source under the MIT License. LM Studio is proprietary software from Element Labs, Inc., licensed for "personal and / or internal business purposes"; work use has needed no separate commercial license since July 8, 2025.
  • Both serve OpenAI-compatible and Anthropic-compatible APIs, so Open WebUI, n8n, OpenCode, LiteLLM and Claude Code can use either one.
  • In an arm64 test container with no model loaded, the Ollama service used under 70 MiB of memory and the llmster daemon about 600 MiB.
  • llama.cpp 0.9.0 is the third option: one MIT-licensed llama command that loads GGUF models on demand and serves a built-in web chat page.

Applies to: Ubuntu 26.04 LTS · Ollama 0.40.15 · LM Studio llmster 0.0.27-1 · llama.cpp 0.9.0 (build b12110) · checked November 2026

Ollama is an open-source runtime, released under the MIT License, that downloads open-weight language models and serves them through a command line and a local API. LM Studio is a desktop app from Element Labs, Inc. for running local models, and llmster is its headless daemon for servers, added in LM Studio 0.4.0 on January 28, 2026. This Ollama vs LM Studio comparison covers setup on a Linux server with no GPU, background running, app support, speed, licenses, and when llama.cpp fits better.

Ollama vs LM Studio vs llama.cpp at a glance

Ollama, LM Studio and llama.cpp all serve GGUF models over an OpenAI-compatible API on a Linux server. They differ in license, install location and how they run in the background.

OllamaLM Studio (llmster)llama.cpp
MakerOllamaElement Labs, Inc.ggml-org
LicenseMIT LicenseLM Studio Desktop App Terms of Service (llmster not named); the lms CLI is MITMIT License
Installs to/usr/local, system-wide~/.lmstudio, one user~/.local/bin and ~/.llama-app, one user
Background serviceCreated by the installerA systemd unit from LM Studio's docsA systemd unit you write, or Docker
Default API address127.0.0.1:11434127.0.0.1:1234127.0.0.1:9931
AuthenticationNone on the local APIOff by default; tokens are managed in the desktop appOff by default; --api-key
Model sourcesOllama library; GGUF importHugging Face; GGUF importHugging Face; any GGUF file
Idle modelsUnloaded after 5 minutesOn-demand models unloaded after 60 minutesStay loaded; router mode keeps up to 4
Parallel requests per model1 by default4 by defaultAutomatic
UpdateRun the install script againlms daemon updatellama update

Which is easier to install on a Linux server: Ollama or LM Studio?

Ollama is easier to set up as a server: one script installs it system-wide, creates an unprivileged ollama user and starts a systemd service. llmster installs per user with one script, and you add the boot service yourself.

Run the Ollama installer as your sudo user. It unpacks a .tar.zst archive and stops with ERROR: This version requires zstd for extraction if zstd is missing:

sudo apt update
sudo apt install -y zstd
curl -fsSL https://ollama.com/install.sh | sh

At the time of checking, it installed Ollama 0.40.15. With no GPU, the script ends with Unable to detect NVIDIA/AMD GPU (neither lspci nor lshw installed) or No NVIDIA/AMD GPU detected (one of them installed), and Ollama runs models on the CPU. How to Install Ollama on Ubuntu 24.04 with Open WebUI continues from here with a chat interface and HTTPS.

On a server, LM Studio means llmster, since the Linux desktop app is an AppImage for graphical sessions. The llmster installer runs without sudo and installs for the user that runs it. It stops with Missing required dependency: "libatomic" is not installed on your system until libatomic1 is installed, and warns Could not detect libgomp without libgomp1, which LM Studio's llama.cpp CPU engine needs:

sudo apt update && sudo apt install -y libatomic1 libgomp1
curl -fsSL https://lmstudio.ai/install.sh | bash

It installed llmster 0.0.27-1 into ~/.lmstudio, 3.5 GB in the arm64 test container before any model download. In a new SSH session, lms daemon up starts the daemon and prints llmster started. lms get downloads a model, lms load loads it, and lms server start opens the API on port 1234.

Which runs better in the background: Ollama's service or LM Studio headless?

Ollama's installer sets up the service, and its unit restarts the server 3 seconds after it exits. LM Studio's documented llmster unit starts the daemon at boot and has no restart rule.

ollama.service runs ollama serve as the ollama user with Restart=always and RestartSec=3. Change settings with sudo systemctl edit ollama and read logs with sudo journalctl -u ollama. On a CPU, Ollama keeps up to 3 models loaded when they fit and queues up to 512 requests before it answers with a 503 error.

LM Studio's docs give a unit for /etc/systemd/system/lmstudio.service that runs lms daemon up, lms load and lms server start at boot as the user that installed llmster. It is Type=oneshot with no Restart= line, so systemd does not restart a stopped daemon. Its API server needs no key and runs under that account, so on a shared server install llmster as a separate user without sudo privileges.

LM Studio vs Ollama: which apps connect to each?

Both serve OpenAI-compatible routes under /v1 and an Anthropic-compatible /v1/messages route, so most tools connect through a base URL. With default ports 11434 and 1234, both can run on one server when RAM allows.

AppOllamaLM Studio
Open WebUIBuilt-in Ollama connectionOpenAI-compatible connection at http://localhost:1234/v1
n8nOllama credential and nodesOpenAI credential with its Base URL set to LM Studio
OpenCodeollama launch opencodelmstudio provider at http://127.0.0.1:1234/v1
Claude Codeollama launch claudeANTHROPIC_BASE_URL=http://localhost:1234 with ANTHROPIC_AUTH_TOKEN=lmstudio
LiteLLMollama_chat/ model prefixlm_studio/ model prefix
Hermes Agent, OpenClawollama launch hermes, ollama launch openclawHermes Agent and OpenClaw guides in LM Studio's docs

Coding agents need long contexts: Ollama recommends at least 64,000 tokens for them, and LM Studio's Claude Code guide asks for more than about 25,000. Anthropic's gateway documentation states that Anthropic "doesn't support routing Claude Code to non-Claude models through any gateway". How to Set Up Claude Code with Ollama covers the Ollama side on a server.

Neither local API asks for a key by default, and LM Studio's docs switch API tokens on in the desktop app. Keep both on 127.0.0.1 and reach them over an SSH tunnel or a reverse proxy with authentication.

Ollama vs LM Studio: which is faster on a CPU server?

On a Linux CPU server, LM Studio runs GGUF models through its llama.cpp engine, and Ollama lists llama.cpp as a supported backend. No test for this post ran both on the same server, so it gives no speed verdict.

Arct Cloud's CPU benchmark of self-hosted LLMs measured Ollama 0.32.15 on a High Performance plan with 16 vCPU and 32 GB RAM, one request at a time, in August 2026.

ModelShort promptAfter an 8K-token prompt
Qwen3.5-4B13.43 tokens/s12.23 tokens/s
Qwen3.6-35B-A3B (mixture of experts)15.67 tokens/s14.24 tokens/s

Long prompts spend most of their time in prompt processing: on Qwen3.5-4B, 32.59 of the 43.07 seconds of the 8K-token request passed before the first token.

To compare both on your own server, load the same GGUF file at the same context length and send the same prompt. Ollama's API returns eval_count and eval_duration with each response, and LM Studio's REST API reports tokens_per_second and time_to_first_token.

Licenses, work use and model formats

Ollama and llama.cpp are released under the MIT License. LM Studio's Desktop App Terms of Service, version August 23, 2026, grant "a non-exclusive, non-transferable license to use the Software solely for Your personal and / or internal business purposes". Since July 8, 2025, use at work needs no separate commercial license. The restrictions include use "for service bureau use, as an application service provider, or a software-as-a-service". The terms do not name llmster, so check with Element Labs before you serve models to people outside your organization. Model weights carry their own licenses from their publishers.

All three run GGUF files on a Linux server. Since Ollama 0.34.1, ollama create builds MLX models from Safetensors weights, and Ollama 0.40.0 and later run supported models on MLX by default on Apple silicon. For a GGUF model, convert and quantize Safetensors weights with llama.cpp's tools first. LM Studio's MLX engine runs only on Apple silicon Macs, so a Linux server uses its llama.cpp engine.

Ollama copies an imported GGUF file into /usr/share/ollama/.ollama/models with a one-line Modelfile and ollama create, and leaves the original in place. lms import, which LM Studio's docs label experimental, moves a file into ~/.lmstudio/models unless you add --copy, --hard-link or --symbolic-link.

Ollama vs llama.cpp: when llama.cpp is the better pick

llama.cpp is the MIT-licensed C and C++ inference project from ggml-org. Version 0.9.0, tagged on November 4, 2026, ships as one llama command with serve, cli, download and update subcommands. Its installer, curl -LsSf https://llama.app/install.sh | sh, puts llama in ~/.local/bin; open a new SSH session before you run llama version.

Its server documentation calls the same server llama-server. Started without a model, llama serve runs in router mode, loads models on demand, listens on 127.0.0.1:9931 and warns no API key is set and CORS allows all origins and router mode enabled - do not expose to untrusted environments.

Keep it on 127.0.0.1 and reach it over an SSH tunnel. If another machine must connect, set --api-key and put a reverse proxy with TLS in front of it. OpenCode connects through its custom provider for OpenAI-compatible runtimes at http://127.0.0.1:9931/v1.

Pick llama.cpp over Ollama when:

  • You want to serve a GGUF file directly, with no Modelfile or ollama create step.
  • You want the built-in web chat page without installing Open WebUI.
  • You pick GGUF files and quantizations on Hugging Face yourself, such as -hf ggml-org/Qwen3.5-0.8B-GGUF:Q8_0.
  • You set context size (-c), parallel slots (-np) and API keys on the command line.

The installer creates no service: write a systemd unit, or run the ghcr.io/ggml-org/llama.cpp:server Docker image with its port published on 127.0.0.1, since ports Docker publishes bypass UFW.

When to choose Ollama

  • You want the installer to set up a service that runs as an unprivileged user and restarts on failure.
  • You want an open-source runtime under the MIT License.
  • You pull models by name from the Ollama library, such as qwen3.5:4b.
  • Your apps already have an Ollama connection, as Open WebUI, n8n and OpenCode do.

When to choose LM Studio

  • Your team already uses the LM Studio app and wants the same models and APIs on a server.
  • You want to reach the server's models from the LM Studio app on your computer: LM Link connects devices with end-to-end encryption through Tailscale, and lms link enable adds a headless server after lms login.
  • You want 4 parallel requests per model by default; Ollama's default is 1, set by OLLAMA_NUM_PARALLEL.
  • Your use fits LM Studio's Desktop App terms: personal or internal business purposes.

How much RAM Ollama and LM Studio need

RAM decides which models load. Plan for the model's download size plus 1 to 4 GB, then the OS, as in the best Ollama models for CPU servers by RAM size:

RAMExample modelDownload
8 GBqwen3.5:4b3.4 GB
16 GBqwen3.5:9b6.6 GB
32 GBqwen3.6:35b-a3b-q4_K_M24 GB

LM Studio's system requirements recommend 16 GB of RAM on macOS and Windows. For Linux they give no RAM figure and say Ubuntu versions newer than 22 are not well tested.

Arct Cloud plans with 8 GB RAM have 4 vCPU, 16 GB plans have 8 vCPU, and 32 GB plans have 16 vCPU. Sustained full-CPU load is not permitted on these plans, so run local models on demand and send continuous or batch generation to an API model.

FAQ

Is Ollama or LM Studio better for a server?

Ollama is the simpler fit for most Linux servers: its installer creates a systemd service and an unprivileged user, and it is open source under the MIT License. LM Studio's llmster suits teams that already use LM Studio and want 4 parallel requests per model by default.

Is LM Studio faster than Ollama?

No general answer holds: both run GGUF models on the CPU, and speed depends on the model, quantization, context length and vCPU count. Load the same GGUF file in both on your server, send the same prompt and compare tokens per second.

Can LM Studio run without a GUI on Linux?

Yes. llmster, LM Studio's headless daemon since version 0.4.0, installs with one command and runs without the desktop app. lms daemon up starts it, lms server start opens the API on port 1234, and a systemd unit from LM Studio's docs starts it at boot.

What is the difference between Ollama and llama.cpp?

llama.cpp is an MIT-licensed inference project and server for GGUF models. Ollama is a separate MIT-licensed runtime with its own model library, CLI and systemd service, and it lists llama.cpp as a supported backend. With llama.cpp you pick the GGUF files and server options yourself.

Can Open WebUI or n8n use LM Studio instead of Ollama?

Yes. Open WebUI documents LM Studio as an OpenAI-compatible connection at http://localhost:1234/v1, and n8n's OpenAI credential has a Base URL field for another OpenAI-compatible server such as LM Studio. Ollama has its own connection type in both apps.

Can Ollama and LM Studio use the same model files?

Yes, both run the same GGUF file, but each keeps its own model store. Ollama copies an imported GGUF into its store through a Modelfile and ollama create. LM Studio's lms import moves the file unless you add --copy, --hard-link or --symbolic-link.

Do I need a GPU to run Ollama or LM Studio?

No. Both run models on the CPU from system RAM when a server has no GPU. RAM decides which models load: plan for the model's download size plus 1 to 4 GB. The vCPU count and memory bandwidth decide how fast it answers.

Next steps

High Performance VPS plans run on AMD Ryzen 9 up to 5.7 GHz or AMD EPYC Genoa 9004 Series up to 4.3 GHz, with DDR5 RAM. Compare plans.