Manage local ports across projects. Prevent conflicts. Overview all your projects, hosts and ports.
Inspired by DHH's Rails World 2025 keynote part about how 37Signals deals with serving apps in development.


A project can define within it's root, the .localhost
file, that lists local hosts with ports that the project uses.
Format of this file is a simple list of <host>:<port>
separated by newlines. For example:
hello.localhost:3001
another.service.localhost:3002
A single project can have zero, one or multiple domains associated to it.
To add the project to locport, simply locport index [PATH]
. Now you can overview hosts and ports with
locport list
and easily discover conflicts across any number of projects.
Ruby is required.
gem install locport
To create and/or add to .localhost
file, from within your project directory:
locport add <url>[:<port>]
# Example where a unique port is automatically assigned by locport
locport add myapp.localhost
# Example with a user specified port
locport add myapp.localhost:30000
locport
# OR
locport list
If any conflicts are detected, they will be displayed and program exits with error code 1.

-
Check for port and host conflict during
add
- Port generation needs to skip used ports
PRs are welcome. To set up locally from within the checked out repo:
# Install dependencies
bundle
# Run commands with dev code
ruby -Ilib/ bin/locport