View Source Running local Typesense

This document guides you through setting up a local Typesense instance for development purposes. Running a local instance allows you to experiment with search functionalities and integrate them into your development workflow seamlessly.

Prerequisites

Before we begin, ensure you have the following installed on your development machine:

Or use the one line command to install both:

# this is slightly edited so that you don't
# have to save the file on the machine
curl -sSL https://get.docker.com/ | sh

Setting up

We are using Docker compose to bootstrap a local Typesense instance from a sample docker compose file.

Clone the ex_typesense GitHub repository:

git clone https://github.com/jaeyson/ex_typesense.git

Navigate to the cloned GitHub repository start the Typesense instance:

cd ex_typesense

# using Linux
docker compose -f linux.yml up -d

# or using Mac OS, the difference is using arm64 arch
docker compose -f osx.yml up -d

More info on spinning a local instance: https://typesense.org/docs/guide/install-typesense

Once you've started Typesense, you can verify its installation by accessing the health endpoint through a browser or curl in the terminal:

$ curl http://localhost:8108/health
{"ok":true}

In a separate terminal, you can view the logs of your local Typesense instance using following command:

# using Linux
docker compose -f linux.yml logs -f

# or using Mac OS
docker compose -f osx.yml logs -f