How to make `hs project dev` use a different port aside from 8080

Good day,

I am following the quickstart guide for setting up and running a project locally: Quickstart - HubSpot docs

When running `hs project dev`, I noticed that it uses port 8080, which would make the command fail if I have other apps (ie: other apps being locally developed) already using port 8080.

Is it possible to specify which port `hs project dev` uses like a --port flag (tried that locally, but the command does not seem to have such a flag)? The hs project dev docs page does not appear to have documented flags either.

tldr: can `hs project dev` use another port aside from 8080?

Cheers

Hi @al11,
Thank you for posting to the Community!
I’d like to tag in some of our Top Contributors to see if they are able to reproduce this. Hi @mangelet @HubSpot_Corey, and @ChristinaKay, have you see before? If so, do you have any suggestions for @al11?
Thank you!
Cassie, Community Manager

I have this same issue. Hogging 5174 is not nice. I have other local apps/servers running on that port. Please let me specify a different one.

Hey @Sasha-A8,

Thanks for adding to the thread!

I can’t seem to confirm that a custom port is supported for hs project dev via our documentation. That said, tagging in a few more folks from the community to see if they have any insight on this.

Hey @Josh, @anton, @grajput – do you have any insight into using custom ports?

Thanks in advance!

Sam, Community Manager

Hey folks,

talked to a good friend of mine, who chatted with the HS developers about this earlier this year.

hs project dev --port=1234 should work on a CLI version above 8.9.x

Tested it with the current one (8.10.0) and it seems to be working.

Therefore - try it out by updating the CLI:

latest version

hs upgrade or npm install -g @hubspot/cli@latest

specific version

npm install -g @hubspot/cli@<version-number> - example: npm install -g @hubspot/cli@8.10.0

If something else should go south after the upgrade, you can revert it to the previous version by installing the specific version with your current version number again.

If you don’t know what version you’re on, run hs --version

best,
Anton