How to start keycloak 2.0 on 8080 port?

Pramod S. Nikam picture Pramod S. Nikam · Nov 27, 2017 · Viewed 20.5k times · Source

Default port of Keycloak used to be on 8080. Now when I am starting keycloak using

./bin/standalone.sh

then it is getting start on 9990 port. // So I guess now keycloak default port is 9990 nowadays.

but funny part is whenever I am giving explicit keycloak port like below:

 ./bin/standalone.sh  -Djboss.socket.binding.port-offset=8080

after this keycloak is starting on port 17101 . So weird.

I am struggling to start keycloak on 8080 port. How can I do that?

And one more thing :

surprisingly something called as undertow is running on 8080 port. When I am trying to start keycloak, I can trace that in stacktrace:

YUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080

Answer

stdunbar picture stdunbar · Nov 27, 2017

The default port is still 8080. Check in standalone/configuration/standalone.xml in the Keycloak installation directory and look for jboss.http.port. If you want to force the port, use -Djboss.http.port=8080. You're using the offset configuration. In your case, because standalone.xml appears to have been changed you're adding 8080 to the base port.