Baywatch runs webapps on-demand, and reverse-proxy them so they're available at http://example.localhost/.
No need to run npm run dev, docker-compose up etc. Your apps will spin up when you make an HTTP request, and shut down after your configured inactivity period.
Configure as many apps as you want - they take zero resources unless you use them, and you'll never need to remember a port number again.
Baywatch looks for its config at ~/.config/baywatch/config.yaml, falling back to /etc/baywatch/config.yaml. You can override this with --config <path>.
bind: 0.0.0.0
port: 80
domain: localhost
idle_timeout: 900
services:
myapp:
port: 3000
command: npm start
pwd: ~/projects/myapp
idle_timeout: 300
api:
port: 8000
command: cargo run --release
pwd: ~/projects/api
freetar:
port: 22001
command: uvx freetar
idle_timeout: 60
env:
FREETAR_PORT: "22001"Each service is accessible at <name>.<domain> - with the config above, http://myapp.localhost proxies to port 3000.
| Field | Required | Default | Description |
|---|---|---|---|
port |
yes | Port the service listens on | |
command |
yes | Shell command to start the service | |
pwd |
no | cwd | Working directory (supports ~) |
idle_timeout |
no | 600 | Seconds of inactivity before shutdown (overrides global) |
env |
no | Environment variables for the command |
| Field | Default | Description |
|---|---|---|
bind |
0.0.0.0 | Address to listen on |
port |
80 | Port to listen on |
domain |
localhost | Base domain for routing |
idle_timeout |
600 | Default seconds of inactivity before shutdown |
shutdown_grace |
5 | Seconds between SIGTERM and SIGKILL |
startup_timeout |
30 | Seconds to wait for a service to respond |
Start directly:
baywatch
Or as a systemd user service:
systemctl --user enable --now baywatch
Set RUST_LOG=debug for verbose output.
# Using an AUR helper
yay -S baywatch
Download the .deb from Releases:
sudo dpkg -i baywatch_0.1.1_amd64.deb
Add the flake to your inputs and use the provided NixOS module or package.
Download a static musl binary from Releases and put it in your PATH. Run sudo setcap cap_net_bind_service=+ep /usr/local/bin/baywatch to allow binding port 80 without root.
cargo install baywatch
