CategoriesAIOpenSearch

Simple Guide to RAG Setup with OpenSearch – part 1

In this guide, we explore how to get started with OpenSearch and OpenSearch Dashboards using Docker. This setup forms the foundation for creating a local RAG environment.


Prerequisites

  • A system that runs Docker
  • A minimum of 8GB of system memory

We are going to start by launching OpenSearch and OpenSearch Dashboards on Docker.


Step 1: Create a Docker network

To create a dedicated network for OpenSearch, run the following command:

docker network create os-net

Before starting the OpenSearch container, ensure your system has the correct sysctl configurations:

sudo sysctl -w vm.max_map_count=262144

To make this change permanent, add the following line to your /etc/sysctl.conf file and activate it with sysctl -p or by rebooting your system:

vm.max_map_count=262144

Step 2: Start a Docker container with OpenSearch on that network

Run the following command to start the OpenSearch container on the created network:

docker run --name os01 -d --net os-net -p 9200:9200 -p 9600:9600 \
  -e "discovery.type=single-node" \
  -e "OPENSEARCH_INITIAL_ADMIN_PASSWORD={password}" \
  opensearchproject/opensearch:2.18.0

Test the OpenSearch connection using this command:

curl https://localhost:9200 -ku admin:<custom-admin-password>

Step 3: Set up OpenSearch Dashboards

Run the following command to set up OpenSearch Dashboards:

docker run -d --net os-net -p 5601:5601 -e "OPENSEARCH_HOSTS=https://os01:9200" -e "OPENSEARCH_SSL_VERIFICATIONMODE=none" opensearchproject/opensearch-dashboards:2.18.0

Once the container is running, you can access OpenSearch Dashboards and log in with the admin user and the previously configured password


Conclusion

This is the first part of a three-part series where we set up RAG locally on your host. OpenSearch, along with its dashboard, is now running, allowing us to continue configuring it in the second article.”