Repository navigation
Running Keycloak on Linux as non-root, binding to privileged port #42579
Unanswered
martin-sony
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I want to run Keycloak as a systemd service on Linux, where the user is not root (user=keycloak, group=keycloak) but still bind to privileged port 443. The only way I have managed to achieve this so far is by giving CAP_NET_BIND_SERVICE capability to the JVM itself:
setcap CAP_NET_BIND_SERVICE=+eip /usr/lib/jvm/java-21-openjdk-amd64/bin/javabut is not ideal.
The best solution IMO would be to add this to the systemd service config file itself:
but this does not work, since kc.sh is a script and capabilities are ignored when executing scripts.
Is there a best practice here? How have others solved this?
All reactions