Setting the port for node.js server on Heroku July 17, 2022 by Tarik You can’t. Heroku sets the PORT variable that you are supposed to bind, and listens on tcp/80.