Skip to content

TIP: How to Persist OpenAM Docker Container Data Between Restarts

Maxim Thomas edited this page Dec 13, 2024 · 2 revisions

Docker containers are stateless. So, if you want persist the OpenAM's configuration data, you need to specify a volume that maps /usr/openam/config container directory to a local directory. Example with docker-compose.yaml

services:
  openam:
    image: openidentityplatform/openam:latest
    ports:
      - 8080:8080
      - 8085:8085
    volumes:
      - ./openam-data:/usr/openam/config

With docker run command:

docker run -v ./openam-data:/usr/openam/config \
    -h openam.example.org \
    -p 8080:8080 \
    --name openam \
    openidentityplatform/openam

If you are facing permisson issues in Lunux, use a named volume

docker volume create openam-data
docker run -v openam-data:/usr/openam/config \
    -h openam.example.org \
    -p 8080:8080 \
    --name openam \
    openidentityplatform/openam
Clone this wiki locally