Hello, I am trying to deploy keycloak standalone for the last week without success.
I get it running up to point where intro screen is shown and after that not much works, practically nothing. Here is the process I am doing to set it up(all done as root user):
- Install fresh Ubuntu 20 image on a VPS
- Install: nginx, certbot(via snap as per instructions) and download latest keycloak version with wget from keycloak.org “Downloads” section
- Unzip keycloak-12.0.2.zip and rename folder to “keycloak”
- Setup a systemd service, here is service file:
[Unit]
Description=Keycloak Standalone
After=network.target
[Service]
Type=idle
User=root
Group=root
ExecStart=/root/keycloak/bin/standalone.sh -Dkeycloak.frontendUrl=https://sso3.cyberdeck.xyz
WorkingDirectory=/root/keycloak
TimeoutStartSec=600
TimeoutStopSec=600
[Install]
WantedBy=multi-user.target
- Change config in `/keycloak/standalone/config/standalone.xml’ as per this
- Setup nginx config (i remove default one) like this:
server {
listen 443 ssl;
server_name sso3.cyberdeck.xyz;
ssl_certificate /etc/letsencrypt/live/sso3.cyberdeck.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/sso3.cyberdeck.xyz/privkey.pem;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:8080;
}
}
server {
if ($host = sso3.cyberdeck.xyz) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name sso3.cyberdeck.xyz;
listen 80;
listen [::]:80;
return 404; # managed by Certbot
}
- Setup ssl with certbot with
certbot certonly -d sso3.cyberdeck.xyz
After that I can see the first window of keycloak app but cannot acces the admin panel, it looks like nginx cannot find(properly proxy) static files. I am strugling with this for days can anyone help out ?