-
Modify the run.sh, update below fields
# replace below field to generate certificate for you domain(e.g. kc.example.com) CA_BASE_DOMAIN="example.com" # replace with your base domain . . . SERVER_KC=kc #replace with you domain
-
Go to the ssl folder and run
docker compose up --build
, the ssl certificate will be shown at certs folder. -
Copy the
./ssl/certs/{server_KC}/bundle.pem
(./ssl/certs/kc/bundle.pem
in the example) and./ssl/certs/{SErVER_KC}/server-{SERVER-KC-key.pem}
(./ssl/certs/kc/server-kc-key.pem
in the example) to./nginx/ssl/
-
In case you need to modify the mysql and keycloak password, please modify the file
./.env
. -
update the nginx route config
SUB_DOMAIN="kk" # replace wiht your sub domain BASE_DOMAIN="example.com" # replace with your base domain cat keycloak.conf_tpl | \ sed "s|{sub_domain}|${SUB_DOMAIN}|" | \ sed "s|{base_domain}|${BASE_DOMAIN}|" > keycloak.conf
-
modify
.env
file for the docker composeROOT_PASSWORD={root password of mysql} DATABASE={database of keycloak} MYSQL_USER={database username} MYSQL_PASSWORD={database password} MYSQL_EXPOSING_DATABASE=3306 KEYCLOAK_USER={keycloak admin user} KEYCLOAK_PASSWORD={keycloak admin password} EXPOSING_KEYCLOAK=8080
-
Run command:
docker compose up # start the services