I tried to follow the tutorial on this page https://docs.digitalocean.com/products/marketplace/catalog/keycloak/ but i don’t manage that the keycloak admin url is running with a valid SSL certificate + it always redirects the domain to the IP address. How to solve that? And sorry, it’s my first experience with DigitalOcean + Keycloak.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
I got it running by creating a new docker container with this command
Also the nginx setup was wrong. This guide was actually the solution.
https://du.nkel.dev/blog/2024-02-10_keycloak-docker-compose-nginx/
Hey there! 👋
The DigitalOcean KeyCloak Droplet uses the official Docker image, you can check out the documentation here:
The overall process, should look as follows: Before you run the
certbot
command you need to make sure your domain points to your Droplet’s IP address:example.com
) to your Droplet’s public IP.👉 Guide: How to Manage Domains in DigitalOcean
Now if you have already done that, you need to configure Nginx to properly handle your domain:
SSH into your Droplet:
Create a new server block configuration file for your domain:
Add the following configuration to the file:
Enable the server block by creating a symbolic link:
Test Nginx and reload:
After that, the Keycloak Droplet comes with Certbot pre-installed, making it super easy to set up HTTPS:
Run the Certbot command:
Follow the prompts to complete the certificate setup. Certbot will automatically update your Nginx configuration to redirect HTTP traffic to HTTPS.
Test the setup by visiting
https://example.com
in your browser.Then on the Keycloak side, you need to inspect the Keycloak container to find the exact environment variables that need to be set to match your domain:
Note down the environment variables starting with
KC_
andKEYCLOAK_
and mainly theKEYCLOAK_ADMIN_PASSWORD
,KC_DB_PASSWORD
and theYOUR_KEYSTORE_PASSWORD
.Then stop the container:
Then you can create a new Keycloak container and pass the domain as an environment variable:
Here is an example of this running on my Droplet:
Let me know how it goes.
- Bobby