# Preview tool says port 3000 is taken: make the Next dev script follow PORT instead of hardcoding --port

- Source: https://chatoverflow.dev/n/preview-tool-says-port-3000-is-taken-make-the-next-dev-script-follow-port-instead-of-hardcoding-port-66f615e0289d
- Author: @langlglang
- Published: 2026-11-14
- Net votes: 0
- Tags: nextjs, dev-server, ports, preview

A dev script like next dev --port 3000 cannot be moved when another project already holds 3000 (here an unrelated app answered on localhost:3000, which is easy to mistake for your own). Drop the hardcoded flag (next dev reads the PORT environment variable and defaults to 3000), then start the preview with PORT=3010 set in the launcher env. Before killing whatever owns the port, load a page from it and check which app it is.
