localhost:

Services and states

What a Service is, its six states, Dependencies and stopping.

A Service has:

  • a command: one command line, run in your login shell ($SHELL -l -c "…"), so your PATH, version managers and profile apply. Pipes, && and $VARIABLES work as in a terminal. On Windows itself it runs in cmd.exe;
  • a working directory inside the Project (the Project folder by default);
  • an optional Port. The command gets the actual port as $PORT (%PORT% in cmd), e.g. next dev -p $PORT, and the Service counts as Running once that port accepts connections. Without a Port it counts as Running after about 1.5 seconds;
  • an optional URL for Open in Browser (⇧⌘O). Its port follows the actual port;
  • Starts after: its Dependencies. Starting the Service starts them first and waits until they are Running, or have Exited for one-off steps such as migrations;
  • Manual: Start All skips it, unless something being started depends on it.

Changes apply the next time a Service starts. A running Service whose configuration changed shows “Restart to apply”; nothing restarts on its own.

States

A Service is always in one of six states:

State Meaning
Stopped Not running: never started, or you stopped it.
Starting Waiting for its Dependencies, or launched and not up yet.
Running Up: its Port accepts connections (or it has been alive ~1.5 s).
Stopping Asked to stop; waiting for every process it started to end.
Exited Ended on its own with exit code 0.
Failed Ended on its own with an error, or couldn’t start. The reason and the last lines of output are shown.

Dependencies

Starting a Service starts its Dependencies first. Start All goes in dependency order, Stop All in reverse. Stopping or restarting one Service leaves the Services that depend on it alone. If a Dependency fails, the Services waiting for it don’t start, and say why.

Stopping

Stopping sends Ctrl-C (SIGINT) to the Service’s whole process group, then SIGTERM after 5 seconds, then SIGKILL, so nothing is left running in the background. On Windows itself it sends Ctrl-Break, then ends every process the Service started. The log says when a stop had to be forced.

If localhost itself crashes, the next launch finds the Services still running from that session and asks whether to stop them.

Edit this page on GitHub

Install localhost for macOS

Two quick steps, usually under a minute.

  1. Drag it to Applications

    Open localhost-0.1.0.dmg and drag localhost to Applications.

    Download localhost-0.1.0.dmg
  2. Open it the first time

    localhost isn’t notarized by Apple yet, so macOS blocks the first launch once:

    1. Click Done in the warning.
    2. Open System Settings › Privacy & Security and scroll to Security.
    3. Click Open Anyway, and confirm with your password or Touch ID.

    Or run this in Terminal, then open localhost:

    xattr -dr com.apple.quarantine /Applications/localhost.app

macOS 15 or later · Apple silicon or Intel

  1. Run the installer

    Open localhost_0.1.0_x64-setup.exe. It installs for your user only, no administrator rights needed.

    Download localhost_0.1.0_x64-setup.exe
  2. Get past SmartScreen

    The installer isn’t signed by a known publisher yet, so Windows says “Windows protected your PC”:

    1. Click More info.
    2. Check that the file is localhost_0.1.0_x64-setup.exe.
    3. Click Run anyway.

Windows 10 or 11 · x64 · WSL 2 for Projects in WSL

  1. Download your package

  2. Install it

    From the folder you downloaded it to:

    sudo apt install ./localhost-app_0.1.0_amd64.deb
    sudo dnf install ./localhost-app-0.1.0-1.x86_64.rpm
    chmod +x localhost-app_0.1.0_amd64.AppImage && ./localhost-app_0.1.0_amd64.AppImage

    Secrets need a Secret Service (GNOME Keyring, KWallet). On stock GNOME the tray icon needs the AppIndicator extension.

x86_64 · Ubuntu 22.04+ · Debian 12+ · Fedora

On another system?Install guide →