Skip to content

About

Local-first Phoenix LiveView dashboard for monitoring localhost web apps

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

LocalWebMonitorex logo

LocalWebMonitorex

Your localhost, at a glance.

LocalWebMonitorex is a small Phoenix LiveView dashboard that finds the web apps running on your computer and gives each one a live card. See the port, page preview, HTTP status, response time, and—when the operating system exposes it—the listening process, CPU usage, and resident memory. Open any app with one click.

CI Linux package License: MIT

LocalWebMonitorex dark dashboard with six local web apps and process stop controls on ports 4004, 4006, 4010, 4013, 4055, and 4056

Dark mode on the default localhost:4100 dashboard, watching ports 4000–4500. Local projects run on 4004, 4006, 4010, and 4013; temporary demo sites run on 4055 and 4056.

Why use it?

  • Find servers as they come and go. Ports 4000–4500 are rescanned automatically. A new scan starts five seconds after the previous one finishes. Only responding web apps appear; the dashboard excludes its own port.
  • Notice what runs elsewhere. A slow background sweep checks the rest of 127.0.0.1 about once an hour and lists other listening ports in a small panel at the bottom left. One switch turns it off.
  • Make it yours. Appearance follows the operating system by default. Choose Light or Dark in Settings to keep that preference across browser and computer restarts.
  • Recognize a page before opening it. WebKit captures previews sequentially while a dashboard tab is connected, with at least 30 seconds between captures of the same port. Click a thumbnail to inspect the full snapshot; use the separate link to open the app.
  • See the process behind a port. The OS adapter adds the listener's name, PID, CPU percentage, and resident memory when available. Missing permissions or tools are shown as unavailable data.
  • Stop a server deliberately. A process card offers a red hover action and a confirmation showing its name, PID, and port. LocalWebMonitorex rechecks the listener before sending a stop request and protects its own process.
  • Keep everything on your machine. The server binds to 127.0.0.1. There is no account, database, or remote monitoring service.
  • Keep it ready after login. Use the macOS LaunchAgent or the Linux package's user service.
Platform Dashboard and previews Process details and stop action Login startup
macOS Supported PID, CPU, memory via lsof and ps; stop with SIGTERM LaunchAgent installer
Linux Supported PID, CPU, memory when lsof and ps are installed; stop with SIGTERM User service in the .deb
Windows Supported through PowerShell PID and memory through Get-NetTCPConnection and Get-Process; CPU shown as unavailable; stop by PID with taskkill Manual setup

On startup, Overview is the focus: no port is selected. The dashboard listens on 4100, scans 4000–4500 by default, and shows a card only when a web server responds. Open a thumbnail to inspect its snapshot, or use its URL to enter the app.

To stop an app, use Stop process on its card and confirm the listener identity. The action appears only when a process can be identified. It sends SIGTERM on macOS/Linux or ends that PID with taskkill /F on Windows. It does not kill child processes as a group. One process may serve several ports, so stopping it may close multiple cards. If the PID changed, the app refuses the request and asks you to refresh. OS permissions can still deny the command.

Install

Ubuntu 24.04, amd64

Download the latest localwebmonitorex_*_amd64.deb from GitHub Releases. It includes the Elixir release, Erlang runtime, web assets, Node.js, Playwright code, a desktop icon, and a user service. You do not need Elixir or npm on the target computer.

sudo apt install ./localwebmonitorex_*_amd64.deb
systemctl --user daemon-reload
systemctl --user enable --now localwebmonitorex
localwebmonitorex open

Open http://localhost:4100. The desktop launcher also starts the user service and opens the dashboard. The service binds only to 127.0.0.1. After changing Settings, apply them with systemctl --user restart localwebmonitorex.

Page previews need a one-time WebKit setup. The dashboard and process list work before this step:

sudo localwebmonitorex install-browser-deps
localwebmonitorex install-browser

The package is built and smoke-tested on Ubuntu 24.04 amd64. Other Linux distributions can use the source setup below.

Run from source

You need Elixir 1.15+ with a compatible Erlang/OTP version, Node.js 20+, npm, and Playwright WebKit. The process tools are optional; service discovery still works without process metrics. See the official Elixir installation guide and Playwright browser guide for platform prerequisites.

On macOS or Linux:

git clone https://github.com/sallaumen/LocalWebMonitorex.git
cd LocalWebMonitorex
mix deps.get
npm ci --prefix assets
./assets/node_modules/.bin/playwright install webkit
mix assets.build
mix phx.server

Open http://localhost:4100. Port 4100 is the dashboard default; ports 4000–4500 are watched. Open the URL using localhost; the Phoenix LiveView connection uses that host.

On Windows, use PowerShell after installing Elixir/Erlang, Node.js, and Git:

git clone https://github.com/sallaumen/LocalWebMonitorex.git
Set-Location LocalWebMonitorex
mix deps.get
npm ci --prefix assets
.\assets\node_modules\.bin\playwright.cmd install webkit
mix assets.build
mix phx.server

The dashboard opens at the same http://localhost:4100 address. If a screenshot tool is unavailable, the card remains usable and shows a preview placeholder. Automatic login startup is available through the macOS installer or Linux .deb.

Start automatically on macOS

./bin/install-launch-agent

The installer builds the current commit into ~/Library/Application Support/LocalWebMonitorex-versions/<commit>, points ~/Library/Application Support/LocalWebMonitorex at it, installs a user LaunchAgent, and starts it. Running outside the project folder lets the background process work even when the checkout is in a protected folder such as Documents. It starts again at login. To restart it after saving a new port or watched range in Settings:

launchctl kickstart -k gui/$(id -u)/com.localwebmonitorex

The log is at ~/Library/Logs/LocalWebMonitorex.log. To stop and remove automatic startup:

./bin/uninstall-launch-agent

Removing the LaunchAgents keeps the installed copies and your saved preferences.

Automatic updates

The installer also adds com.localwebmonitorex.updater, which runs at login and then about once an hour. It never changes your source checkout. Each run:

  1. Fetches main from the checkout's origin (read over HTTPS) into a private repository in ~/Library/Application Support/LocalWebMonitorex-updater.
  2. Compares it with the installed commit. If they match, it records that the copy is up to date.
  3. Exports the new commit into its own version directory and runs bin/build-installation there.
  4. Starts that build on a spare loopback port with throwaway settings and an empty watched range, and waits for it to serve its own commit.
  5. Points the installation at the new version and restarts com.localwebmonitorex. If the dashboard does not serve the new commit on your saved port within three minutes, it switches back and restarts the previous version.

A failed fetch, build, smoke test, or restart keeps the current version running and is retried on the next run. The running version and the one before it are kept; older version directories are removed. If the installed commit is not on main, for example after installing from an unmerged branch, updates pause until you install from main again. A change to the LaunchAgent files themselves applies when you re-run the installer.

Settings → Updates shows the installed commit, the last check, and whether the copy is up to date, behind main by some commits, or why the last update failed. Details are in ~/Library/Logs/LocalWebMonitorex-updater.log. To check now:

launchctl kickstart gui/$(id -u)/com.localwebmonitorex.updater

Installations made before the updater existed keep their files in place: re-run ./bin/install-launch-agent from an up-to-date main checkout once. The installer keeps the old copy as the previous version and turns on the hourly updater.

Configuration

Open Settings to change the appearance, dashboard port, or watched range. The wide sweep switch is in the Other ports panel. Appearance changes immediately and follows your operating system when System is selected. A manual Light or Dark choice is saved in this browser's local storage, so it survives restarts; browser profiles keep independent choices. The port and range changes take effect on the next process start. The dashboard port accepts 1024–65535 and defaults to 4100. The watched range is inclusive, defaults to 4000–4500, and can be any span of ports 1–65535, including the whole port space. The fields accept grouped thousands such as 4.000 or 4,000. A large range takes longer to scan: the scanner probes at most 16 ports at a time and gives each one 3.5 seconds, and the next scan starts 5 seconds after the previous one finishes, so scans never overlap. The top of the dashboard shows how many ports the current scan has checked. The dashboard always excludes its own port even when it falls inside the watched range.

Preferences are three plain text files: port contains one port number, range contains START-END, and sweep contains on or off. They live in ~/.config/localwebmonitorex/ on macOS/Linux or %APPDATA%\LocalWebMonitorex\ on Windows. Unix users can set XDG_CONFIG_HOME. Set LOCALWEBMONITOREX_CONFIG to choose a different port file; the range file defaults to its sibling range. Set LOCALWEBMONITOREX_RANGE_CONFIG to override that path, and LOCALWEBMONITOREX_SWEEP_CONFIG to override the sibling sweep file. A missing or invalid sweep file means on. The PORT environment variable takes priority over the saved dashboard port.

To choose a port before the first start:

mkdir -p ~/.config/localwebmonitorex
printf '4321\n' > ~/.config/localwebmonitorex/port
printf '4000-4500\n' > ~/.config/localwebmonitorex/range

The dashboard shows the active range. Invalid preference contents fall back to the built-in defaults.

Wide sweep

Services often listen outside the watched range, on ports such as 8080 or 64120. The wide sweep finds them without making the main scan slower:

  • It walks 127.0.0.1 ports 1–65535 in its own process, separate from the main scan. It skips the watched range and the dashboard port, so it never checks the same ports twice.
  • It checks 32 ports per batch, at most 4 at a time, and pauses one second between batches. A full pass takes about 45 minutes. The next pass starts one hour after the previous one ends. The first pass starts one minute after LocalWebMonitorex starts.
  • Each port gets the same short TCP check as the main scan. Ports that accept a connection are asked for an HTTP or HTTPS page and recorded as HTTP with their status, or as TCP when they answer neither. The listener's process name is added when the OS adapter can read it. The sweep takes no screenshots.

The Other ports panel at the bottom left shows the sweep's progress or the time of the next pass, and the ports it found. Open an HTTP port in a new tab, or use + to fill the watched-range form so that it covers that port; nothing is saved until you choose Save range. The Wide sweep switch stops a running pass immediately and starts a new one when you turn it back on, without a restart.

The sweep is on by default. It stays on loopback and its rate is fixed and low. Turning it off is saved for the next start.

How it works

flowchart LR
  Probe[PortProbe behavior] --> Scanner[Bounded Scanner]
  Scanner --> Monitor[Monitor GenServer]
  OS[macOS / Linux / Windows adapter] --> Inspector[ProcessInspector behavior]
  Inspector --> Monitor
  Monitor --> PubSub[Phoenix PubSub]
  Probe --> Sweeper[Wide Sweeper]
  Inspector --> Sweeper
  Sweeper --> PubSub
  PubSub --> LiveView[LiveView dashboard]
  LiveView --> Previews[Sequential preview worker]
  Previews --> WebKit[Playwright WebKit]
Loading

The scanner first makes a short TCP availability check, then requests a page only from ports that accept connections. It checks loopback only, allows up to 1.5 seconds for a local HTTP response, and does not follow a discovered service's redirect to another host. At most 16 ports are checked concurrently; closed ports never launch HTTP or HTTPS requests. The macOS/Linux adapter runs one lsof and one ps command per scan when web services were found; the Windows adapter makes one PowerShell query. The metrics describe the listener process, not a port's isolated resource use; a process listening on multiple ports may appear on multiple cards. PowerShell's process CPU property is cumulative time, so the Windows adapter deliberately leaves live CPU percentage unavailable.

Previews are requested only by connected dashboard sessions. Browser navigation and assets are limited to local HTTP(S) addresses. Captures are stored in an OS temporary directory and never committed or uploaded by the app. Login-protected pages and apps that depend on remote assets may show an incomplete initial view.

Development

mix test
node --test assets/js/theme.test.mjs
mix format --check-formatted
mix compile --warnings-as-errors
MIX_ENV=prod mix assets.deploy
./bin/build-deb # Ubuntu 24.04 amd64 only

The package is assembled with mix release, then wrapped as a Debian archive. Tags matching v* trigger the release workflow, which smoke-tests the installed app and bundled preview tools before uploading the .deb and SHA-256 checksum to GitHub Releases.

The project conventions in AGENTS.md and CLAUDE.md adapt quality guidance from Forrozin to this local utility. The source is licensed under MIT.

About

Local-first Phoenix LiveView dashboard for monitoring localhost web apps

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages