How to Install OpenSearch via Docker on Ubuntu 22.04

 

Introduction

OpenSearch is an open-source search and analytics suite that provides real-time data exploration. By using Docker for installation, you can quickly set up a local development environment. This guide will walk you through installing OpenSearch via Docker on Ubuntu 22.04, which can be effectively hosted on a Windows VPS UK for optimal performance.

Prerequisites

  • An Ubuntu 22.04 server with root access
  • Basic knowledge of Linux commands
  • Docker and Docker Compose installed on your server

Step 1: Update Your System

Start by updating your package index and upgrading existing packages:

sudo apt update && sudo apt upgrade -y

Step 2: Install Docker

If you haven’t installed Docker yet, you can install it using the following commands:

sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt update
sudo apt install docker-ce -y

Start Docker and enable it to run on boot:

sudo systemctl start docker
sudo systemctl enable docker

Step 3: Install Docker Compose

To install Docker Compose, run the following command:

sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Verify the installation:

docker-compose --version

Step 4: Create a Docker Compose File for OpenSearch

Create a new directory for your OpenSearch setup:

mkdir ~/opensearch
cd ~/opensearch

Now, create a docker-compose.yml file:

nano docker-compose.yml

Paste the following configuration into the file:

version: '3.8'

services:
  opensearch:
    image: opensearchproject/opensearch:latest
    container_name: opensearch
    environment:
      - cluster.name=opensearch-cluster
      - node.name=opensearch-node
      - discovery.type=single-node
      - plugins.security.disabled=true
      - opensearch.memory.heap=1g
    ports:
      - 9200:9200
      - 9600:9600
    volumes:
      - opensearch_data:/usr/share/opensearch/data
    networks:
      - opensearch-network

volumes:
  opensearch_data:

networks:
  opensearch-network:

Step 5: Start OpenSearch

To start OpenSearch, run the following command:

docker-compose up -d

This will download the necessary images and start the OpenSearch container.

Step 6: Verify Installation

Once OpenSearch is running, you can verify the installation by navigating to http://your_server_ip:9200 in your web browser. You should see a JSON response indicating that OpenSearch is running.

Step 7: Conclusion

You have successfully installed OpenSearch via Docker on Ubuntu 22.04, providing a powerful search and analytics solution. This setup can greatly benefit from being hosted on a Windows VPS. For additional options, explore various VPS UK Windows solutions, including Windows Virtual Private Server Hosting and Windows VPS Hosting UK for optimal performance.

© 2024 OpenSearch Installation Tutorial. All rights reserved.

  • 0 Utilisateurs l'ont trouvée utile
Cette réponse était-elle pertinente?

Articles connexes

Boost Your Ubuntu System's Performance with a Swap File: A Step-by-Step Guide

What is a Swap File? A swap file in Ubuntu serves as dedicated virtual memory on your hard...

How to Migrate ISPConfig 2, ISPConfig 3.x, Confixx, CPanel or Plesk to ISPConfig 3.2 (single server)

Introduction Migration from other control panels like ISPConfig 2, ISPConfig 3.x, Confixx,...

How to Install and Configure Zabbix Server and Client on Rocky Linux 9

Introduction Zabbix is an open-source monitoring solution that provides real-time...

How to Install CockroachDB Cluster on Debian 12

Introduction CockroachDB is a distributed SQL database built to handle large-scale,...

How to Install Joomla with Apache and Let's Encrypt SSL on AlmaLinux 9

Introduction Joomla is a popular open-source content management system (CMS) used to build...