Deploy Typesense - Instant Search Algolia Alternative
Typo-tolerant instant search engine. Self-hosted Algolia alternative.
typesense
Just deployed
/data
Deploy and Host Typesense on Railway
Typesense is an open-source, typo-tolerant search engine written in C++ built for instant "search-as-you-type" experiences. Index documents and run sub-50ms full-text, faceted, and vector search behind a clean REST API — a self-hosted, developer-friendly alternative to Algolia and Elasticsearch.
About Hosting Typesense
This template runs the official typesense/typesense image wired for Railway. Typesense serves its REST API on port 8108; the template sets PORT=8108 so Railway's proxy targets it and exposes the service over HTTPS. The search index lives on an attached volume at /data, so your collections survive redeploys. Every data route is protected by the TYPESENSE_API_KEY auto-generated at deploy — only /health stays open so Railway can healthcheck the service. The start command wires the rest in for you (--data-dir=/data, --api-port, --api-key), including one Railway-specific tuning: --thread-pool-size=8, so Typesense does not size its thread pool from the container host's core count and crash at boot. Typesense is memory-resident: it holds the index in RAM for fast search, so size the service to your dataset.
Why Deploy Typesense on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Typesense on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, search engines, and more on Railway.
- Instant search in one click — add typo-tolerant, faceted search to any app without a managed-service bill.
- Your data stays yours — documents and the index never leave your infrastructure; no per-record SaaS fees.
- Secure by default — API key auth is auto-generated; volume, healthcheck, and HTTPS domain are preconfigured.
- Drop-in Algolia alternative — point InstantSearch.js and the official clients at your own domain.
Common Use Cases
- Search-as-you-type UIs — power instant, typo-tolerant search boxes for docs, products, or apps.
- Faceted catalog and e-commerce search — filter and rank large catalogs with facets, synonyms, and curation.
- Semantic and hybrid search — combine keyword and vector search over embeddings for RAG and recommendations.
Dependencies for Typesense Hosting
- A volume mounted at
/data(included in this template) for the persistent search index. - A service sized to your dataset — the index is held in RAM for fast search.
Deployment Dependencies
- Typesense — upstream search engine by Typesense (GPL-3.0)
- Typesense documentation — API reference and client SDKs
- typesense/typesense Docker image — the official image this template deploys
Implementation Details
Create a collection, index a document, and search:
# create a collection
curl -X POST 'https:///collections' \
-H 'X-TYPESENSE-API-KEY: $API_KEY' -H 'Content-Type: application/json' \
-d '{"name":"docs","fields":[{"name":"title","type":"string"},{"name":"pts","type":"int32"}]}'
# index a document
curl -X POST 'https:///collections/docs/documents' \
-H 'X-TYPESENSE-API-KEY: $API_KEY' -H 'Content-Type: application/json' \
-d '{"title":"hello railway","pts":42}'
# search
curl 'https:///collections/docs/documents/search?q=hello&query_by=title' \
-H 'X-TYPESENSE-API-KEY: $API_KEY'
Official clients for JS/TS, Python, PHP, Ruby, Go, Java, and .NET, plus drop-in InstantSearch.js and Firebase/Postgres sync adapters.
Template Content
typesense
typesense/typesense:30.2PORT