In package.json, make sure you add -p $PORT at the start script. "scripts": { "start": "next start -p $PORT" }