Default ports for website projects
Each of our website projects is configured to run on a different port by default.
This port should be defined in a
.env file within the project codebase, and
should be between 8001 and 8999, excluding more commonly used ports like
This is so that team members can easily run multiple projects at the same time without getting port conflicts.
Why use a fixed port
We could have chosen to solve the problem of port clashes by having the local development
tooling choose a random open port, instead of defining a specific one.
There are a few benefits to the local development application having a predictable port:
- Port clashes will remind developers that a specific project is already running locally
- Developers can reliably bookmark their locally running version of specific projects, and so quickly check if a project is currently running
- The port can reliably be mentioned in READMEs and pull request instructions
- Any inter-linking dependent services can work together more easily if they know which local ports to connect to
However, it should be possible to choose to run any project on a different port through the standard
dotrun serve --port 8999
Last updated 15 days ago.