Install ZincSearch Inside Docker Container on Linux

Install ZincSearch Inside Docker Container on Linux

ZincSearch is an open-source search engine built for modern requirements, similar to Elasticsearch, but designed with simplicity, speed, ease of use in mind, and requires minimal system resources. ZincSearch is well-suited for implementing search functionality in applications or websites.

This tutorial explains how to install ZincSearch inside a Docker container on Linux. Commands have been tested on Ubuntu.

Prepare environment

Make sure you have installed Docker in your system. If you are using Ubuntu, installation instructions can be found in the post.

Install ZincSearch

Before starting, create directory for data:

sudo mkdir -p /opt/zincsearch/data

Set user, which ID is 10001 as owner for newly created directory:

sudo chown -R 10001:10001 /opt/zincsearch

Note: it doesn't matter that user (ID: 10001) doesn't exist on host system. This user will be created in the container.

  • Host network

Run the following command to create a container for ZincSearch that uses host network:

docker run -d --name=zincsearch --restart=always --network=host \
    -v /opt/zincsearch/data:/data \
    -e ZINC_FIRST_ADMIN_USER=admin \
    -e ZINC_FIRST_ADMIN_PASSWORD=pwd123 \
    public.ecr.aws/zinclabs/zincsearch
  • User-defined bridge network

User-defined bridge network can be used for listening on different port. By default, ZincSearch service is listening on port 4080. It can be changed with -p option.

docker network create app-net
docker run -d --name=zincsearch --restart=always --network=app-net \
    -p 8080:4080 \
    -v /opt/zincsearch/data:/data \
    -e ZINC_FIRST_ADMIN_USER=admin \
    -e ZINC_FIRST_ADMIN_PASSWORD=pwd123 \
    public.ecr.aws/zinclabs/zincsearch

Note: don't forget to change admin password.

Testing ZincSearch

Open a web browser and navigate to http://<IP_ADDRESS>:4080, replacing <IP_ADDRESS> with the IP address of the system. Use the username and password to log in to the web interface.

ZincSearch Inside Docker Container on Linux

Uninstall ZincSearch

To completely remove ZincSearch, remove its container:

docker rm --force zincsearch

Remove ZincSearch image:

docker rmi public.ecr.aws/zinclabs/zincsearch

You can also remove ZincSearch data:

sudo rm -rf /opt/zincsearch

If a user-defined bridge network was created, you can delete it as follows:

docker network rm app-net

Leave a Comment

Cancel reply

Your email address will not be published.