diff --git a/1_developer/0_core/0_server/serve-on-network.md b/1_developer/0_core/0_server/serve-on-network.mdx similarity index 51% rename from 1_developer/0_core/0_server/serve-on-network.md rename to 1_developer/0_core/0_server/serve-on-network.mdx index 903ec55..62b97d3 100644 --- a/1_developer/0_core/0_server/serve-on-network.md +++ b/1_developer/0_core/0_server/serve-on-network.mdx @@ -14,6 +14,16 @@ This is useful for scenarios where you want to: - Let multiple people use a single LM Studio instance on the network. - Use the API from IoT devices, edge computing units, or other services in your local setup. -Once enabled, the server will bind to your local network IP address instead of localhost. The API access URL will be updated accordingly which you can use in your applications. +Once enabled, the server binds to a non-localhost address instead of localhost. The API access URL updates accordingly, which you can use in your applications. - + +Any bind other than `127.0.0.1` exposes the server beyond `localhost`; we recommend enabling [authentication](/docs/developer/core/authentication). Only do this if you know what you're doing. + + + + +To make the server available on your local network via the CLI, run: + +``` +lms server start --bind 0.0.0.0 +``` diff --git a/3_cli/1_serve/server-start.md b/3_cli/1_serve/server-start.mdx similarity index 55% rename from 3_cli/1_serve/server-start.md rename to 3_cli/1_serve/server-start.mdx index 19250ea..57a3267 100644 --- a/3_cli/1_serve/server-start.md +++ b/3_cli/1_serve/server-start.mdx @@ -18,6 +18,10 @@ The `lms server start` command launches the LM Studio local server, allowing you type: "flag" optional: true description: "Enable CORS support for web application development. When not set, CORS is disabled" +- name: "--bind" + type: "string" + optional: true + description: "Network address to bind the server to. Use \"0.0.0.0\" to listen on all IPv4 interfaces, or \"127.0.0.1\" (default) for localhost only. Can also be set via the LMS_SERVER_HOST environment variable." ``` ## Start the server @@ -44,7 +48,21 @@ For usage with web applications or some VS Code extensions, you may need to enab lms server start --cors ``` -Note that enabling CORS may expose your server to security risks, so use it only when necessary. + +Enabling CORS can expose your server to security risks; we recommend enabling [authentication](/docs/developer/core/authentication). Only do this if you know what you're doing. + + +### Bind to a network address + +To make the server available on your local network, run: + + +Any bind other than `127.0.0.1` exposes the server beyond `localhost`; we recommend enabling [authentication](/docs/developer/core/authentication). Only do this if you know what you're doing. + + +```shell +lms server start --bind 0.0.0.0 +``` ### Check the server status