Skip to main content
In this lesson we’ll walk through Backstage TechDocs — the built-in documentation system that lets each catalog component expose and render documentation directly inside Backstage. You’ll learn the minimal configuration and repository layout required to enable TechDocs for a component, how Backstage builds and serves the docs, and recommendations for production deployments.
A screenshot of the Backstage catalog showing the "shopping-cart" service page with an About panel, tabs (Overview, CI/CD, API, Dependencies, Docs), and a warning about missing related entities. On the right is a relations graph linking the shopping-cart to auth-api and auth-service.
What is TechDocs?
  • TechDocs is a Backstage plugin (backend + frontend) that generates and displays static documentation for catalog entities.
  • It typically uses MkDocs (often with the mkdocs-material theme) to render Markdown into a static site that Backstage can serve or publish to object storage.
Overview — high-level steps Backstage backend: enable the TechDocs backend plugin Open your backend bootstrap (where backend plugins are wired) and confirm TechDocs backend is added. Example:
Repository integrations (example) Backstage typically stores Git host integrations in app-config.yaml. Use environment variables for secrets — never hardcode tokens.
TechDocs configuration in app-config.yaml Configure the TechDocs builder, generator, and publisher. For experimentation you can use local options; for production prefer CI-built artifacts and cloud storage.
TechDocs options at a glance Project repository layout Place MkDocs config and Markdown documentation alongside your code so documentation is versioned with the project. Example package.json (trimmed):
.gitignore (example):
MkDocs configuration Place mkdocs.yml (or mkdocs.yaml) at repo root. TechDocs commonly uses mkdocs-material.
If you store your docs in a non-default directory, set docs_dir:
Documentation content example Create Markdown under docs/. Example docs/index.md:
Catalog entity annotation Point Backstage to the repository location containing mkdocs.yml and the docs/ folder by adding the TechDocs annotation to catalog-info.yaml. Quote the annotation value to avoid YAML parsing issues.
  • 'backstage.io/techdocs-ref': 'dir:.' tells Backstage to read mkdocs.yml from the repository root and use the default docs/ folder.
  • To point to a subfolder, update the dir: path (for example 'dir:docs/subfolder') or set docs_dir in mkdocs.yml.
Build and publish behavior How the docs get built and served depends on your techdocs config:
  1. Backstage fetches the repository referenced by the catalog entity.
  2. The generator runs MkDocs (inside Docker or locally) to produce a static site.
  3. The publisher stores the generated site (local storage or cloud object storage) and the frontend serves it when you click “View TechDocs”.
Example developer workflow:
  1. Push repository changes (include catalog-info.yaml, mkdocs.yml, and docs/) to your Git host.
  2. Import or refresh the component in the Backstage catalog.
  3. Open the component page and click “View TechDocs” (or the Docs tab). Backstage will generate and display the documentation according to your configured builder/generator/publisher.
A screenshot of a Backstage documentation page titled "example-docs" showing a large heading "This is the documentation for my app!" with example h1–h6 headings. A dark left sidebar displays navigation items like Home, APIs, Docs, and Create.
Production considerations
For production, Backstage recommends generating TechDocs artifacts in CI and publishing the generated static site to cloud storage (Google Cloud Storage or AWS S3) instead of using the local publisher. This improves scalability, reduces on-demand build latency, and allows serving docs from highly-available object storage.
Best practices and tips
  • Never commit secrets or tokens to app-config.yaml. Use environment variables or secret management.
  • Prefer CI-based builds and cloud publishers (googleGcs or awsS3) for production workloads.
  • Use mkdocs-material for a polished default theme that integrates well with TechDocs.
  • If using generator runIn: docker, ensure your backend host can run Docker, or switch to CI-based generation for environments where Docker isn’t available.
Summary
  • TechDocs integrates MkDocs with Backstage to render component docs inside the catalog.
  • Enable the TechDocs backend plugin and configure builder/generator/publisher in app-config.yaml.
  • Add mkdocs.yml and a docs/ folder to your repository and annotate the entity with 'backstage.io/techdocs-ref'.
  • For production, build docs in CI and publish to cloud storage for scalability and faster page loads.
Links and references

Watch Video

Practice Lab