When LM Studio reports that its port is in use, identify the process already listening before you stop anything. For a same-Mac setup, a practical fix is to start LM Studio on a free loopback port, verify its model endpoint, and update the address in the client you want to use.

This guide assumes you control the Mac and use the local LM Studio API from a client on that same machine. You need Terminal and access to the LM Studio Developer tab. Keep the server loopback-only while you make the change. A port conflict can arise even if your browser never displays a page, because a listening process reserves the address independently of its purpose. LM Studio’s local server guide.

Write down which address the client expects

Record the address configured in the client and the port shown in LM Studio. The OpenAI-compatible address commonly ends with port 1234 and the version prefix v1. A custom port may have been saved in a prior session. Treat the displayed server setting and the client’s saved address as two different observations. Each can be correct on its own and still point at different processes.

Keep one local client in mind during the recovery. If you use several applications, there is no need to switch them all while diagnosing the first problem. Use the same client for the final test that failed at the start. Write down the model identifier and a short prompt so a different model or lengthy input does not complicate the troubleshooting.

Open the Developer tab. If it shows a running server, try the model list before changing the port. A working server might already be available at another address, or you might simply need to update the client. If the server cannot start, look at the message and note whether it mentions a binding or address conflict. A model-load error calls for checking the model and runtime, while a bind error directs attention to the server’s listening address.

See what is listening

Use the listener check for the port shown in the startup error. The example uses 1234. The options keep IP addresses and ports numeric and select TCP listener rows, making it easier to compare the result with the address in the application.

lsof -nP -iTCP:1234 -sTCP:LISTEN

Look at the command name, process ID, and address or port on each row. A row for another application tells you why the address may already be occupied. A row for LM Studio suggests a server process might already be running. Check it through the application’s status controls and an API request to establish whether it is the intended instance. The command reads your machine’s visible sockets. An empty result is one observation at that moment, and a process can start after the check. The lsof project’s listener and file selection documentation.

If the visible row is unfamiliar, leave it running while you choose a port for LM Studio. The row does not tell you whether the application is performing a task you need. Stopping a process based on the port alone can disrupt another workflow. If you recognize a server you intentionally started and want to close it, use that application’s normal stop control. When you know it is your own LM Studio server, the Developer switch or its documented CLI stop command can close that server. LM Studio’s server stop command.

Start LM Studio on an available loopback port

Pick another local port and inspect it with the same listener check. The following uses 1235 as a candidate port. If a process is listed there too, choose a different port and repeat the check. Port availability can change between inspection and startup. The server’s status after you start it is the confirmation that the port worked.

lsof -nP -iTCP:1235 -sTCP:LISTEN

Set the local server port in LM Studio’s Developer settings and start the server. If you already use the LM Studio command line and need to select the port explicitly there, the server start command accepts a port and a bind address. Do this with the old server stopped or from an initial state with no server running.

lms server start --bind 127.0.0.1 --port 1235
lms server status

The bind address keeps the listener reachable from the same Mac. Check the status for the port you requested. If it reports another running port, go to the Developer tab and identify which instance is active before sending further requests. Use one server state for the verification rather than switching between the graphical application and a separate background runtime without checking which one is running. LM Studio’s server startup options · LM Studio’s CLI status command.

Verify the new endpoint on its own

Request the model list from the Mac using the new port. The example uses loopback and the version prefix required by the OpenAI-compatible model list. If you have enabled server authentication, add the local Bearer token according to the LM Studio documentation. Keep the token in the client credential field rather than in the troubleshooting note.

curl -sS -i --noproxy 127.0.0.1 --max-time 10 \
  'http://127.0.0.1:1235/v1/models'

Look for an HTTP success response and the intended model’s identifier in the JSON. A response with an authentication error proves a server answered the request and gives you a credential to check. A refused connection directs you back to the listener and server status. A plain web page or unexpected endpoint suggests that the address belongs to another application. Use the response type and the listener row together to identify the right service.

The model list can include models available for loading, depending on the server’s configuration. For the first chat, load the intended model in LM Studio and use its exact identifier. This separates the port change from the cold model-loading path. LM Studio’s model-list API · LM Studio’s server authentication settings.

Update one client and retry the original route

Open the client’s saved connection. Change its port to the new value, keeping the same protocol, local host, API prefix, and authentication that the client expects. Some clients take a full base URL, while others separate the host and versioned request path. Use the input fields the client documents. Avoid entering the chat endpoint itself where the client expects an API base URL.

Create a fresh test chat after saving the address. Before the request, choose the same model ID you found on the new port. Ask for a short expected code such as Bay 23, then check for that value in the completed reply. If the model list works and you receive a chat error, check the model ID, authentication, and the server’s chat response before choosing another port. A completed response on the new endpoint is the practical goal of the port change. LM Studio’s chat completions request.

If your application connects successfully, save its previous and new addresses in your local notes. Update another client only when you need it to use that same server. If it still points at the old port, the old configuration can continue to reach the unrelated process and produce a confusing error. Tracking the port for each client makes it easier to reproduce the exact state after a restart.

Check the working settings after restarting

When you next start LM Studio, compare the port shown in the Developer tab with the connection you saved. Some startup commands use the last server port when you omit an explicit value. Repeat the listener check and one model-list request if the next session fails. An occupied port at startup is a separate fact from a changed port setting.

Keep the working configuration as long as the new endpoint solves the problem. If you later return to the previous port, check that the original listener has closed before changing the server and client together. You can then confirm the old endpoint and rerun the same short test. This gives you an observable rollback path without relying on the process name alone.

Work through a port-conflict example

Suppose the browser client uses port 1234, while LM Studio’s Developer tab says it could not start. The listener check reports an existing process for another local tool. Leave that tool running and check port 1235. If it is free, start LM Studio there and open the direct model endpoint on 1235. The expected evidence is an active server at the new port and a model list that contains the model you loaded. The original occupied port remains part of the other application’s setup.

Now suppose the listener belongs to an LM Studio process and the model endpoint on 1234 already works. There may be no need to choose a second port. Confirm that the response advertises the model and configuration you want, then compare the saved client address. If the app reports a clash while an existing instance works, identify why you attempted a second start. A second process does not help when the correct server is already in place.

You can also stage an easy test without deliberately occupying a port. Run the model-list request at the configured port and at a candidate port you know is unused. The first should produce the expected JSON when the server is running. The second should refuse or fail to connect if nothing is listening there. Together they illustrate the difference between transport and application responses. If the candidate port unexpectedly returns a reply, inspect the listener again before selecting it.

Keep a note of the difference between the server’s display name and the process name printed by the operating system. A daemon can have a short process label even though the user-facing app has a longer name. Use its documented control and direct response to identify the service. That is more reliable than deciding from a name alone that one process should be stopped.

Preserve the working port for other callers

Suppose a desktop note assistant already uses port 1234 for a separate model service, and your new project can take 1244. Record the old caller and listener before choosing the new address. Keep a small note with both destinations and the apps that use them. Once LM Studio is listening on its new port, request each service’s own known health or model path from Terminal. Both should agree with their respective configurations. Then test your new project with the new setting. This avoids deciding that an earlier app should change merely because you found a convenient port.

For a setup that worked yesterday and has since restarted, compare the listener’s reported port against the last known record. A process occupying the old port may be the expected service if it restarted first. It may also be another local program. Read the process identity again instead of acting on yesterday’s process ID. Operating system process IDs are temporary, whereas the app name, address, and purpose in your worksheet can help you identify the correct match today.

If you decide later to consolidate the two callers, do a planned transition. Check that both clients support the chosen backend and exact model ID, then verify one client at a time. A correctly reachable port establishes where the request went. The model listing and synthetic response still establish whether that destination serves the configuration each app expects.