Install Qwen Code on Linux, macOS, or Windows
Install, authenticate, and verify Qwen Code, then securely expose its experimental HTTP daemon with Localtonet for remote access.
In this article 12 sections
Install the coding agent, authenticate it, verify a safe local workflow, and understand when its experimental Web UI or daemon belongs in your setup
Qwen Code is an open-source coding agent for terminals, editors, desktop applications, browsers, automation, and chat integrations. This guide covers the supported standalone, npm, and Homebrew installation paths for Linux, macOS, and Windows. It then walks through first-run authentication, local verification, offline installation, updates, and removal. It also explains how qwen serve --open launches the experimental browser interface and how that workflow relates to the lower-level qwen serve HTTP, Server-Sent Events, and ACP daemon. Finally, it shows how to reach a verified daemon through a Localtonet HTTP tunnel and which of our documented tunnel settings add protection on top of Qwen Code's own daemon authentication. Daemon guidance was reviewed against Qwen Code v0.22.3 and the current documentation available in August 2026, so revalidate experimental behavior after upgrading.
📋 What's in this guide
Choose the right Qwen Code workflow and installation method
The normal Qwen Code workflow begins in a terminal. Open the project you want the agent to understand, run qwen, authenticate a model provider, and interact with the terminal interface. Installing the command-line application does not automatically start a web server or expose a network port.
Qwen Code also offers other interfaces for different use cases. The current project documentation lists desktop applications, editor integrations, a browser Web UI, SDKs, chat channels, headless execution, and an experimental daemon. These interfaces share the broader Qwen Code ecosystem, but they do not all have the same stability, security boundary, or network behavior.
qwen in a project directory for the primary terminal-based agent experience.
qwen -p "..." for noninteractive scripts, batch processing, and CI/CD workflows.
qwen serve --open to start the serve runtime and open its browser interface locally.
qwen serve when a compatible client needs the HTTP, SSE, and ACP service without automatically opening a browser.
Editor and automation interfaces outside the terminal
If you prefer to work inside an editor, the Qwen Code user guide groups several alternatives under "Outside of the terminal": Visual Studio Code, Zed IDE, JetBrains IDEs, and GitHub Actions. The same group also lists Daemon Mode and Local Deployment. The editor integrations suit developers who want agent assistance next to their source files, while GitHub Actions suits repository automation that runs in CI rather than on a workstation. The developer documentation also includes a VS Code IDE Daemon Adapter page within the daemon deep dive, which indicates that some editor workflows can sit on top of the same experimental daemon described later in this guide.
This guide focuses on installing the command-line application, because the editor integrations and the daemon both depend on a working, authenticated Qwen Code installation. Setup details for each editor and for GitHub Actions are not covered here. Use the matching page in the current Qwen Code user guide once the CLI passes the local checks below.
This article validates stable installation instructions against the current Qwen Code repository and release v0.22.3. The daemon and Web UI remain explicitly experimental. Even when a release reports no known breaking changes, integrations that depend on daemon routes, events, authentication, session behavior, or client adapters should be tested again after every upgrade.
For the project's current starting point, installation summary, and interface list, consult the Qwen Code repository and the Qwen Code user overview. The release used for the version-sensitive portions of this guide is Qwen Code v0.22.3.
Installation methods at a glance
| Method | Platforms | Requirement | Maintenance model |
|---|---|---|---|
| Standalone installer | Linux, macOS, Windows | A shell and access to the official installer asset | Use the current official installer for the standalone installation |
| npm | Supported Node.js environments | Node.js 22 or later and npm on PATH |
Update and uninstall through npm |
| Homebrew | macOS and Linux | A working Homebrew installation | Update and uninstall through Homebrew |
| Offline release archive | Where a matching official archive is available | Release archive, matching SHA256SUMS, and installer |
Stage and verify each replacement release explicitly |
Qwen documents that the recommended installer uses a standalone archive when one is available for the platform. If it falls back to npm, Node.js 22 or later and npm must be available on PATH. A fallback failure can therefore be a Node.js or npm problem even though you started with the standalone installer.
The convenient standalone commands send an installer from the official Qwen Code asset host directly to a shell. Confirm the hostname, use a trusted network, and follow your organization's software approval policy. In controlled environments, download and inspect the script before executing it or use the documented offline archive process.
Install Qwen Code on Linux, macOS, or Windows
Choose one installation path. Installing Qwen Code through several package managers can leave multiple qwen executables on the same computer. That makes updates and troubleshooting harder because the shell may launch a different copy from the one you just installed.
Linux or macOS: standalone installer
Open a terminal and run the official standalone installer:
curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen-standalone.sh | bash
Restart the terminal when the installer finishes. This reloads any environment changes and gives the new shell an opportunity to discover the installed executable.
Windows: standalone installer
Open PowerShell and run:
irm https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen-standalone.ps1 | iex
Close and reopen PowerShell, Windows Terminal, or the terminal inside your editor after installation. If qwen remains unavailable, investigate command discovery and PATH before installing a second copy.
Linux, macOS, or Windows: npm
The npm installation path requires Node.js 22 or later. Check the active runtime first:
node --version
npm --version
Then install the current Qwen Code package globally:
npm install -g @qwen-code/qwen-code@latest
Node.js version managers and npm prefix settings can change where global commands are installed. If npm reports success but the command is missing, check the global executable directory and the active Node.js environment instead of repeatedly reinstalling the package.
macOS or Linux: Homebrew
If Homebrew already manages your command-line tools, run:
brew install qwen-code
Continue to use Homebrew for upgrades and removal. Do not overlay an npm installation unless you intentionally understand and manage the resulting command precedence.
Confirm that the shell finds Qwen Code
Open a new terminal and request help:
qwen --help
Help output confirms that the shell can locate and execute Qwen Code. It does not confirm model-provider authentication or access to a specific project. Those checks come next.
Authenticate a model provider on first launch
Qwen Code needs a configured model provider before it can complete coding requests. Start it from the project directory that should form the initial workspace context:
cd /path/to/your-project
qwen
On first launch, Qwen Code prompts you to connect a provider. The documented choices include Alibaba ModelStudio, third-party providers, and a custom provider. Alibaba ModelStudio includes documented Coding Plan, Token Plan, and Standard API Key paths. Built-in third-party choices can include providers such as DeepSeek, MiniMax, Z.AI, Kimi, and OpenRouter. A custom provider can represent a compatible local server, proxy, or provider not represented by a built-in choice.
Review the workspace
Inspect the directory before launching the agent. Identify environment files, private keys, production data, generated artifacts, and other content that should not be available to the session.
Start the interactive interface
Run qwen from the intended project. Starting it from the wrong directory can provide the agent with unintended workspace context.
Open authentication settings
Follow the first-run prompt. If the prompt is no longer visible, enter /auth inside the Qwen Code session.
Choose the correct provider category
Select Alibaba ModelStudio, a listed third-party provider, or Custom Provider according to the service you actually use. Do not copy endpoint or credential formats from an unrelated provider.
Complete the provider's credential flow
Supply credentials through the supported prompt or provider-specific configuration. Keep API keys out of repositories, shell history, screenshots, public URLs, and support posts.
Begin with a read-oriented request
Ask a low-risk question such as what does this project do? or Explain this repository and show me where to start. Confirm that the response refers to the intended workspace before permitting edits or command execution.
The Qwen Code user documentation links onward to its current Authentication, Model Providers, and Settings pages, plus troubleshooting guidance. Use those version-current pages when a provider requires account, endpoint, model, or regional details beyond the common flow above.
A provider credential authorizes Qwen Code to call a model service. It should not be treated as proof that an incoming browser, ACP client, or HTTP request is authorized to control a running daemon. Daemon access control is a separate security boundary.
Qwen documentation pages that belong in a safe first run
The Qwen Code user guide navigation contains dedicated pages for the controls that matter most before you let an agent touch a real repository. This guide does not reproduce their settings, flags, or configuration keys, because exact values were not part of the evidence reviewed for this revision. The table below explains where each page fits so you know which one to read at each stage.
| Qwen documentation page | Where it fits in a safe first run |
|---|---|
| Model Providers | During authentication, when your provider needs details beyond the first-run prompt or when you configure a custom provider. |
| Trusted Folders | Before launching qwen in a real project, so you understand how Qwen treats directories you have and have not trusted. |
| Ignoring Files | Before the first workspace request, to keep secrets, generated output, and irrelevant data out of the agent's view. |
| Approval Mode | Before allowing edits or commands, so you decide how much the agent can do without asking you first. |
| Sandboxing | Before permitting shell execution, to understand which isolation options Qwen documents for tool and command runs. |
| Uninstall | During maintenance, especially for standalone installations where removal is platform-specific. |
| Daemon Mode and Local Deployment | Before running qwen serve, as the user-level introduction to the experimental serve runtime and local hosting. |
| Daemon REST API Reference and 20 · Quickstart & Operations | Before building a custom client or operating the daemon for more than a quick local test. |
A practical order is: authenticate, review Trusted Folders and Ignoring Files, choose an Approval Mode, review Sandboxing, and only then grant the agent edits or shell access. The daemon pages come later, once the ordinary terminal workflow is behaving as expected.
Verify interactive and headless operation locally
A complete local verification separates installation, authentication, workspace selection, and model execution. This prevents a daemon or tunnel from hiding the original source of a problem.
Check command discovery
qwen --help
If help appears, the shell can launch the executable. If it does not, restart the terminal, check PATH, and determine whether standalone, npm, or Homebrew installed the active copy.
Check an interactive request
cd /path/to/a/test-project
qwen
Authenticate if prompted and ask Qwen Code to summarize the test project. Verify that the answer reflects the intended directory. Use a disposable repository for the first test if you have not yet reviewed the Trusted Folders, Ignoring Files, Approval Mode, and Sandboxing pages described above, along with your tool permissions.
Check headless execution
Qwen documents the -p form for scripts, CI/CD, and batch jobs:
qwen -p "Summarize this project."
Run the command inside a non-sensitive test project. Headless mode can inherit the process working directory, environment, provider configuration, and operating-system permissions. Do not assume that removing the interactive interface also removes the need for approvals, isolation, credential protection, or output review.
Test qwen --help, then interactive authentication, then a harmless project request, and finally headless mode if you need automation. Only test qwen serve after these checks pass.
Prepare and verify an offline installation
Qwen's current overview documents offline installation using an official release archive and the installer's --archive PATH option. It also instructs users to keep the matching SHA256SUMS file beside the archive. The archive, checksum list, and installer must belong to the same release.
Use an internet-connected staging computer to obtain the official files. Record the release tag, target operating system, CPU architecture, archive filename, and source URL. Transfer the files through an approved method to the offline computer without renaming the checksum list.
Verify the archive checksum
On Linux, GNU sha256sum can verify entries in a checksum file:
sha256sum -c SHA256SUMS
If the checksum list contains artifacts that are not present in the directory, verify the selected archive's digest directly and compare it with that archive's exact entry in SHA256SUMS:
sha256sum /path/to/qwen-code-release-archive
On macOS, calculate the SHA-256 digest with:
shasum -a 256 /path/to/qwen-code-release-archive
On Windows PowerShell, use:
Get-FileHash -Algorithm SHA256 C:\path\to\qwen-code-release-archive
Compare the entire hexadecimal digest with the exact archive entry in the official SHA256SUMS file. Do not proceed if the filename, release, architecture, or checksum differs.
Run the installer against the verified archive
The documented offline interface is --archive PATH. Preserve the downloaded installer as a local file, inspect it if required, and pass the verified archive path to that installer. Do not pipe a network response into a shell on the offline machine.
Platform-specific script invocation and archive filenames can change with a release. The current primary evidence establishes the --archive PATH interface but does not provide a universal Windows parameter spelling or a permanent archive filename. Use the installer's local help or the manual-installation instructions linked from the
current Qwen Code overview
for the exact downloaded installer version. This limitation is preferable to presenting an unverified PowerShell parameter or obsolete artifact name.
After installation, open a new terminal and repeat:
qwen --help
Remember that installing the client offline does not guarantee offline model operation. A cloud model provider still needs outbound network connectivity. Fully local operation requires a compatible custom provider that is reachable from the Qwen Code computer.
Update, identify, and remove Qwen Code
Keep the original package source authoritative. Before an update, determine whether the active command came from npm, Homebrew, or a standalone installation. Shell-specific command-location tools can help identify duplicate executables.
On Linux or macOS:
command -v qwen
In PowerShell:
Get-Command qwen
| Installation source | Update | Remove |
|---|---|---|
| npm | npm install -g @qwen-code/qwen-code@latest |
npm uninstall -g @qwen-code/qwen-code |
| Homebrew | brew upgrade qwen-code |
brew uninstall qwen-code |
| Standalone | Run the current official installer and verify the resulting executable | Follow the current Qwen uninstall guidance for the standalone layout installed on that operating system |
| Offline archive | Stage, verify, and install the desired official release archive | Follow the uninstall procedure associated with that standalone release and platform |
The supplied current evidence provides exact npm and Homebrew removal commands through their package-manager conventions, but it does not provide one verified cross-platform standalone removal command or fixed installation directory. Deleting a guessed directory could remove the wrong copy or leave configuration behind. Use the Uninstall page available from the current Qwen Code documentation for the installed standalone release and operating system.
After updating, open a new terminal and repeat the help, authentication, and low-risk workspace tests. If you use the experimental Web UI or daemon, also repeat local listener, client compatibility, session, and authorization tests before restoring any remote access. If a Localtonet tunnel normally points at the daemon, stop it during the upgrade and start it again only after these checks pass.
Open the experimental Qwen Code Web UI
The documented browser workflow is:
cd /path/to/your-project
qwen serve --open
This command starts the experimental serve runtime and opens the Qwen Code Web UI in your browser. It is not a separate server implementation from daemon mode. The --open option adds the browser-opening workflow to qwen serve, while plain qwen serve is appropriate when a separate daemon client will connect or when you do not want the command to open a local browser automatically.
| Command | Primary use | Browser behavior | Stability |
|---|---|---|---|
qwen |
Interactive terminal session | Does not start the Web UI | Primary CLI workflow |
qwen -p "..." |
Headless automation | No browser interface | Documented automation workflow |
qwen serve --open |
Local browser Web UI | Opens the UI automatically | Experimental |
qwen serve |
Daemon clients and integrations | Does not request automatic browser opening | Experimental |
Verify the Web UI locally
Use a reviewed test workspace
Change into a disposable or deliberately selected project before starting the serve runtime.
Start the Web UI
Run qwen serve --open and keep the terminal visible so startup messages and errors remain available.
Confirm the browser origin
Verify that the browser opened the origin reported by the running Qwen process. Do not substitute a guessed port or route.
Run a harmless request
Ask the Web UI to explain the test project. Confirm that it uses the intended workspace and provider before allowing modifications or shell commands.
Stop the serve process
End the process from its terminal when testing is complete, then confirm that the local Web UI is no longer reachable.
qwen serve --open is a convenient local launch workflow. It should not be interpreted as evidence that the listener is safe for public internet access. Review the daemon's authentication, security, workspace, permission, and configuration documentation before changing its exposure.
Understand the experimental daemon before integrating a client
Qwen documents qwen serve as an experimental shared-agent daemon that clients can reach over HTTP and Server-Sent Events using ACP. In v0.22.3, the surrounding daemon documentation is substantially broader than a single startup command. The developer deep dive is organized into twenty numbered pages: system architecture, serve runtime, ACP bridge, permission mediation, MCP transport pool, MCP budget guardrails, workspace file system, session lifecycle and identity, typed event schema v1, SSE event bus and backpressure, capabilities and protocol versioning, auth and security model, the TypeScript SDK daemon client, a shared UI transcript layer, channel adapters, the VS Code IDE daemon adapter, a configuration reference, error taxonomy and remediation, observability and debugging, and quickstart and operations.
These areas matter because a coding-agent daemon is stateful. A client is not merely downloading a static web page. It can participate in sessions that have identities, capabilities, events, permissions, workspace access, model operations, and lifecycle transitions. Qwen Code v0.22.3 also introduced a standalone daemon session API covering creation, listing, resumption, archiving, and deletion of top-level sessions.
Where to start reading
For a first daemon run, begin with the user-level Daemon Mode and Local Deployment pages, then read "20 · Quickstart & Operations" in the developer deep dive for the operational view. Read "12 · Auth & Security Model" and "17 · Configuration Reference" before changing how the listener is reachable. If you plan to build your own client rather than use the Web UI, the Daemon REST API Reference, the "qwen serve HTTP protocol" page, the REST API integration guide, and the API-only DaemonClient quickstart (TypeScript) example are the relevant entry points. This guide intentionally does not copy listener flags, default ports, routes, or configuration keys from those pages, because exact values were not part of the reviewed evidence and can change between experimental releases.
HTTP, SSE, and ACP have different roles
- HTTP carries requests to the daemon's documented protocol routes.
- Server-Sent Events provide a long-lived server-to-client event stream and require correct reconnect and backpressure behavior.
- ACP defines the agent-client interaction expected by compatible clients and adapters.
- Typed event schemas let clients interpret events according to a documented version rather than guessing message fields.
- Capability and protocol negotiation help a client determine which operations are supported by the running daemon version.
A generic browser request or a successful TCP connection does not verify all of these layers. The Web UI started by qwen serve --open is the easiest documented local browser client. A custom client must implement the current HTTP protocol, ACP behavior, event handling, session identity, and authorization requirements described by the version-matched daemon documentation.
Security and permission mediation
The daemon documentation includes a dedicated authentication and security model as well as permission mediation. Treat those mechanisms as distinct from model-provider authentication. Review how the daemon identifies owners and sessions, how clients present authorization, which operations require permission, and what happens when authorization is missing or invalid.
Permission mediation also does not replace operating-system isolation. Start Qwen Code as an unprivileged account, limit the workspace to the files needed for the task, avoid storing credentials in the repository, and review enabled tools, MCP servers, extensions, shell access, and approval behavior. If the agent can read or execute something locally, a successfully authorized remote session may be able to request that capability through the daemon.
Extensions installed through the daemon
Extensions widen what a daemon session can do, so treat installation requests with the same care as tool permissions. As of v0.22.3, the release notes state that daemon Extension installs accept absolute local paths and reject relative paths and unsupported options such as ref. If an integration previously passed a relative path or a ref option, expect it to be rejected on this release and adjust it to an absolute local path that you have reviewed. Revalidate this behavior after upgrading, because it is a version-specific detail of an experimental feature.
Session lifecycle and identity
Do not treat every connection as an anonymous, disposable chat. Current daemon documentation includes session lifecycle and identity, and v0.22.3 exposes standalone session operations for creating, listing, resuming, archiving, and deleting top-level sessions. A remote client should preserve the session identifiers and ownership information required by the protocol rather than generating or reusing values arbitrarily.
Test initial connection, disconnect, reconnect, session resumption, archive behavior, deletion, and concurrent access before relying on a shared-agent workflow. Verify that one user or client cannot resume, inspect, or alter a session outside its intended scope.
SSE event handling and backpressure
Server-Sent Events are long-lived HTTP responses. A compatible client must parse the documented event schema, handle interruptions, reconnect according to the protocol, and avoid processing duplicated or stale events incorrectly. Qwen's current daemon documentation specifically addresses the SSE event bus and backpressure, so custom clients should implement those rules rather than assuming that a basic EventSource connection is sufficient.
Configuration, observability, and remediation
Use the daemon configuration reference matching the installed version for listener, authentication, security, workspace, and operational settings. Do not copy an address, port, route, header, or environment variable from a different release without confirming that it remains supported.
Keep daemon logs visible during local validation. The current documentation includes error taxonomy and remediation plus observability and debugging guidance. Use those categories to separate startup configuration failures, authorization failures, protocol-version mismatches, session errors, event-stream problems, provider failures, permission denials, and workspace problems.
This daemon overview was checked against Qwen Code v0.22.3 and the current documentation in August 2026. The feature remains experimental. Confirm listener options, HTTP routes, authorization requirements, event schema, capability negotiation, extension installation rules, and client-adapter behavior against the release you actually run.
Evaluate remote access without turning installation into unsafe public exposure
This is primarily an installation guide, not a complete public-daemon deployment recipe. This section covers the architecture, the prerequisites, and the documented Localtonet HTTP tunnel sequence. The next section covers the tunnel settings we provide for narrowing who can reach the address. Neither section claims that a reader can safely publish Qwen Code merely by copying a target port.
After Qwen Code works locally, our Localtonet client can run on the same device or another device that can reach the verified daemon listener. The client establishes an outbound connection to a Localtonet relay server. This provides a public HTTPS address without inbound router port forwarding, firewall changes, VPN setup, or a public IP address. We provide and renew the certificate, so the local daemon can stay on plain HTTP.
An HTTP tunnel is the relevant tunnel family because the Qwen daemon uses HTTP and SSE. The tunnel forwards traffic to a local IP address and port. It does not start Qwen Code, discover the listener, select an ACP route, configure daemon authentication, create session authorization, or make an incompatible client understand the protocol.
How the public address behaves
- The address is
https://followed by the host name shown in the URL column of your tunnel list. It has no port number, so clients open it like any other website. - An HTTP tunnel keeps its subdomain until you delete the tunnel. Stopping and starting it does not change the address, which helps clients that store the daemon origin.
- WebSocket connections pass through an HTTP tunnel.
- TLS ends at the Localtonet server. From there the request travels through the tunnel to your device, and the Localtonet app passes it to the local service. If a service must present its own certificate end to end, our documentation recommends a TLS tunnel instead of an HTTP tunnel.
Prerequisites before creating any tunnel
- The Localtonet client is installed on the device and connected with an AuthToken. If it is not, follow the Quick start in the Localtonet documentation first.
- For a Custom subdomain or Custom domain URL type, your account has balance. For a Custom domain, the domain is also added in DNS Manager.
qwenworks interactively in the intended project.- The model provider is authenticated and a harmless request succeeds.
qwen serve --openworks locally if the Web UI is the intended client.- Plain
qwen serveworks with the intended ACP client if a custom integration is required. - The listener address and port come from the running
qwen serveoutput or the installed version's configuration, not from a guessed default. - Daemon authentication and permission mediation are configured and tested.
- Session ownership, reconnect behavior, protocol versions, and SSE handling have been validated.
- The daemon runs as an unprivileged account with a deliberately limited workspace.
Documented Localtonet tunnel sequence
The steps below follow our current HTTP tunnel documentation in the same order. Keep qwen serve running in a visible terminal while you complete them so you can read its reported listener.
Open the HTTP page
In the Localtonet dashboard, open My Tunnels › HTTP and select Create HTTP Tunnel to open the form.
Choose the URL type
Random subdomain gives you a generated name on the selected domain and needs nothing extra. Custom subdomain uses the name you type in Subdomain, where letters, digits, and hyphens are allowed, and needs balance. Custom domain uses a domain of your own, selected in Domain, and needs balance plus a domain added in DNS Manager.
Choose the device and the region
In Device token, select the token used by the Localtonet app on the device that can reach the Qwen daemon. In Server region, choose a region close to that device for lower latency. Treat the token as a secret and keep it out of code, screenshots, logs, and public documentation.
Enter the local address
Select the Domain (localto.net or one of your own domains) and, for Custom subdomain only, the Subdomain. In Local IP address, use 127.0.0.1 when the daemon runs on the same device; the form accepts an IPv4 or IPv6 address or localhost. In Local port, enter the port from 1 to 65535 that you verified in the running qwen serve output. Then select Create tunnel. The tunnel appears under Your tunnels as Tunnel # followed by its ID.
Start the tunnel
Select the start button in the Actions column. When the tunnel runs, its address in the URL column becomes a link. If the Localtonet app for that token is offline, a dialog tells you so: start the app, or select Start anyway and the tunnel goes live when the app connects.
Creating the tunnel and starting it are separate actions. The public address serves traffic only while the selected Localtonet client is connected and the tunnel is running. For field definitions and examples, see our Localtonet HTTP tunnel documentation.
Test with the intended authenticated client
Once the tunnel is running, connect through the public HTTPS origin with the Qwen Web UI or the ACP-compatible client supported by the installed release. Do not use a generic request to judge success. Confirm daemon authorization, session identity, event delivery, reconnect behavior, and a harmless read-only request before permitting edits or commands. Apply the hardening settings in the next section before sharing the address with anyone.
Do not rely on an obscure public URL as authorization. A remotely controlled coding agent may have access to source code, local files, shell tools, extensions, MCP servers, provider-backed operations, and stored sessions. Apply Qwen Code's documented authentication and permission mediation, use least privilege, limit the workspace, add tunnel-level access controls, and stop the tunnel when remote access is no longer needed. If the current experimental daemon cannot meet your access-control requirements, keep it local or use an approved private-access design.
Reproducible tunnel verification
Verify the dependency chain in order. First confirm that the daemon remains running. Next verify the local Web UI or ACP client. Then confirm that the Localtonet device is connected and the tunnel is running. Finally, connect through the public HTTPS origin with the same supported client and authorization model.
- If no request reaches the daemon log, check the Localtonet client, selected device token, tunnel state, local IP address and port, public origin, and network path. The tunnel's Request Log shows whether requests are arriving at the tunnel at all.
- If the daemon returns an HTTP error, check the documented route, method, protocol version, headers, authorization, and session operation.
- If authorization fails, correct the daemon's access-control configuration rather than placing provider credentials in the public URL.
- If SSE connects and drops, inspect client reconnect behavior, event-schema compatibility, backpressure handling, tunnel state, the HTTP Timeout setting, and daemon logs.
- If the connection works but model calls fail, troubleshoot provider authentication and outbound access separately.
- If the wrong files appear, stop immediately and verify the daemon's workspace, process directory, and session identity.
Harden the Localtonet HTTP tunnel in front of the daemon
Every setting in this section is layered on top of Qwen Code's own daemon authentication, security model, and permission mediation. None of them replaces it. Tunnel-level controls decide who can reach the public address; the daemon still decides who can control a session and what that session may do. Keep both layers configured.
Open the Tunnel settings panel with the settings button in the Actions column. Under Tunnel Details you can rename the tunnel and change the local IP address and local port, which is useful if the daemon's listener changes after an upgrade. The remaining settings described below are documented on our HTTP tunnel page and the related pages it references. Availability of individual settings can depend on your plan, so check what the panel shows for your account.
http:// requests to the same address on https://. While it is off, the address answers on both. Turn it on for anything that carries logins or private data, which includes a coding-agent daemon.
Restrict who can reach the address
For a personal daemon, IP Restriction is usually the simplest first layer: allow only the networks you actually connect from. SSO Providers fits teams that already use an identity provider, and Basic Authentication? adds a credential prompt in front of the address. Browser-based tools generally handle the prompts and redirects these controls produce, but a non-browser daemon client may not. The reviewed evidence does not say whether the Qwen Web UI or a custom ACP client can complete a tunnel-level Basic Authentication or SSO step in addition to the daemon's own authorization, so test your exact client before relying on either. Configure the WAF from the WAF button and confirm that legitimate daemon traffic, including SSE streams, still passes after enabling it.
Bound the exposure in time and volume
A coding agent reachable from the internet should not stay reachable by accident. Set an Expiration Date so the tunnel stops on a known date even if you forget to stop it, and set a Bandwidth Limit so unexpected traffic cannot run indefinitely. Stopping the tunnel when you finish a session remains the most direct control, and because the subdomain persists across stop and start, stopping does not cost you the address.
Verify and troubleshoot with tunnel logs
Request Log lets you inspect requests that reached the tunnel, Activity Log records starts, stops, and setting changes, and Tunnel Health shows the health checks. These are explained on the Logs and inspection page. Use them alongside the daemon's own observability output: a request that appears in Request Log but never in the daemon log points at the local target, while a request missing from both points at the client, DNS, or access controls. Review Activity Log after any configuration change to confirm that nobody altered access settings unexpectedly.
HTTP Timeout and long-lived streams
HTTP Timeout sets how long the server waits for a response from your local application, from 1 to 600 seconds. It is a response-wait limit. Our documentation does not describe how it interacts with long-lived Server-Sent Events streams, so do not assume either way. Test a long-running agent request and an idle SSE connection through the tunnel, watch for disconnects, and adjust the value or the client's reconnect behavior based on what you observe.
The Host header
By default, the local service receives the host name the visitor used, which is the tunnel address. Some local servers validate or route by host name and answer with the wrong site or an error. If that happens, open Headers in the tunnel settings and add a request header named Host with the name your server expects; the service then receives that host name instead of the tunnel address. Whether the Qwen daemon checks the Host header is not stated in the evidence reviewed for this guide. Check Qwen's "12 · Auth & Security Model" and "17 · Configuration Reference" pages for your release before overriding it, because a Host check may be a deliberate security control rather than a misconfiguration.
Our HTTP tunnel documentation includes a section titled "The warning page on the Free plan". If your account is on the Free plan, read that section and test how your daemon client, SDK client, or SSE consumer behaves against the behavior it describes before depending on the tunnel. A browser user and a programmatic client can experience an intermediate page differently, so a successful browser test does not prove that a non-browser client will connect.
With an HTTP tunnel, TLS ends at the Localtonet server before the request travels through the tunnel to your device. Factor this into your data-handling policy for source code and prompts. When the local service must terminate TLS with its own certificate, our documentation recommends a TLS tunnel instead.
Troubleshoot installation, authentication, Web UI, and daemon problems
qwen is not found
Restart the terminal first. If the command remains unavailable, inspect PATH and determine where the selected installer placed the executable. For npm, verify Node.js 22 or later, npm's global prefix, and the active version-manager environment. For Homebrew, confirm that the appropriate Homebrew binary directory is on PATH.
The standalone installer fails during npm fallback
Install or activate Node.js 22 or later and ensure npm is available on PATH. Open a new terminal and retry the official installer. In a restricted network, verify access to both the official Qwen asset host and any package endpoints required by the fallback.
Authentication succeeds, but model requests fail
Enter /auth and confirm the selected provider. Check the provider credential, account state, endpoint, region, model availability, and outbound network policy. For a custom provider, verify its documented protocol compatibility on the Model Providers page instead of assuming that any model-related HTTP endpoint is compatible.
Headless output differs from the interactive session
Confirm that both commands use the same working directory, operating-system account, environment, provider configuration, and Qwen executable. Automation shells often load a different environment from interactive terminals.
qwen serve --open does not open a browser
Keep the terminal visible and inspect the startup output. The serve runtime may still have started even if the operating system could not launch a browser. Use only the local origin reported by the process. Do not guess a port or route. Also verify that ordinary qwen authentication works before debugging the Web UI.
qwen serve exits immediately
Read the first daemon error and classify it before changing network settings. Check configuration, workspace access, provider authentication, unsupported options, extension configuration, and occupied listener resources. A Localtonet tunnel cannot keep a failed daemon process alive.
A daemon Extension install is rejected
On v0.22.3, daemon Extension installs accept absolute local paths and reject relative paths and unsupported options such as ref. Replace a relative path with a reviewed absolute local path and remove unsupported options, then retry. Recheck this rule after upgrading.
A custom daemon client receives protocol errors
Confirm that the client and daemon use compatible ACP and HTTP protocol versions. Check capability negotiation, required headers, session identity, request sequencing, and the typed event schema. Do not infer the current protocol from an older example or from the behavior of the built-in Web UI.
The SSE stream repeatedly reconnects
Inspect daemon and client logs around the interruption. Check event parsing, reconnection state, duplicate handling, backpressure, authorization lifetime, session state, and network continuity. If a tunnel is present, repeat the same test locally to determine whether the interruption exists without the tunnel, then test the tunnel's HTTP Timeout value as described above.
An update appears to have had no effect
The shell may be running a different copy of qwen from the one you updated. Use command -v qwen on Linux or macOS, or Get-Command qwen in PowerShell. Remove obsolete copies through their original package managers after confirming which installation should remain.
The public URL opens, but the agent is not usable
A reachable HTTPS origin proves only part of the path. Confirm daemon authorization, protocol routes, Web UI asset loading, SSE connectivity, ACP compatibility, session creation or resumption, provider operation, and workspace permissions. If you are on the Free plan, also check client behavior against the warning page section of our HTTP tunnel documentation. Avoid sending destructive requests merely to test connectivity.
Localtonet tunnel symptoms and documented fixes
| Symptom | Likely cause | Documented action |
|---|---|---|
| A dialog appears when you select start | The Localtonet app for the selected device token is offline | Start the Localtonet app on that device, or select Start anyway so the tunnel goes live when the app connects. |
| The public address returns the wrong site or an error from the local server | The local service selects or validates by host name and receives the tunnel address | Open Headers in the tunnel settings and add a Host request header with the name the server expects. For the Qwen daemon, first confirm against its auth and security documentation that a Host override is appropriate. |
| The local service already uses HTTPS and the tunnel cannot reach it over plain HTTP | The tunnel connects to the local target without TLS | Turn on Is SslStream? so the Localtonet app connects to the local service with TLS. It accepts the local certificate as it is, so a self-signed certificate works. |
| The tunnel cannot connect with the normal method | The normal connection method is not working in your environment | Try Legacy Connect?. Changing Is SslStream? or Legacy Connect? on a running tunnel restarts it, so the Localtonet app must be connected. |
| A client has trouble connecting over HTTP/3 | HTTP/3 is on by default for new tunnels | Turn off Is HTTP/3 Active? only if a client has trouble with HTTP/3. |
Frequently asked questions
Does Qwen Code require Node.js?
The npm installation requires Node.js 22 or later. The standalone installer uses a standalone archive when one is available, but it can fall back to npm. Node.js 22 or later and npm must be on PATH for that fallback.
How do I authenticate Qwen Code?
Run qwen and follow the first-launch provider prompt. You can reopen authentication settings with /auth. Select Alibaba ModelStudio, a supported third-party provider, or a compatible custom provider and complete its credential flow.
Can I use Qwen Code from an editor instead of the terminal?
Yes. The Qwen Code user guide documents Visual Studio Code, Zed IDE, and JetBrains IDEs integrations, plus GitHub Actions for repository automation. Install and authenticate the CLI first, then follow the matching integration page.
What does qwen serve --open do?
qwen serve --open starts the experimental serve runtime and opens the Qwen Code Web UI in a browser. It is the browser-oriented form of the same serve capability used by daemon mode, not an unrelated server.
What is the difference between qwen serve and qwen serve --open?
Both use the experimental serve runtime. Plain qwen serve is suitable for daemon clients and integrations without requesting automatic browser launch. Adding --open opens the built-in Web UI for a local browser workflow.
Is Qwen Code daemon mode stable?
No. Qwen currently labels qwen serve and the Web UI workflow experimental. Pin the Qwen Code release used by an integration and revalidate configuration, routes, authorization, sessions, events, extension installation rules, and client compatibility after updating.
Can I install Qwen Code offline?
Yes, where an appropriate official release archive is available. Download the archive and matching SHA256SUMS, verify the SHA-256 digest, transfer the files, and run the installer with its documented --archive PATH interface. Cloud model providers may still require network access.
How do I uninstall Qwen Code?
For npm, run npm uninstall -g @qwen-code/qwen-code. For Homebrew, run brew uninstall qwen-code. Standalone locations and cleanup can vary by platform and release, so follow the Uninstall page in the current Qwen documentation for that installation rather than deleting a guessed directory.
Does Localtonet authenticate Qwen Code daemon users automatically?
No. A Localtonet HTTP tunnel forwards the daemon's HTTP traffic to a verified local target. You can add tunnel-level controls such as Basic Authentication?, IP Restriction, SSO Providers, and the WAF, but they only decide who can reach the address. Configure and test Qwen Code's own authentication, security, identity, and permission model before any remote exposure.
Which Localtonet access controls should I enable for a Qwen daemon tunnel?
Turn on Is Only Https?, then restrict reach with IP Restriction, SSO Providers, or Basic Authentication? depending on who needs access, and review the WAF setting. Set an Expiration Date and a Bandwidth Limit to bound exposure, and use Request Log, Activity Log, and Tunnel Health to verify behavior. Test your exact daemon client after each change, since non-browser clients may not complete every interactive prompt, and keep Qwen's daemon authentication enabled underneath.
Does creating a Localtonet tunnel start it immediately?
No. After you select Create tunnel, select the start button in the Actions column. If the Localtonet app for that token is offline, you can start the app or select Start anyway so the tunnel goes live when the app connects. Stop or delete the tunnel when remote access is no longer required.
Will the public address change if I stop the tunnel between sessions?
No. An HTTP tunnel keeps its subdomain until you delete the tunnel, and stopping and starting does not change it. That lets you stop the tunnel whenever you are not using the daemon without reconfiguring your client.
Connect only after Qwen Code passes local verification
Install and authenticate Qwen Code, validate the intended workspace, and test the experimental Web UI or daemon locally. If its version-specific security model is suitable for your use case, Localtonet can provide an outbound HTTP tunnel to the confirmed listener without opening an inbound router port, with HTTPS-only access, IP restriction, SSO, and expiration available to narrow who can reach it.
Get Started Free →Corrections & updates
Substantive changes approved by the Localtonet editorial team are listed transparently below.
Localtonet is a secure multi-protocol tunneling and proxy platform designed to expose localhost, devices, private services, and AI agents to the public internet supporting HTTP/HTTPS tunnels, TCP/UDP forwarding, mobile proxy infrastructure, file server publishing, latency-optimized game connectivity, and developer-ready AI agent endpoint exposure from a single unified control plane.