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.

Export customized flows before reinstalling

If you modified the built-in flows or created custom flows in your OpenRAG Langflow instance, and you want to preserve those changes, export your flows before reinstalling OpenRAG.

Reinstall TUI-managed containers

  1. In the TUI's Status menu (3), click Factory Reset to destroy your OpenRAG containers and some related data.

    warning

    This is a destructive action that does the following:

    • Destroys all OpenRAG containers, volumes, and local images with docker compose down --volumes --remove-orphans --rmi local.
    • Prunes any additional container objects with docker system prune -f.
    • Deletes the contents of OpenRAG's config and ./opensearch-data directories.
    • Deletes the conversations.json file.

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

    This operation doesn't remove the .env file or the contents of the ./openrag-documents directory.

  2. Exit the TUI with q.

  3. Optional: Remove data that wasn't deleted by the Factory Reset operation. For a completely fresh installation, delete all of this data.

    • OpenRAG's .env file: Contains your OpenRAG configuration, including OpenRAG passwords, API keys, OAuth settings, and other environment variables. If you delete this file, OpenRAG automatically generates a new one after you repeat the setup and onboarding process. Alternatively, you can add a prepopulated .env file to your OpenRAG installation directory before restarting OpenRAG.
    • The contents of the ./openrag-documents directory: Contains documents that you uploaded to OpenRAG. Delete these files to prevent documents from being reingested to your knowledge base after restarting OpenRAG. However, you might want to preserve OpenRAG's default documents.
  4. Restart the TUI with uv run openrag or uvx openrag.

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

    If OpenRAG detects a .env file during setup and onboarding, it automatically populates any OpenRAG passwords, OAuth credentials, and onboarding configuration set in that file.

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. Destroy the containers, volumes, and local images, and then remove (prune) any additional container objects:

    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: Remove data that wasn't deleted by the previous commands:

    • OpenRAG's .env file
    • The contents of OpenRAG's config directory
    • The contents of the ./openrag-documents directory
    • The contents of the ./opensearch-data directory
    • The conversations.json file
  3. If you deleted the .env file, prepare a new .env before redeploying the containers. For more information, see Deploy OpenRAG with self-managed services.

  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. Stop all running containers:

    Docker
    docker stop $(docker ps -q)
    Podman
    podman stop --all
  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
  1. Optional: Remove data that wasn't deleted by the previous commands:

    • OpenRAG's .env file
    • The contents of OpenRAG's config directory
    • The contents of the ./openrag-documents directory
    • The contents of the ./opensearch-data directory
    • The conversations.json file
  2. 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.