Skip to content

Commit cf249fc

Browse files
pedroigorabstractj
authored andcommitted
Updating production guide with information about switching from ipv4 to ipv6
Closes keycloak#11979
1 parent 2392af1 commit cf249fc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/guides/src/main/server/configuration-production.adoc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,19 @@ Keycloak runs on top of JGroups and Infinispan, which provide a reliable, high-a
3636

3737
To find out more about using multiple nodes, the different caches and an appropriate stack for your environment, see the <@links.server id="caching"/> guide.
3838

39+
== Configure Keycloak Server with IPv6 or IPv4
40+
41+
The system properties `java.net.preferIPv4Stack` and `java.net.preferIPv6Addresses` are used to configure the JVM for use with IPv4 or IPv6 addresses.
42+
43+
By default, Keycloak is configured to prefer IPv4 addresses. In order to run with IPv6 addresses,
44+
you need to specify `java.net.preferIPv4Stack=false` (the JVM default) and `java.net.preferIPv6Addresses=true`.
45+
The latter ensures that any hostname to IP address conversions always return IPv6 address variants.
46+
47+
These system properties are conveniently set by the `JAVA_OPTS_APPEND` environment variable. For example, to change the IP stack preference from its default of IPv4 to IPv6, set an environment variable as follows:
48+
49+
[source, bash]
50+
----
51+
export JAVA_OPTS_APPEND="-Djava.net.preferIPv4Stack=false -Djava.net.preferIPv6Addresses=true"
52+
----
53+
3954
</@tmpl.guide>

0 commit comments

Comments
 (0)