Deploy Keycloak behind reverse proxy
Keycloak will be deployed using docker compose, so If you didn’t install docker, please do and read further. Please follow the official documentation.
- Copy the docker compose file from this link,
2. Create a file called envs, Copy the content from here.
3. Generate a self signed certificate,
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \ -keyout certs/key.pem -out certs/cert.pem -subj “/CN=yourdomain.name” \ -addext “subjectAltName=DNS:*.yourdomain.name”
4. Create a script named start.sh,
docker compose up
Your keycloak will be up and running
Don’t forget add the configuration in reverse-proxy
Assuming it’s nginx,
proxy_pass https://keycloak:8443;