I'm testing on Rails 8, and you just need to update the config/puma.rb file. This file specifies the default port, and you can configure the port address as needed.
port ENV.fetch("PORT", 8080)