---
title: "Deploy Apache Tika"
description: "Apache Tika 4.0 server for text extraction and OCR behind an API token."
category: "Other"
url: https://railway.com/deploy/apache-tika
---

# Deploy Apache Tika

Apache Tika 4.0 server for text extraction and OCR behind an API token.

**[Deploy Apache Tika on Railway](https://railway.com/template/apache-tika)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/apache-tika/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Other

## Template content

### gateway https://raw.githubusercontent.com/caddyserver/website/5c921006aae4feb2184782ae528c2bb09a07e04f/src/resources/images/favicon.png

- **Image:** caddy:2.11.4-alpine
- **Start command:** `sh -c 'printf "%s\n" "$CADDYFILE" > /tmp/Caddyfile && exec caddy run --config /tmp/Caddyfile --adapter caddyfile'`
- **Health check:** /healthz
- **Public domain:** Yes

### tika https://github.com/apache.png

- **Image:** apache/tika:4.0.0-1-full
- **Health check:** /version

## Documentation

# Deploy and Host Apache Tika on Railway

Apache Tika detects and extracts text and metadata from more than a thousand file types, including PDF, Word, Excel, PowerPoint, email, HTML and images. Its REST server is widely used in search indexing and RAG pipelines to turn uploaded documents into plain text or structured content, with Tesseract OCR for scanned files.

## About Hosting Apache Tika

This template deploys Tika Server 4.0.0 using the full image, which includes Tesseract OCR, plus a Caddy gateway as the only public entry point. The gateway requires a bearer token on every request and removes it before forwarding, so Tika never sees it, and it caps uploads at 100 MB. Tika stays private, so services in the same project can call it directly without the token. Tika keeps no state. OCR and large documents are CPU and memory hungry, so size the service for your files. Add replicas to scale throughput horizontally.

## Common Use Cases

- Extracting text from uploaded PDFs and Office files for search or RAG
- OCR for scanned documents and images
- Metadata and MIME type detection in document pipelines

## Dependencies for Apache Tika Hosting

- `apache/tika:4.0.0-1-full` (official image with OCR)
- `caddy:2.11.4-alpine` (official image) as the token gateway

### Deployment Dependencies

- [Tika Server documentation](https://cwiki.apache.org/confluence/display/TIKA/TikaServer)
- [Apache Tika 4.0.0](https://tika.apache.org/)
- [Supported formats](https://tika.apache.org/3.2.3/formats.html)
- [Railway private networking](https://docs.railway.com/reference/private-networking)

### Implementation Details

| Service | Image | Networking | Storage |
| --- | --- | --- | --- |
| tika | `apache/tika:4.0.0-1-full` | private only, port 9998 | none |
| gateway | `caddy:2.11.4-alpine` | public domain on 8080 | none |

```bash
curl -T report.pdf "$TIKA_URL/tika" -H "Authorization: Bearer $TIKA_API_TOKEN" -H "Accept: text/plain"
curl -T report.pdf "$TIKA_URL/meta" -H "Authorization: Bearer $TIKA_API_TOKEN" -H "Accept: application/json"
```

Inside the project, call `${{tika.TIKA_PRIVATE_URL}}` without the token.

| Variable | Service | Default | Purpose |
| --- | --- | --- | --- |
| `TIKA_API_TOKEN` | gateway | generated | Bearer token for public requests |
| `TIKA_MAX_UPLOAD` | gateway | `100MB` | Request body limit |
| `CADDYFILE` | gateway | gateway config | Routing and auth |

Notes:

- `/version` is the Tika health check; the gateway health check is `/healthz`.
- Tika Server has no authentication of its own, which is why it stays private.

This is a community-maintained deployment package and does not imply affiliation with or endorsement by the Apache Tika project or its maintainers.

## Why Deploy Apache Tika 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 Apache Tika 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.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/apache-tika
