Back to Blogreact
Struggling to set custom PORT on remix app, you are not alone!
Set custom port number in remix app for production windows and mac users.
react

Its funny that remix.run (>2x) app doesn't have a direct config to set PORT.
In DEV environment its fairly easy.
Steps:
create .env file under Remix.run project
set PORT variable and assign it a value
PORT = 4001
In PROD environment its NOT fairly easy. :D
If you are using Mac, you can pass PORT=XXXX as a flag to remix run start script.
PORT=4001 remix-serve ./build/index.jsBUT if you are using windows, it wont work :(
For windows, you have to install
cross-env
(https://www.npmjs.com/package/cross-env)
and set the script like this
cross-env PORT=4001 remix-serve ./build/index.jsWell, its the only way I have found out in the Internet, and it works :)