KeyCloak - First setup in Docker on VPS with subdomain: doesn't save data

Hi community,

I created a subdomain on my VPS and installed the latest docker container from KeyCloak.

Since is working online, I use the following start parameter:

docker run -p 127.0.0.1:8080:8080 -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin docker.io/keycloak/keycloak:latest start-dev --hostname=https://name.domain.cloud/

The service is starting and I can open the subdomain with my browser to setup myrealm. But the entered data are not saved. What’s wrong?

Looks like the start of KeyCloak is not complete? Or does I have to add the database parameter from beginning?

What exactly do you mean with “doesn’t save data”?
Do you remove the container after you stop and restart it again? Then, of course, all the data stored in the container is lost, but this is a Docker thing, not a Keycloak issue.
If you want to persist your data over container deletions, you should configure a dedicated database (see docs about how to do this). If your database is also in Docker, don’t forget to use a volume (either mapped to the local file system or Docker managed) for the data.

Sorry for late answer. As you can see from the screenshot of my message before, I think the start process has not finished. And I must cancel the docker container with “CTRL”+”C”. When I start the container again with the same commando, the create realm is not available. I’m not sure what’s happen in the system.

The screenshot shows a normal Keycloak startup…