How to run several dev servers at once on a Mac

Updated · 2 min read

A frontend and an API, three client sites, a docs site next to the app: sooner or later there are more servers than terminal tabs you want to watch. These are the usual ways, simplest first.

Terminal tabs

One tab per server. Free and obvious. It gets hard when you close a tab without stopping its server, lose track of which tab runs what, or two projects both want port 3000.

concurrently: one project with several parts

bash
npx concurrently -n web,api "npm run dev --prefix web" "npm run dev --prefix api"

One command, one terminal, each line of output prefixed with its name. Good for a frontend and a backend that always run together. It works per project, so it doesn't help with several unrelated ones.

tmux

Panes and sessions that outlive the terminal window. Powerful, but you still start each server, choose its port and watch each log yourself.

pm2

bash
pm2 start npm --name shop -- run dev
pm2 ls
pm2 logs shop

Made for running Node.js in production, and it works in development too: it keeps servers running, restarts them after a crash and keeps their logs. It lives in the command line, and the ports are still yours to sort out.

What to look for

Whatever you choose, these are the things that get in the way with more than two servers:

How Portroom handles it

A window and a menu bar for all of them

Each project gets its own port, a name.localhost address and its own log, with errors picked out. Start and stop servers from the menu bar, and see in one place what crashed, which port is taken and which server was left running.

Your servers keep running when you quit Portroom. Free for three servers at once; Pro ($49 once) runs any number and adds HTTPS, restart after a crash and the AI agent tools.

Overview in Portroom: running servers, memory, CPU and what needs attentionOverview in Portroom: running servers, memory, CPU and what needs attention

Something wrong or out of date on this page? Write to support@portroom.dev.

More guides

Every dev server on your Mac, in one window.

Free for three servers at once, with 14 days of Pro first. No account.