unContainer

Concepts

Network

Outbound access starts disabled. Inbound access is limited to the loopback ports you publish.

Outbound policies

PolicyFlagWhat the guest can reach
None--network none (default)Nothing outside the guest
Allow list--allow HOST:PORT, repeatableOnly the listed IPv4 TCP endpoints
Full--network fullAny IPv4 TCP destination and DNS through the host, including your LAN
uncontainer run -- curl -fsS https://example.com
curl: (6) Could not resolve host: example.com
uncontainer session open --allow pypi.org:443 --allow files.pythonhosted.org:443

How allow rules work

  • The host resolves allowed names at boot and permits connections to those addresses and ports for the guest’s lifetime.
  • Guest DNS answers only for listed names.
  • Other services sharing an allowed IP and port are reachable at that endpoint.
  • Redirects to other hosts need their own entries.

Opening an existing session without network options keeps its policy. To change it or refresh resolved addresses, close and reopen.

Publishing guest ports

FormHost side
--publish 3000A free loopback port chosen by the OS, printed to stderr
--publish 8080:3000Fixed: 127.0.0.1:8080

--forward is an alias. Repeat the flag for more services. Both run and session open accept it. An assigned port lasts for the session, including when you reopen it from the same worktree. Find it in the forwards field of session list --json.

HTTPS URLs

Instead of a loopback port, run --https NAME:GUEST_PORT serves an app at https://NAME.uncontainer.localhost through a per-account proxy: port 443 on macOS, 8443 by default on Linux. The URL stays the same across restarts of that worktree’s app. See Serve each worktree over HTTPS.