I'm trying to setup a keyclock server using 21.1.1 but want to change the HTTP away from 8080. Where do I put the configuration now?
You can also set using using command Line or Environment variable
CLI: --http-port
Env: KC_HTTP_PORT
Ex : sh kc.sh start-dev --http-port=9999
Try with this compose.yml
file. You should change the port number.
version: '3'
volumes:
postgres_data:
driver: local
keycloak:
driver: local
services:
postgres:
image: postgres
container_name: KEYCLOAK-DB
restart: always
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: keycloak
keycloak:
image: quay.io/keycloak/keycloak
container_name: KEYCLOAK
restart: always
volumes:
- ./certs/fullchain.pem:/etc/x509/https/tls.crt"
- ./certs/privkey.pem:/etc/x509/https/tls.key
ports:
- 9445:8080
environment:
KC_DB_URL: jdbc:postgresql://postgres/keycloak
KC_DB_PORT: 5432
KC_DB_DATABASE: keycloak
KC_DB_USER: keycloak
KC_DB_PASSWORD: keycloak
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: keycloak
KC_HTTP_ENABLED: "true"
KC_HTTPS_ENABLED: "false"
KC_PROXY: edge
KC_HTTPS_CERTIFICATE_FILE: /etc/x509/https/tls.crt
KC_HTTPS_CERTIFICATE_KEY_FILE: /etc/x509/https/tls.key
KC_HOSTNAME_STRICT: "false"
entrypoint: ["/bin/sh", "-c", "/opt/keycloak/bin/kc.sh build --db postgres && /opt/keycloak/bin/kc.sh start --optimized"]
depends_on:
- postgres
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With