Search code examples
jbosswildflykeycloakundertow

How to start keycloak 2.0 on 8080 port?


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

Solution

  • If you run basic bin/standalone.sh without changing any configuration, your keycloak server will be started on port 8080.

    I believe what confuses you is the log you get when your server starts, more specifically this part:

    12:25:25,688 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990

    Port 9990 is not your keycloak server, it is WildFly one.

    You are also using offset wrong. Basically, offset is the number you increment your original port (8080) for.

    If you set offset to 15, your keycloak server will run on port 8095.

    Also, before starting keycloak, check if there is any other process using port 8080

    lsof -i :8080