Railway

Deploy Typesense

Search engine that powers fast, typo-tolerant search boxes

Deploy Typesense

Just deployed

/data

Just deployed

Deploy and Host Typesense on Railway

Typesense is an open-source, typo-tolerant search engine built for instant search-as-you-type experiences. It keeps its index in memory and answers queries over a plain REST/JSON API, so a search box backed by Typesense returns results in single-digit milliseconds without the weight of an Elasticsearch cluster. Teams use it for storefront product search, documentation search, in-app search over records, and — since it stores vectors too — semantic and hybrid search. It is the open-source answer to Algolia, with the same ergonomics and no per-search billing.

Deploy Typesense on Railway and you get two services wired together: the typesense search server, holding its index on a persistent volume at /data and reachable over HTTPS with an API key, and typesense-dashboard, a browser admin interface for creating collections, importing documents, running searches and minting scoped keys. The dashboard is a static single-page app that talks to the server from your browser, which is why cross-origin requests are enabled. Both services come up with working defaults, so you can self-host Typesense and be indexing minutes after the deploy finishes.

Diagram of the Typesense and dashboard services on Railway

Getting Started with Typesense on Railway

Once the deploy is green, open the typesense service's public URL with /health appended — a healthy node answers {"ok":true}, the one route needing no authentication. Everything else needs the admin API key Railway generated, stored as TYPESENSE_API_KEY on the typesense service; copy it from the Variables tab. Now open the typesense-dashboard URL: protocol, host and port already point at your search server, so paste the key into the Api Key field and press Login. You land on Server Status, reporting the node's version, role and memory use — proof the dashboard reaches your server. Use Collections to create a collection with its fields and a default sorting field, then Add Document or Import to load records. Open Search to query it with facets and filters, and misspell a word to watch typo tolerance work. Before wiring a public site to it, create a documents:search key scoped to that collection on the API Keys page — the admin key can delete data, so it must never reach a browser.

Typesense Dashboard browsing a books collection with author facets

Typo-tolerant Typesense search matching two Murakami novels

Typesense server status showing a healthy leader node

About Hosting Typesense

Typesense is a single C++ binary that loads collections into RAM and persists them to an on-disk store, which is what makes its latency predictable: no JVM to tune, no shard planning, no query DSL. You define a schema, POST JSON documents, and search with query parameters. Self-host it when search is core to your product and you would rather own the data and the cost curve than pay per search.

  • Typo tolerance, prefix search and configurable ranking by default
  • Faceting, filtering, grouping and sorting in one query
  • Vector and hybrid search, so semantic results sit beside keyword results
  • Synonyms, curated pins, stopwords and stemming for editorial control
  • Scoped API keys, including keys carrying a filter for multi-tenant search
  • Clients for JavaScript, Python, Ruby, PHP, Go and Java, plus InstantSearch.js

The Railway architecture is deliberately small. The typesense service is the entire data layer — no database, cache or object storage, because the volume at /data holds the index and write-ahead log. The typesense-dashboard service holds no state; it serves static files behind Caddy, and its requests to the search server all happen in your browser.

Why Deploy Typesense on Railway

Railway removes the server work from running a search engine:

  • The persistent volume at /data survives redeploys and restarts
  • HTTPS and a public domain for both the API and the dashboard
  • A health check on /health catches a node that stops answering
  • Thread-pool sizing follows the container's quota, not the host's core count
  • Vertical scaling is a slider, which is how Typesense wants to grow

Common Use Cases

  • Storefront product search with facets for brand, price and category
  • Documentation or knowledge-base search embedded with InstantSearch.js
  • In-app search across users, tickets or orders, with a scoped key per tenant
  • Semantic and hybrid retrieval for RAG, vectors and keywords in one engine

Dependencies for Typesense

The server version is pinned because Typesense publishes no floating stable tag, and its data directory belongs to a major version — a surprise upgrade would leave an index unreadable. The dashboard is stateless, so it tracks its latest release.

Environment Variables Reference

VariableServicePurpose
TYPESENSE_API_KEYtypesenseBootstrap admin key sent as X-TYPESENSE-API-KEY
TYPESENSE_DATA_DIRtypesenseIndex location; must be the volume mount
TYPESENSE_API_PORTtypesensePort the search API listens on
TYPESENSE_ENABLE_CORStypesenseAllows browser clients, including the dashboard
TYPESENSE_HOSTtypesense-dashboardSearch server host the login form points at

Deployment Dependencies

Hardware Requirements for Self-Hosting Typesense

Typesense holds its index in RAM, so memory — not CPU — is the number that matters. Size it to two or three times the documents you index, and keep usage under 85% of the container's memory.

ResourceMinimumRecommended
CPU1 vCPU2–4 vCPU
RAM512 MB2 GB+, scaled to index size
Storage5 GB volume2× the size of your indexed data
RuntimeDockerDocker, one node per volume

This template ships a single node. Typesense's clustering addresses peers by private IPv4, which Railway's IPv6-only private network does not provide, so scale vertically rather than adding peer services.

Self-Hosting Typesense

Locally the engine is one container plus a data directory. The following runs the same image this template deploys:

docker run -d --name typesense -p 8108:8108 \
  -v "$(pwd)/typesense-data:/data" \
  typesense/typesense:30.2 \
  --data-dir /data --api-key=CHANGE_ME --enable-cors

Create a collection and search it with any HTTP client. The following uses curl:

curl -X POST "http://localhost:8108/collections" \
  -H "X-TYPESENSE-API-KEY: CHANGE_ME" \
  -d '{"name":"books","fields":[{"name":"title","type":"string"},
       {"name":"year","type":"int32"}],"default_sorting_field":"year"}'

curl "http://localhost:8108/collections/books/documents/search?q=hitchhikr&query_by=title" \
  -H "X-TYPESENSE-API-KEY: CHANGE_ME"

On Railway, replace http://localhost:8108 with your public URL and the key with TYPESENSE_API_KEY. Every server flag has an environment variable equivalent, so anything in the configuration reference can be set from the Variables tab of the service.

How Much Does Typesense Cost to Self-Host?

The Typesense server is free and open source under GPL-3.0, with no feature gating against the paid product — clustering, vector search and scoped keys are all in the open-source binary. Typesense Cloud, from the same team, starts around $7 per month for a small single-region node and rises with RAM, vCPU and high availability. Self-hosting on Railway costs only the compute, memory and volume the two services use, with no per-search charge.

FAQ

What is Typesense?

Typesense is an open-source search engine that returns typo-tolerant, ranked results over a REST/JSON API — a simpler, self-hostable alternative to Algolia and Elasticsearch for search-as-you-type.

What does this Railway template deploy?

The Typesense search server on a persistent volume, plus the Typesense Dashboard admin interface pre-pointed at it. Both get public HTTPS URLs; the server needs an API key on every route but its health check.

Why does the search server need a volume instead of a database?

Typesense is its own datastore. The volume at /data holds the index and write-ahead log, so collections and API keys survive redeploys.

How do I connect my website or app to self-hosted Typesense?

Create a search-only key on the dashboard's API Keys page, then point an official client, or the InstantSearch.js adapter, at your public URL on port 443 with protocol: 'https'. Never ship the admin key to a browser.

Can I run a highly available Typesense cluster on Railway?

Not as a multi-node Raft cluster: peers address each other over private IPv4, which Railway's private network does not route. Scale the node's CPU and memory instead, and snapshot through the /operations/snapshot endpoint.


Template Content

More templates in this category

View Template
Garage S3 Storage
Ultra-light S3 server: fast, open-source, plug-and-play.

PROJETOS
8
View Template
Redis
Self Host Latest Redis with Railway

2
View Template
EasyImg
Simple self-hostable Nuxt.js personal image hosting system.

Muhammad Bilal
0