Skip to main content

Reinstall OpenRAG

You can reset your OpenRAG deployment to its initial state by recreating the containers and deleting accessory data, such as the .env file and ingested documents.

warning

These are destructive operations that reset your OpenRAG deployment to an initial state. Destroyed containers and deleted data are lost and cannot be recovered after running these operations.

Reinstall TUI-managed containers

  1. If you modified the built-in flows or created custom flows in your OpenRAG Langflow instance, export your flows before starting this process. Although OpenRAG can preserve changes to the built-in flows, it doesn't preserve user-created flows. As a general best practice, exporting your flows is recommended to create backups of your customizations. Afterwards, you can reimport your flows or reference the exported flow JSON as needed.
  1. In the TUI, click Status, and then click Factory Reset to reset your OpenRAG containers.

    warning

    This is a destructive operation that does the following:

    • Destroys all OpenRAG containers, volumes, and local images.
    • Prunes any additional container objects.
    • Deletes the contents of the ~/.openrag directory except for OpenRAG's .env file and the /documents subdirectory.

    Destroyed containers and deleted data are lost and cannot be recovered after running this operation.

  2. Press Esc to close the Status page, and then press q to exit the TUI.

  3. Optional: Delete or edit OpenRAG's .env file, which is stored at ~/.openrag/tui.

    This file contains your OpenRAG configuration, including OpenRAG passwords, API keys, OAuth settings, and other environment variables. If you delete this file, the TUI automatically generates a new one after you repeat the setup and onboarding process. If you preserve this file, the TUI can read values from the existing .env file during setup and onboarding.

  4. Optional: Remove any files from the ~/.openrag/documents subdirectory that you don't want to reingest after redeploying the containers. It is recommended that you preserve OpenRAG's default documents.

  5. Restart the TUI with uv run openrag or uvx openrag.

  6. Repeat the setup process to configure OpenRAG and restart all services. Then, launch the OpenRAG app and repeat the application onboarding process.

Reinstall self-managed containers with docker compose or podman compose

Use these steps to reinstall OpenRAG containers with streamlined docker compose or podman compose commands:

  1. If you modified the built-in flows or created custom flows in your OpenRAG Langflow instance, export your flows before starting this process. Although OpenRAG can preserve changes to the built-in flows, it doesn't preserve user-created flows. As a general best practice, exporting your flows is recommended to create backups of your customizations. Afterwards, you can reimport your flows or reference the exported flow JSON as needed.
  1. Destroy the containers, volumes, and local images, and then remove (prune) any additional container objects.

    warning

    This is a destructive operation that does the following:

    • Destroys all OpenRAG containers, volumes, and local images.
    • Prunes any additional container objects.
    • Deletes the contents of the ~/.openrag directory except for OpenRAG's .env file and the /documents subdirectory.

    Destroyed containers and deleted data are lost and cannot be recovered after running this operation.

    Docker
    docker compose down --volumes --remove-orphans --rmi local
    docker system prune -f
    Podman
    podman compose down --volumes --remove-orphans --rmi local
    podman system prune -f
  2. Optional: Edit OpenRAG's .env file if needed.

  3. Optional: Remove any files from the ~/.openrag/documents subdirectory that you don't want to reingest after redeploying the containers. It is recommended that you preserve OpenRAG's default documents.

  4. Redeploy OpenRAG:

    Docker
    docker compose up -d
    Podman
    podman compose up -d
  5. Launch the OpenRAG app, and then repeat the application onboarding process.

Reinstall self-managed containers with discrete docker or podman commands

Use these commands to remove and clean up OpenRAG containers with discrete docker or podman commands.

If you want to reinstall one container, specify the container name in the commands instead of running the commands on all containers.

  1. If you modified the built-in flows or created custom flows in your OpenRAG Langflow instance, export your flows before starting this process. Although OpenRAG can preserve changes to the built-in flows, it doesn't preserve user-created flows. As a general best practice, exporting your flows is recommended to create backups of your customizations. Afterwards, you can reimport your flows or reference the exported flow JSON as needed.
  1. Stop all running containers:

    Docker
    docker stop $(docker ps -q)
    Podman
    podman stop --all
  2. Remove and clean up containers:

    1. Remove all containers, including stopped containers:

      Docker
      docker rm --force $(docker ps -aq)
      Podman
      podman rm --all --force
    2. Remove all images:

      Docker
      docker rmi --force $(docker images -q)
      Podman
      podman rmi --all --force
    3. Remove all volumes:

      Docker
      docker volume prune --force
      Podman
      podman volume prune --force
    4. Remove all networks except the default network:

      Docker
      docker network prune --force
      Podman
      podman network prune --force
    5. Clean up any leftover data:

      Docker
      docker system prune --all --force --volumes
      Podman
      podman system prune --all --force --volumes
  3. Optional: Edit OpenRAG's .env file if needed.

  4. Optional: If you removed all containers or specifically the OpenSearch container, then you can remove any files from the ~/.openrag/documents subdirectory that you don't want to reingest after redeploying the containers. It is recommended that you preserve OpenRAG's default documents.

  5. If you removed all OpenRAG containers, redeploy OpenRAG. If you removed only one container, redeploy that container with the appropriate docker run or podman run command.