9router Space

Docker guide

Run 9router in Docker with a persistent routing state

Docker is the cleanest first production-like shape for 9router: the dashboard listens on port 20128, provider settings persist in a mounted data directory, and restarts are easier to reason about.

For operators who want repeatable 9router installs without losing provider settings after a restart.

Baseline container command

A useful Docker run mounts the 9router data directory and sets DATA_DIR inside the container. That keeps db.json and routing configuration outside the image.

Expose only the port you need, and treat the dashboard as private unless you have authentication, TLS, API keys, and network boundaries in place.

  • Build from source with docker build -t 9router .
  • Run with -p 20128:20128 so CLI tools can use the /v1 endpoint.
  • Mount $HOME/.9router to /app/data and set DATA_DIR=/app/data.
  • Use docker logs and restart checks after provider changes.

What to persist

The important state is not the image. It is provider connections, combos, model aliases, API keys, dashboard settings, usage history, and request logs.

Back up the data directory before upgrades. Avoid storing the directory in a public repo, issue, screenshot, or shared support thread because it can contain sensitive provider metadata.

When Docker is not enough

Docker is a strong one-machine deployment. Teams with multiple operators may also need a documented provider policy, secured network entry, and a reliable checkout/onboarding process.

That is why the managed Pro path focuses on rollout readiness rather than pretending installation alone solves adoption.

Common questions

What port does 9router use?

The common examples use port 20128, with clients pointing to http://localhost:20128/v1 for OpenAI-compatible requests.

Can I expose 9router directly to the internet?

Only with proper authentication, TLS, API key enforcement, network restrictions, and secret handling. A local or private network route is safer for most teams.

Why is Pro selected for Docker users?

Docker users are usually past curiosity and closer to team evaluation, where rollout help and policy review matter.

Choose Pro annual