ancha serve runs an Ancha server until you stop it with Ctrl-C or SIGTERM. ancha run and ancha doctor start their own server when none is configured, so you only need serve to share one server between commands: ancha env, ancha sandbox, ancha mcp and ancha ui --server-url.
Example
Output
http://127.0.0.1:4400 is already the default for server commands:
--port 0 picks a free port. The server binds 127.0.0.1 by default.
Running it in Docker
Inside a container, bind all interfaces and advertise the host-side address, so the URLs it hands out work from your machine:--public-url must be a loopback HTTP origin without credentials. It changes the URLs the server advertises, not the bind address.
Environments and sandboxes live in the server’s memory and end when it stops.