docker.recipes

Typesense Search Engine

beginner

Typesense instant search with built-in typo tolerance and faceting.

Overview

Typesense is an open-source, typo-tolerant search engine built for instant search experiences. Created as a developer-friendly alternative to complex solutions like Elasticsearch and expensive services like Algolia, Typesense focuses on delivering sub-millisecond search latency with built-in typo tolerance, faceting, and filtering capabilities. Its simple REST API and straightforward configuration make it ideal for developers who need powerful search functionality without the operational overhead of traditional search engines. This stack combines Typesense server with the community-built Typesense Dashboard, creating a complete search solution with visual management capabilities. The dashboard provides an intuitive interface for managing collections, indexing documents, and testing search queries, while the Typesense server handles all search operations with its high-performance C++ core. Together, they offer both programmatic API access and visual administration tools for comprehensive search implementation. This combination is perfect for development teams building e-commerce platforms, content management systems, or any application requiring fast, intelligent search functionality. Startups benefit from the cost-effective alternative to hosted search services, while enterprises appreciate the self-hosted control and clustering capabilities. The visual dashboard makes it accessible to non-technical team members who need to manage search data, test queries, or configure search parameters without diving into API documentation.

Key Features

  • Sub-millisecond search latency with intelligent typo tolerance
  • Built-in faceting and filtering for complex product catalogs
  • Visual dashboard for collection management and query testing
  • CORS-enabled API for direct browser integration
  • Vector search capabilities for AI-powered semantic search
  • Geo-search functionality for location-based filtering
  • Synonym management and result curation features
  • High availability clustering support for production deployments

Common Use Cases

  • 1E-commerce product search with autocomplete and faceted navigation
  • 2SaaS application search for user-generated content and documentation
  • 3Real estate platforms requiring geo-search and property filtering
  • 4Content management systems with full-text article and media search
  • 5Developer documentation sites with instant code and API search
  • 6Educational platforms searching courses, instructors, and learning materials
  • 7Job board applications with skill-based and location filtering

Prerequisites

  • Minimum 1GB RAM for optimal Typesense performance with moderate datasets
  • Ports 8108 and 8080 available for Typesense API and dashboard access
  • Valid TYPESENSE_API_KEY environment variable for server authentication
  • Basic understanding of REST APIs for integration and data indexing
  • JSON knowledge for document structure and collection schema design

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 typesense:
3 image: typesense/typesense:0.25.1
4 container_name: typesense
5 environment:
6 - TYPESENSE_DATA_DIR=/data
7 - TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
8 - TYPESENSE_ENABLE_CORS=true
9 volumes:
10 - typesense_data:/data
11 ports:
12 - "8108:8108"
13 networks:
14 - typesense-network
15 command: '--data-dir=/data --api-key=${TYPESENSE_API_KEY} --enable-cors'
16
17 dashboard:
18 image: bfritscher/typesense-dashboard:latest
19 container_name: typesense-dashboard
20 ports:
21 - "8080:80"
22 networks:
23 - typesense-network
24
25volumes:
26 typesense_data:
27
28networks:
29 typesense-network:
30 driver: bridge

.env Template

.env
1# Typesense Search
2TYPESENSE_API_KEY=your-api-key-here

Usage Notes

  1. 1API at http://localhost:8108
  2. 2Dashboard at http://localhost:8080
  3. 3Connect dashboard to localhost:8108
  4. 4Sub-millisecond search latency
  5. 5Built-in typo tolerance

Individual Services(2 services)

Copy individual services to mix and match with your existing compose files.

typesense
typesense:
  image: typesense/typesense:0.25.1
  container_name: typesense
  environment:
    - TYPESENSE_DATA_DIR=/data
    - TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
    - TYPESENSE_ENABLE_CORS=true
  volumes:
    - typesense_data:/data
  ports:
    - "8108:8108"
  networks:
    - typesense-network
  command: "--data-dir=/data --api-key=${TYPESENSE_API_KEY} --enable-cors"
dashboard
dashboard:
  image: bfritscher/typesense-dashboard:latest
  container_name: typesense-dashboard
  ports:
    - "8080:80"
  networks:
    - typesense-network

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 typesense:
5 image: typesense/typesense:0.25.1
6 container_name: typesense
7 environment:
8 - TYPESENSE_DATA_DIR=/data
9 - TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
10 - TYPESENSE_ENABLE_CORS=true
11 volumes:
12 - typesense_data:/data
13 ports:
14 - "8108:8108"
15 networks:
16 - typesense-network
17 command: '--data-dir=/data --api-key=${TYPESENSE_API_KEY} --enable-cors'
18
19 dashboard:
20 image: bfritscher/typesense-dashboard:latest
21 container_name: typesense-dashboard
22 ports:
23 - "8080:80"
24 networks:
25 - typesense-network
26
27volumes:
28 typesense_data:
29
30networks:
31 typesense-network:
32 driver: bridge
33EOF
34
35# 2. Create the .env file
36cat > .env << 'EOF'
37# Typesense Search
38TYPESENSE_API_KEY=your-api-key-here
39EOF
40
41# 3. Start the services
42docker compose up -d
43
44# 4. View logs
45docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/typesense-search/run | bash

Troubleshooting

  • Dashboard shows 'Connection failed' error: Verify Typesense is running on port 8108 and use 'typesense:8108' for internal Docker network connections
  • Search queries return 401 Unauthorized: Check TYPESENSE_API_KEY environment variable matches between server and client requests
  • Typesense container exits with 'permission denied' on /data: Ensure Docker has write permissions to the typesense_data volume mount point
  • Search results missing expected documents: Verify collection schema matches indexed document structure and fields are marked as searchable
  • High memory usage with large datasets: Increase container memory limits or implement data partitioning strategies for datasets over 1GB

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space