Apache Tika

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

The reference material consulted while preparing these pages is listed in the section bibliography.

A document intake service receives files it does not control: a Word manuscript, a scanned PDF, an e-mail with a ZIP attachment, a text file in an old encoding, a PDF renamed to .png. Apache Tika answers the two questions every such service asks first: what is this file, and what is in it. It detects the media type of more than a thousand formats and extracts text, metadata, embedded documents and the language through a single interface. This section is a practical, example-driven guide to using it from Java, from the command line, as a REST or gRPC service and as a scalable Tika Pipes pipeline that feeds search indexes and RAG systems. Versions and dates are re-verified when each page is written and stated as of the date checked.

Running scenario: Bookshelf

Every page uses the same example, the document intake service of the Bookshelf store used by other sections, so readers can compare approaches. It receives files from publishers and readers, then extracts text and metadata for search and RAG. The sample files are original and were created for this section:

  • manuscript.docx: headings, tables, an embedded image and author metadata.

  • catalogue.pdf: a tagged PDF with bookmarks, a form and a PDF attachment.

  • scanned-loan-form.pdf and book-cover.jpg: OCR and EXIF and XMP metadata.

  • publisher-email.eml with a samples.zip attachment that contains more documents: embedded and recursive parsing.

  • novel.epub, reviews-es.html and reseñas-fr.txt: other formats, HTML and language detection.

  • legacy-catalogue.txt, saved in windows-1252: charset detection.

  • renamed-invoice.png, a PDF renamed to .png: detection by content, not by name.

No example uses real secrets, passwords or personal data; examples that need credentials (cloud fetchers, VLM and inference services) read them from environment variables.

Library path and service path

The section is organised around two ways of running Tika, and most real systems end up using both.

  • Library path. The Tika classes run inside your own JVM: the Tika facade, AutoDetectParser, content handlers, Metadata and the configuration loaded with TikaLoader. It is the simplest and the fastest route, but a parser that runs in-process shares the fate of your application: an out-of-memory error, an infinite loop or a crash caused by a hostile file is then your problem, not Tika’s.

  • Service and pipeline path. Parsing happens in a separate process: PipesForkParser, the tika-app command line, tika-server (REST), tika-grpc or a full Tika Pipes pipeline with fetchers and emitters. Process isolation is Tika’s own sandbox model, and it is what the official documentation recommends for untrusted input. tika-server and tika-grpc are not security boundaries themselves: expose them only to trusted callers.

The foundations and core concepts pages teach the library path. The running and integration pages add the service path and show how both are tied together in Spring Boot, search indexing and RAG ingestion.

Version baseline

Values checked on 2026-10-12 against Maven Central, the Apache Tika website and Docker Hub.

Component Version used in this section

Apache Tika 4.x

4.1.0 (released 29 September 2026), the first stable 4.x release being 4.0.0 (21 August 2026). Requires Java 17 or later. No 4.2 release exists yet.

Apache Tika 3.x

3.3.2 (released 16 July 2026). Requires Java 11. Differences are noted on each page.

Java

21 or later for the examples (Tika 4.x itself needs 17, Tika 3.x needs 11)

Spring Boot

4.1.x, on Spring Framework 7

Docker image

apache/tika:4.1.0 (minimal), apache/tika:4.1.0-full and apache/tika-grpc; pin <version>-<N> tags in production

The 3.x line stays supported after 4.0, but the sources disagree on for how long. The roadmap page of the 4.1.x documentation states March 2027, while the Tika wiki roadmap states "January 2027 or 6 months after the release of 4.0.0, whichever comes first". This section uses the website date (March 2027) and the version table above, and every page that depends on it says so; check both pages before planning a migration. Version 2.x (Java 8) reached end of life in April 2025 (last release 2.9.4) and 1.x in September 2022.

The book and the official documentation

Tika in Action by Chris A. Mattmann and Jukka L. Zitting (Manning, 2011) was written for Tika 1.0. Its concepts are still valid: media types and detection, the Parser and ContentHandler model, XHTML output, metadata and language detection. Its code is not, because the API has changed in 2.0, 3.0 and 4.0. The pages of this section teach the concepts the book introduced and show every API in its current form, with the book chapter cited where it helps and an "outdated idiom to current code" table on the What’s Changed & Migration page.

The official documentation also has gaps that the pages state honestly instead of inventing APIs:

  • There is no official Spring Boot starter or Spring integration for Tika; the Spring page builds the wiring itself.

  • The tika-app command line is still described as in flux for 4.x.

  • The facade, RecursiveParserWrapper from Java, encrypted documents, custom media types, translation and logging have little or no 4.x narrative; those pages cite the Javadoc, the 3.x guides, the wiki and the official tika-example module.

  • The 4.1.x documentation site says it was generated with AI assistance and needs human review, so facts are cross-checked against the Javadoc, CHANGES.txt and the source.

  • Tika does not recover layout (reading order across columns, table structure) as layout models do.

  • Many wiki pages describe 3.x behaviour and are labelled as such.

Choose your page

flowchart TD S["What do you need?"] --> D["Know what a file is"] S --> X["Extract text and metadata"] S --> R["Run Tika safely at scale"] S --> I["Feed search or RAG"] D --> D1["Media types, detection and charsets"] X --> X1["Parser API, handlers, metadata, embedded documents"] X --> X2["PDF, OCR, VLM parsers and configuration"] R --> R1["Tika App, Server, gRPC and Docker"] R --> R2["Tika Pipes, limits, timeouts and security"] I --> I1["Spring Boot, Solr, Elasticsearch and RAG"] D1 --> X1 X1 --> R2 X2 --> R2 R1 --> I1 R2 --> I1

Pages

The outline covers foundations, core concepts, configuration and specialised parsing, the ways of running Tika, integrations and workflows, and ends with a downloadable cheat sheet. Pages are listed in reading order.

Foundations

  • Introduction & Architecture: What Tika is, the four pillars (detection, parsing, metadata, language), the module map and when to embed it or run it as a service.

  • Setup & Installation: Maven and Gradle coordinates, the zip distributions, Docker, logging and choosing between the 3.x and 4.x lines.

  • Getting Started with the Tika Facade: The Tika facade’s one-liners for detection and extraction, and when to outgrow them.

Core concepts

Configuration and specialised parsing

  • Configuration: tika-config.json, TikaLoader, environment-variable secrets and migrating from the 3.x XML configuration.

  • PDF Parsing: PDFParser options, the 4.1 pages block, OCR strategies, encrypted PDFs and XFA.

  • OCR with Tesseract: Installing Tesseract, configuring the OCR parser and text recognizers, Tess4J and tuning.

  • VLM Parsers & Inference: Vision-language-model parsers, local model servers and the 4.1 inference engines for text and vectors.

  • Extending Tika: Custom parsers, detectors and MIME types, decorators, external parsers, OCR engines and metadata keys.

Running Tika

  • Tika App (Command Line & GUI): The tika-app options, the GUI, fork mode and pipes mode, with Bookshelf examples.

  • Tika Server (REST API): Every endpoint, presets, per-request configuration, backpressure, TLS, metrics and migrating from 3.x.

  • Tika gRPC: The gRPC server, its capability flags, TLS and a Java client.

  • Docker & Kubernetes Deployment: Choosing and pinning images, mounting configuration, Compose and Kubernetes sizing, probes and metrics.

  • Tika Pipes: Iterators, fetchers, emitters and reporters, parse modes, plugins and the Java API.

  • Robustness, Limits & Timeouts: Process isolation, every limit, the timeout model and testing failures with MockParser.

  • Security: The Tika security model, trust boundaries, external commands, XXE, credentials and the CVE history.

Integrations and workflows

Bibliography

The pages of this section are written against the sources listed here, verified on 2026-10-12 and 2026-10-13 against the versions stated in the version baseline above. Each page lists the subset it used under its own == References.

Apache Tika 4.1.x documentation

  • Apache Tika 4.1.x documentation home.

  • Using Tika: Java API, getting started, Pipes from Java, command line, server (with TLS and monitoring), gRPC and Docker.

  • Configuration, including detectors, encoding detectors, digesters, metadata filters, pages, inference and inference recipes, and the PDF, Tesseract, Tess4J, VLM, external and image parser pages.

  • Tika Pipes, including getting started, configuration, fetchers, emitters, iterators, reporters, parse modes, timeouts, performance, CPU sizing, shared-server mode, unpack configuration, troubleshooting and the plugin pages (with writing a plugin).

  • Advanced topics: robustness, setting limits, spooling, embedded documents, language detection, charset detection design, junk detection, ZIP detection, local VLM server and integration testing, all under the 4.1.x documentation.

  • Developers: custom OCR engine, metadata keys and serialization, under the 4.1.x documentation.

  • Migration to 4.x, including migrating to 4.x, migrating tika-server to 4.x, metadata changes, serialization changes, chunk strategies, inference handler requirements and the 4.x design notes.

  • Supported formats, FAQ and security.

Apache Tika security

Book

  • Chris A. Mattmann and Jukka L. Zitting, Tika in Action, Manning Publications, 2011 (©2012), ISBN 978-1-935182-85-6: Manning book page.