LM Studio Server on Local Network: Setup and Fixes
Published · 8 min read
Original research brief: . Sources reviewed: .
Quick answer: To run an LM Studio server on your local network, open the Developer tab, switch on Start server, then enable Serve on Local Network in the server settings. From a terminal,
lms server start --bind 0.0.0.0does the same. Other devices connect tohttp://YOUR_COMPUTER_IP:1234/v1(1234 is the documented default port). Turn on authentication before you share it.
LM Studio is a desktop app for running large language models on your own computer. It can also act as a server, so other apps and devices can send it requests. This guide covers starting the server, opening it to your network, finding the right URL, adding an API key, and fixing the common reasons it will not connect.
If you use Ollama instead, the Ollama local network guide covers the same job. For a side-by-side view, see Ollama vs LM Studio.
How to start the LM Studio server
There are two ways to start it. Both give you the same server.
In the app (macOS, Windows or Linux): open the Developer tab and turn on the Start server switch.
From a terminal (macOS, Windows or Linux): LM Studio ships with a command-line tool called lms. You do not install it separately, but you need to open LM Studio at least once first. Check it works with:
lms --help
Then start the server:
lms server start
Stop it again with:
lms server stop
A server with no model loaded has nothing to answer with. Load one from the app, or from the terminal:
lms ls
lms load <model-key>
lms ls lists the models on disk. lms ps shows which ones are loaded in memory right now. If you would rather not load models by hand, the server settings include Just in Time Model Loading, which loads a model when a request asks for it.
How to serve LM Studio on your local network
By default the server listens only on 127.0.0.1, also called localhost. That address means "this computer", so your phone or laptop cannot reach it.
To change that:
- In the app: turn on Serve on Local Network in the server settings. LM Studio then binds to a network address, and the API URL shown in the app updates to match.
- From a terminal: start the server with a bind address.
0.0.0.0means "listen on all IPv4 network interfaces".
lms server start --bind 0.0.0.0
The bind address can also come from the LMS_SERVER_HOST environment variable. This example is for macOS or Linux:
LMS_SERVER_HOST=0.0.0.0 lms server start
LM Studio's own docs carry a warning here: any bind other than 127.0.0.1 exposes the server beyond your computer, and they recommend turning on authentication. Do that next.
LM Studio API URL and port
LM Studio offers OpenAI-compatible endpoints. That means apps built for the OpenAI API can talk to it if you change the base URL. The docs use this base URL:
http://localhost:1234/v1
1234 is the default port. On another device, swap localhost for the computer's private network address, for example:
http://192.168.1.42:1234/v1
To pick a different port from the terminal:
lms server start --port 3000
If you leave out --port, the CLI reuses the last port you used. In the app, the port is the Server Port setting. When in doubt, copy the API URL the app shows rather than guessing.
The OpenAI-compatible endpoints listed in the docs include:
| Endpoint | Method | What it does |
|---|---|---|
/v1/models |
GET | Lists available models |
/v1/chat/completions |
POST | Chat replies |
/v1/completions |
POST | Plain text completion |
/v1/embeddings |
POST | Turns text into vectors for search |
/v1/responses |
POST | OpenAI Responses-style requests |
/v1/models is the best first test, because it needs no model to run.
How to add an LM Studio API key
LM Studio does not require authentication by default. Once the server is on your network, anyone on that network can use it. To lock it down:
- Open the Developer page and go to Server Settings.
- Turn on Require Authentication.
- Click Manage Tokens, then Create Token. Give it a name and choose its permissions.
- Copy the token straight away. LM Studio will not show it again.
Clients send the token as a Bearer token in the Authorization header. LM Studio's examples keep it in an environment variable called LM_API_TOKEN. On macOS or Linux:
curl http://192.168.1.42:1234/v1/models \
-H "Authorization: Bearer $LM_API_TOKEN"
In a client app, paste the token into its API key field. You can rename a token or change its permissions later from the same Manage Tokens screen.
Test the server from another device
Test the network before you blame a client app. From a second computer on the same Wi-Fi (macOS or Linux), run:
curl --max-time 5 http://192.168.1.42:1234/v1/models
On Windows, use curl.exe in PowerShell with the same arguments.
A JSON list of models means the server answered. You can also open the same URL in a phone browser. If authentication is on, expect an error without the token; that still proves the server is reachable.
To send a real chat request, replace the model name with one from your /v1/models list:
curl http://192.168.1.42:1234/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "your-model-identifier",
"messages": [{"role": "user", "content": "Hello, are you there?"}]
}'
LM Studio server not working on local network: checklist
Work through this in order and stop when a check fails.
- The server is running. The Start server switch is on, or
lms server startprinted no error. - A model is loaded, or Just in Time Model Loading is on. Check with
lms ps. - Serve on Local Network is on, or you started with
--bind 0.0.0.0. Restart the server after changing it. - You used the computer's network address, not
localhost. On a phone,localhostmeans the phone. - The port matches. Copy it from the app's API URL. It may not be 1234 if you changed it.
- The path is right. OpenAI-style clients usually want the base URL ending in
/v1. - The firewall allows it. Your operating system firewall may block incoming connections to LM Studio or its port.
- Both devices share a network. Guest Wi-Fi, client isolation, a VPN or mobile data can all stop the phone reaching the computer.
- The token is sent, if you turned on Require Authentication.
- CORS is on for browser apps. Web pages served from another origin need Enable CORS in settings, or
lms server start --cors. Native apps andcurldo not need it.
To see what requests reach the server, stream the logs:
lms log stream
If nothing appears when the other device tries to connect, the request is not reaching LM Studio. That points to the address, firewall or network, not the model.
Using LM Studio from your phone or away from home
Once /v1/models answers from another device, any client that supports a custom OpenAI-compatible base URL can use it. Enter the base URL, add the token if you set one, and pick a model.
For use outside your home, do not forward the LM Studio port on your router. That puts your server on the open internet. Use a private VPN such as Tailscale, or an SSH tunnel, so only your own devices can reach it. Keep authentication on as a second layer. The same advice applies to Ollama, as covered in running an LLM locally and using it from your phone.
Phones also struggle when replies get long. Context length and memory explains why a big model can be slow or fail on a modest computer; the same limits apply to LM Studio.
Want to chat from your phone instead?
LM Studio's server speaks an OpenAI-compatible API, so you need a phone client that supports that. If you would rather have a ready-made phone app, Ollama runs the same kind of open models on your computer, and our Ollama Connect app chats with it from iPhone or Android. To be clear, Ollama Connect talks to Ollama, not to LM Studio. The Ollama local-network guide covers the setup.
Sources
- LM Studio as a Local LLM API Server — LM Studio — https://lmstudio.ai/docs/developer/core/server
- Serve on Local Network — LM Studio — https://lmstudio.ai/docs/developer/core/server/serve-on-network
- Server Settings — LM Studio — https://lmstudio.ai/docs/developer/core/server/settings
- Authentication — LM Studio — https://lmstudio.ai/docs/developer/core/authentication
- OpenAI Compatibility Endpoints — LM Studio — https://lmstudio.ai/docs/developer/openai-compat
- lms server start — LM Studio — https://lmstudio.ai/docs/cli/serve/server-start
- lms CLI — LM Studio — https://lmstudio.ai/docs/cli
Frequently asked questions
- How do I start the LM Studio server?
- Open the Developer tab in LM Studio and turn on the Start server switch. From a terminal you can run lms server start instead.
- What port does the LM Studio server use?
- LM Studio's OpenAI compatibility docs use port 1234 as the default. With the lms CLI, leaving out the port flag reuses the last port you used, so check the API URL the app shows.
- How do I make LM Studio reachable from other devices?
- Turn on Serve on Local Network in the server settings, or start the server with lms server start --bind 0.0.0.0. Other devices then use the computer's network address instead of localhost.
- Does LM Studio need an API key?
- Not by default. You can turn on Require Authentication in the server settings, create a token under Manage Tokens, and send it as a Bearer token in the Authorization header.
- Should I open the LM Studio port to the internet?
- No. Keep it on your home network and use a VPN or an SSH tunnel when you are away. LM Studio itself warns that any bind other than 127.0.0.1 exposes the server and recommends turning on authentication.