Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to save the keycloak data when running inside docker container?

I run keycloak standalone using a command for docker docker run -p 8080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin quay.io/keycloak/keycloak:15.0.2

How to mount a volume to save the data, after container is stopped?

like image 474
Dennis Meissel Avatar asked Nov 26 '25 21:11

Dennis Meissel


1 Answers

working docker-compose.yml

volumes:
  keycloak:

services:

  keycloak:
    image: quay.io/keycloak/keycloak:26.1.4
    ports:
      - 8080:8080
    environment:
      - KEYCLOAK_ADMIN=admin
      - KEYCLOAK_ADMIN_PASSWORD=admin
    volumes:
      - keycloak:/opt/keycloak/data/
    restart: always
    command:
      - "start-dev"
like image 120
Duc Trung Mai Avatar answered Nov 28 '25 15:11

Duc Trung Mai



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!