How to change the http port for play framework 2.5.9

playframework, typesafe-activator

Solution

In a way, no you can not add HTTP server setting in `application.conf` in reload mode (`activator run`).

In `run` mode by the time the play server starts, your `application.conf` is not resolved yet, but if you use `state` it works fine.

If you want to avoid providing port everytime you run the command, you could add it in `build.sbt` as following.

`PlayKeys.devSettings := Seq("play.server.http.port" -> "9001")`

It is explained here

Problem

How to change the default port from 9000 to 9001 in Play 2.5.9? Tried following steps - Changed http.port = 9001 in application.conf - Tried the steps mentioned in this post [a link] How to change the http port for play framework 2.4.1? But this works activator run -Dhttp.port=9001 -Dhttp.address=127.0.0.1 Can we change it from application.conf instead of specifying port from command line?

Original source