A local development router that eliminates port conflicts without modifying your applications. Run multiple monorepo services (web/admin/api) simultaneously across multiple projects with stable, consistent URLs.
- Zero App Changes - Run services in parallel without modifying port configurations
- Host-based URLs - Access services via fixed URLs like
https://<stack>-web.localtest.me - Automatic Routing - Traefik-powered routing using Docker labels
- HTTPS Support - Secure local development with mkcert
- Minimal Config - Simple
devrouter.yamlfor overrides when needed - Web UI - Real-time stack management, logs, and resource monitoring
# Install (download binary from GitHub Releases or build from source)
# See Installation section below
# Start the global Traefik proxy
devrouter daemon up
# Start your monorepo stack
devrouter up /path/to/your/monorepo
# List running services
devrouter ls
# Example output: https://myrepo-web.localtest.me
# Stop the stack
devrouter down /path/to/your/monorepo- macOS / Linux
- Docker (Docker Desktop or Colima)
dockerCLI withdocker compose
- Go 1.20+
- Node.js 18+
- pnpm (
npm install -g pnpm)
Download the latest binary from GitHub Releases:
# macOS (Apple Silicon)
curl -L https://github.com/simota/devrouter/releases/latest/download/devrouter_darwin_arm64.tar.gz | tar xz
sudo mv devrouter /usr/local/bin/
# macOS (Intel)
curl -L https://github.com/simota/devrouter/releases/latest/download/devrouter_darwin_amd64.tar.gz | tar xz
sudo mv devrouter /usr/local/bin/
# Linux (amd64)
curl -L https://github.com/simota/devrouter/releases/latest/download/devrouter_linux_amd64.tar.gz | tar xz
sudo mv devrouter /usr/local/bin/Note:
go install github.com/simota/devrouter/cmd/devrouter@latestdoes not work because the Web UI frontend assets need to be built first and embedded into the binary.
git clone https://github.com/simota/devrouter.git
cd devrouter
make build
sudo mv devrouter /usr/local/bin/Or install directly to $GOPATH/bin:
make installEnsure /usr/local/bin or $GOPATH/bin is in your PATH.
| Command | Description |
|---|---|
devrouter up [path] |
Start a stack from the specified path |
devrouter down [path|stack] |
Stop a running stack |
devrouter ls |
List all running stacks and services |
devrouter logs <stack>[/<service>] [-f] |
View logs (with optional follow mode) |
devrouter open <stack>/<service> |
Open service URL in browser |
devrouter init [path] |
Generate devrouter.yaml from existing config |
devrouter exec <stack>/<service> [--] <cmd> |
Execute command in a service container |
devrouter doctor [path] |
Diagnose configuration issues |
devrouter daemon up |
Start the global Traefik proxy |
devrouter daemon down |
Stop the global Traefik proxy |
devrouter ui [--addr :19847] |
Launch the Web UI |
Launch with devrouter ui to access a browser-based management interface:
- Stack Management - View, restart, and stop running stacks
- Real-time Logs - WebSocket-powered log streaming with level filtering (ERROR/WARN/INFO/DEBUG)
- Resource Monitoring - CPU/memory usage with sparkline graphs
- Dependency Graph - SVG visualization of service dependencies
- File Watcher - Auto-restart on file changes with pattern matching
- Service Templates - Quick-add PostgreSQL, Redis, MongoDB, and more
- Desktop Notifications - Browser notifications for service status changes
Create devrouter.yaml in your repository root to customize behavior. Use devrouter init to auto-generate from existing docker-compose.yaml and package.json.
stack: myrepo
domain: localtest.mestack: myrepo
domain: localtest.me
defaults:
env:
HOST: "0.0.0.0"
overrides:
apps/admin:
port: 3001
services/api:
port: 4000
env:
PORT: "4000"Use your own docker-compose.yaml with DevRouter labels:
stack: myrepo
compose: docker-compose.devrouter.yml
domain: localtest.meServices must include DevRouter and Traefik labels:
services:
web:
labels:
- devrouter.enabled=true
- traefik.enable=true
- traefik.http.routers.myrepo-web.rule=Host(`myrepo-web.localtest.me`)
- traefik.http.routers.myrepo-web.entrypoints=websecure
- traefik.http.routers.myrepo-web.tls=true
- traefik.http.services.myrepo-web.loadbalancer.server.port=3000
- traefik.docker.network=devrouter_net
networks:
- devrouter_netAuto-restart services on file changes:
watch:
enabled: true
debounce: 500ms
rules:
- pattern: "*.ts"
action: restart
- pattern: "*.go"
action: restartUse an AI assistant (Claude, ChatGPT, etc.) to automatically generate configuration files for your project. See prompts/generate-config.md for the full prompt.
Simply provide the prompt along with your project directory path, and the AI will analyze your codebase to generate:
devrouter.yaml- DevRouter configurationdocker-compose.devrouter.yml- Docker Compose with Traefik labels
Enable HTTPS for local development using mkcert:
# Install mkcert and create local CA
mkcert -install
# Generate certificates
mkdir -p ~/.devrouter/certs
mkcert -cert-file ~/.devrouter/certs/localtest.me.pem \
-key-file ~/.devrouter/certs/localtest.me-key.pem \
"*.localtest.me"Add TLS configuration to devrouter.yaml:
stack: myrepo
domain: localtest.me
tls:
enabled: true
certFile: ~/.devrouter/certs/localtest.me.pem
keyFile: ~/.devrouter/certs/localtest.me-key.pemBrowser
| Host: myrepo-web.localtest.me
v
Host (80/443) --> Traefik (global) --> devrouter_net --> [myrepo-web:3000]
|-------> [myrepo-admin:3001]
|-------> [myrepo-api:4000]
- Global Traefik listens on host ports 80/443
- Stack containers join the shared
devrouter_netnetwork - Host-based routing directs requests to the correct
stack-servicecontainer
| Issue | Solution |
|---|---|
docker info fails |
Start Docker/Colima, check docker context |
| Host not reachable | Ensure HOST=0.0.0.0 in your app config |
| Wrong port detected | Explicitly set ports in devrouter.yaml |
| External compose not working | Add devrouter.enabled=true, Traefik labels, and devrouter_net |
| HMR not working | Check WebSocket proxy and host restrictions |
Use devrouter doctor to diagnose common configuration issues.
- Network Exposure - Setting
HOST=0.0.0.0makes services accessible from your LAN - Docker Socket - Mount Docker socket as read-only when possible
+----------------------------------------------------------+
| devrouter CLI (cmd/devrouter) |
| up | down | ls | logs | open | init | exec | doctor |
+----+-----------------------------------------------------+
|
v (starts daemon if needed)
+------------------------+
| Global Traefik | <-- Listens on 80/443
| (daemon.go) | <-- Network: devrouter_net
+------------------------+
^
|
+----+-------------------------------------------------+
| Per-Stack Docker Compose (compose.go) |
| Services connected via devrouter_net with Traefik |
| labels for Host-based routing |
+------------------------------------------------------+
+------------------------------------------------------+
| Web UI (server.go) |
| - Svelte frontend embedded via go:embed |
| - REST API (api_handlers.go) |
| - WebSocket streams for logs/stats/watch |
+------------------------------------------------------+
Contributions are welcome! Please feel free to submit issues and pull requests.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
日本語 (Japanese)
DevRouterは、アプリケーションを変更せずにポート衝突を解消するローカル開発用ルーターです。モノレポ内の複数HTTPサービス(web/admin/apiなど)を、複数プロジェクト同時に起動しても安定したURLでアクセスできます。
- アプリ無改造 - ポート設定を変更せずに並列起動
- Hostベース固定URL -
https://<stack>-web.localtest.me形式 - Traefik自動ルーティング - Dockerラベルで設定
- HTTPS対応 - mkcertによるローカル証明書
- Web UI - リアルタイムのスタック管理・ログ・監視
詳細は上記の英語ドキュメントをご参照ください。