
Deploy Typesense Image Search
Text-to-image and similar-image search with CLIP
typesense-railway
Just deployed
Deploy and Host self hosted Typesense Image Search (Image Search with CLIP) on Railway
Typesense Image Search adds text-to-image and similar-image search to self-hosted Typesense, using the built-in CLIP model.
About Hosting Typesense Image Search open-source software on Railway (self hosted Typesense template)
Self-hosting image search keeps your photos and embeddings on infrastructure you control.
Why Deploy Typesense Image Search, the Google Cloud Vision alternative on Railway (Railway Free Trial)
Google Cloud Vision bills per image, so every catalogue re-index lands on someone else's invoice. Railway's $5 GitHub trial is enough to test it before you commit.
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 Image Search on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Railway vs Other Hosting Providers and VPS for Typesense Image Search self hosting
Typesense Image Search runs a CPU-heavy CLIP model beside your index, so provider choice changes what RAM costs you and how much server upkeep you own.
| Provider | What You Get with Railway | What You Get with the Other Provider |
|---|---|---|
| DigitalOcean | A Caddy service with a public HTTPS domain and a persistent volume, no OS patching. | Droplets with cheap RAM and full root access, but you own the firewall and TLS. |
| AWS | The image, proxy, and volume wired by variables, with no VPC plumbing. | Fine-grained EC2 and EBS sizing, mainly worth it if you already run on AWS. |
| Hetzner | A predictable monthly bill without touching the host. | Some of the cheapest dedicated RAM, useful for large batch imports, but you run backups and upgrades. |
Choose Railway for a fast start, and a VPS when RAM per dollar matters more than managing the server.
Common Use Cases for hosted Typesense Image Search
- Visually similar products: A shop indexes product photos once. A shopper clicking a jacket gets similar jackets through
vector_querywith the document id, andfilter_bykeeps sold-out items out. - Text-to-image lookup: A content team types "sunset over a harbour" and gets matching photos from the archive, with no hand-written tags needed.
- Near-duplicate detection: Marketplaces catch re-uploaded or lightly edited pictures with similar-image queries. Indexing is CPU-heavy, so import in batches through the documents import endpoint.
- Visual search in an internal tool: A QA team finds screenshots by describing them. Keep a URL field for display and set
storeto false on the image field to keep the index lean. - Hybrid catalog search: When some records have good titles and others only photos, add a text field to
query_bybeside the embedding field to get keyword precision and visual recall together.
Dependencies for Typesense Image Search Docker hosted on Railway
The Shinyduo/typesense-railway repo builds a Typesense 30 image beside a small Caddy reverse proxy. If a request hits the wrong address, check that mismatch first.
Deployment Dependencies for Managed Typesense Image Search Service (Image and Text-to-Image Search)
Attach a persistent Railway volume. Replace TYPESENSE_API_KEY with a long random value right after deploy.
Implementation Details for Typesense Image Search (Using Typesense official docker image)
The container runs the official Typesense 30 image with TYPESENSE_THREAD_POOL_SIZE=64 and TYPESENSE_NUM_COLLECTIONS_PARALLEL_LOAD=32. Lower those if your Railway plan has tight CPU.
How does Typesense Image Search compare against other image search engines platforms
Most teams weighing image search pick between a hosted vision API, a managed vector database, or running an open-source engine.
Typesense Image Search vs Google Cloud Vision (Competitor Alternative)
- Where it wins: Text-to-image and similar-image search come from one collection, with CLIP embeddings generated on your own server.
- Where Google Cloud Vision wins: Labels, OCR, and product search work out of the box, and general photo accuracy is hard to beat.
- Cost shape: Vision bills per image analysed; a Typesense node scales with RAM and CPU instead.
Typesense Image Search vs Pinecone (Competitor Alternative)
- Where it wins: Pinecone is a managed vector database with easy scaling and no servers to tend.
- Where Typesense Image Search wins: It handles the embedding step, so you send an image or text query and skip a separate CLIP pipeline.
- Tradeoff: Typesense keeps the index in memory, so RAM sizing is on you.
Typesense Image Search vs Weaviate (Competitor Alternative)
- Where it wins: Weaviate is open source with CLIP modules, a rich schema, and a larger integration ecosystem.
- Where Typesense Image Search wins: Setup is lighter: one collection definition with embed.from and a model name, in one container.
- Honest note: If you need advanced vector graph features, Weaviate is the more mature choice.
Typesense Image Search vs Elasticsearch (Competitor Alternative)
- Where it wins: Elasticsearch has dense vector support, a large community, and mature tooling for logs and analytics.
- Where Typesense Image Search wins: CLIP embeddings are built in, so you skip writing an ingest pipeline.
- Tradeoff: If your team already runs Elasticsearch, staying put is often the sensible call.
How to use Typesense Image Search (the OSS Image and Text-to-Image Search)?
Typesense Image Search gets tricky on day one because image indexing is the slow, CPU-heavy part. Work through these steps in order.
- Swap the placeholder key. Replace TYPESENSE_API_KEY with a long random string, then mint scoped keys from the /keys API.
- Create a collection with an
imagefield (base64 BMP, JPG or PNG) set tostore: false, plus aurlfield for display. - Add an
embeddingfield of typefloat[]withembed.fromset to the image field andembed.model_config.model_nameset tots/clip-vit-b-p32. - Import documents in small batches. The CLIP model downloads on first use and runs on CPU, so batching keeps Railway memory from spiking.
- Search by text with
qandquery_byset to the embedding field, or usevector_querywith an existing document id for similar images.
How to self host Typesense Image Search on other VPS Services (Typesense Image Search self hosting guide)
Typesense Image Search runs on any VPS with Docker and persistent disk. The CLIP model downloads on first use, so the first image insert is slow and the box needs room for it.
Clone the Repository
git clone https://github.com/Shinyduo/typesense-railway.git
cd typesense-railway
Install Dependencies
You need Docker and Docker Compose. Confirm both work:
docker --version
docker compose version
Give Typesense a directory or volume that persists, since embeddings and cached CLIP weights live there.
Configure Environment Variables
Set these in a .env file beside the compose file:
TYPESENSE_API_KEY=replace-with-a-long-random-value
TYPESENSE_DATA_DIR=/var/lib/typesense
TYPESENSE_PUBLIC_URL=https://your-domain
TYPESENSE_URL=http://localhost:8080
TYPESENSE_THREAD_POOL_SIZE=64
TYPESENSE_NUM_COLLECTIONS_PARALLEL_LOAD=32
PORT=8080
Replace the API key before exposing anything. CORS is off by default, so enable it in your proxy if browsers call the API directly.
Start the Typesense Image Search Application
docker compose up -d
curl -s https://your-domain/health
Once health responds, create your image collection and import in batches, since CLIP indexing is CPU heavy. Railway handles the volume, HTTPS domain, and proxy wiring for you.
Official Pricing of Typesense Image Search (Typesense Image Search pricing)
Typesense is free and open source under GPL-3.0, so Typesense Image Search has no license fee. Your bill follows RAM and CPU size, not query count. Check Railway's pricing page for current rates.
Typesense Image Search cloud vs self hosted comparison (Pricing, features, costs, and more)
Hosted image APIs bill per image, while self-hosting Typesense Image Search moves the cost to compute and storage.
Monthly cost of self hosting Typesense Image Search on Railway
On Railway you pay for compute time and the volume holding your index. Typesense charges nothing, and the CLIP model downloads on first use. Import in batches and watch memory during the first load.
System Requirements for Hosting Typesense Image Search on a VPS
Plan for enough RAM to hold the index plus the CLIP model, with headroom for imports. Size the disk for the data directory and cached model.
Frequently Asked Questions (FAQs)
Do I need a GPU for Typesense Image Search on Railway?
No. Railway doesn't offer GPUs, and CLIP runs on the server CPU, so indexing is the slow part.
Why is my collection so small when I index photos?
Set store: false on the image field. Typesense builds the embedding from the base64 image and discards the bytes.
Can I search by text and by image in one collection?
Yes. List a name field and the image field in embed.from.
How do I keep my admin key out of the browser?
Don't ship TYPESENSE_API_KEY to clients. Replace the default key with a long random value right after your first deploy.
Does this template enable CORS for my web app?
No. CORS is off by default, so browser requests from another origin will fail until you configure it. Test with a scoped key from a real page early.
When is Google Cloud Vision the better choice?
When you want labels, OCR, or product matching out of the box and don't mind a per-image bill.
Template Content
typesense-railway
Shinyduo/typesense-railway