How do I run 20.0.5 listening on port 443 instead of 8443

I am running Keycloak on a Google Cloud Engine instance… I have the appropriate certificates and the server starts in (production) mode when https-port=8443…
I want to run it on port 443… but I get the following errors:

2023-03-24 22:20:32,201 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (production) mode
2023-03-24 22:20:32,202 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Unable to start HTTP server
2023-03-24 22:20:32,202 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: java.net.SocketException: Permission denied
2023-03-24 22:20:32,202 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Permission denied

I do have v18.0.2 running on port 443… But that configuration does NOT work with v20.0.5 (both Quarkus)…
How do I permit the Quarkus/Java framework to work on ports <1024?

Thanks.

How do you make it work on port 443 instead of 8443 on version 18.0.2? I have 18.0.2 and I tried to run on port 443, but get the same error as your :frowning:

As it is a privileged port either run it as root (absolutely not advisable) or follow one of the mentioned options here: systemd - How to allow a Java based application to bind to low port - Unix & Linux Stack Exchange (have systemd open the socket) or Is there a way for non-root processes to bind to "privileged" ports on Linux? - Stack Overflow (use setcap to allow a program to bind to a specific port.

In general it is advisable to use a reverse proxy such as nginx/apache/caddy/traefik to bind to the privileged port and have them pass the requests to the internal port.