Cloud Computing, DevOps

3 Mins Read

Automated Documentation Sites with Backstage TechDocs

Voiced by Amazon Polly

Overview

Backstage TechDocs enables engineering teams to maintain documentation alongside their code in the same repository. Instead of managing separate documentation platforms, TechDocs automatically converts Markdown into a fully browsable documentation site.

Pioneers in Cloud Consulting & Migration Services

  • Reduced infrastructural costs
  • Accelerated application deployment
Get Started

TechDocs

TechDocs is Backstage’s built-in documentation solution, following a “Docs-as-Code” model. All Markdown files live inside your service’s Git repository (either in the repo root or a docs/ folder). When a user opens the Documentation tab for an entity, Backstage fetches and renders those docs.

Although TechDocs uses MkDocs behind the scenes to generate a static HTML site, Backstage adds additional layers such as preparing content, storing generated files, and rendering them safely inside the UI.

TechDocs Pipeline

TechDocs works through three major stages:

  1. Prepare Stage

This step retrieves the raw Markdown files (.md) and configuration (mkdocs.yml) from the Git repository.

  • TechDocs identifies documentation source using the annotation:

backstage.io/techdocs-ref: dir:.

  • It fetches the directory from GitHub/GitLab/Bitbucket/local Git.
  • Only documentation source files are collected.
  1. Generate Stage

In this stage, TechDocs converts Markdown into a static HTML website.

Internally, this uses:

  • MkDocs
  • mkdocs-techdocs-core plugin (adds TechDocs integrations)
  • A generator environment (local binary or Docker)

The output of this step:

  • html
  • json
  • json
  • /assets folder containing CSS, JS, images
  1. Publish Stage

The generated HTML is uploaded to a storage backend, allowing Backstage to serve it.

Supported publishers:

  • Local filesystem
  • Amazon S3
  • Google Cloud Storage
  • Azure Blob Storage
  • Once published, Backstage serves the HTML directly from the storage backend, it doesn’t rebuild the docs unless necessary.

Two Ways to Build Documentation

  1. Local Builder (Backstage Builds Everything)

Backstage performs:

  • Prepare → fetch Markdown from repo
  • Generate → run MkDocs locally or in Docker
  • Publish → store output on disk or a bucket

Example configuration:

Notes:

  • builder: local = Backstage handles prepare + generate + publish
  • runIn: docker ensures builds use a consistent environment
  • Backstage must have write access to the publishDirectory

This approach works for small installations or demos, but becomes slow for large orgs.

2. External / CI-Based Builder (Recommended for Production)

In this model, Backstage does not generate docs.
Instead, your CI/CD pipeline performs the Generate + Publish stages.

Workflow:

  1. Developer pushes changes to Markdown
  2. CI pipeline detects doc changes
  3. CI installs TechDocs CLI + MkDocs
  4. CI builds the HTML site
  5. CI publishes to S3/GCS/Blob Storage
  6. Backstage only reads the published HTML

Backstage Configuration:

When to use CI-based builds:

  • Multiple teams
  • Large documentation sites
  • When the Backstage backend must stay lightweight
  • For consistent builds across environments

Repository Requirements

Every service needs two files for TechDocs to work:

  1. yml

Defines:

  • site name
  • navigation
  • plugins
  • theme

Example:

2. catalog-info.yaml

Registers the service in Backstage.

Example:

techdocs-ref tells Backstage where Markdown lives.

Storage

Documentation files are stored like:

Backstage leverages:

  • publisher caching
  • CDN caching
  • browser caching – to deliver fast documentation loading times.

Security in TechDocs

TechDocs implements several security layers:

  • Sanitizes HTML to remove dangerous scripts
  • Renders documentation in an isolated iframe
  • Uses IAM roles and restricted storage permissions
  • Prevents documentation authors from breaking the UI

Extending TechDocs

You can customize multiple parts:

  • MkDocs plugins (Material theme extensions)
  • CI pipelines with custom Docker images
  • Custom publishers for on‑prem storage
  • Custom Backstage layouts or homepage sections

What Happens When You Update Your Documentation?

  1. A change is made to .md files
  2. CI rebuilds docs (or Backstage does if using local builder)
  3. The new HTML overwrites the old version in the bucket
  4. Backstage instantly serves updated docs on next page load

No restarts, redeploys, or manual steps are needed.

Conclusion

TechDocs simplifies the production, storage, and viewing of documentation in Backstage.

With a clear three-stage pipeline and flexible build options, TechDocs fits everything from small teams to enterprise-scale developer portals.

Drop a query if you have any questions regarding TechDocs and we will get back to you quickly.

Making IT Networks Enterprise-ready – Cloud Management Services

  • Accelerated cloud migration
  • End-to-end view of the cloud environment
Get Started

About CloudThat

CloudThat is an award-winning company and the first in India to offer cloud training and consulting services worldwide. As a Microsoft Solutions Partner, AWS Advanced Tier Training Partner, and Google Cloud Platform Partner, CloudThat has empowered over 850,000 professionals through 600+ cloud certifications winning global recognition for its training excellence including 20 MCT Trainers in Microsoft’s Global Top 100 and an impressive 12 awards in the last 8 years. CloudThat specializes in Cloud Migration, Data Platforms, DevOps, IoT, and cutting-edge technologies like Gen AI & AI/ML. It has delivered over 500 consulting projects for 250+ organizations in 30+ countries as it continues to empower professionals and enterprises to thrive in the digital-first world.

FAQs

1. Should I restart/redeploy Backstage after I have updated my documentation?

ANS: – No, Backstage serves the most recent version of the documentation at the first page load, so there is no need to restart/re-deploy back-stage.

2. What method of building Tech Docs is best for production setups?

ANS: – Using the CI-based (external) builder for production is best practice as it allows Backstage to remain lightweight and ensures consistency with scalable documentation builds.

WRITTEN BY Anirudh Singh

Anirudh works as a DevOps Engineer at CloudThat. He specializes in building scalable, automated, and secure cloud infrastructure solutions. With hands-on experience in tools like Terraform, Kubernetes, Jenkins, and AWS services, he plays a key role in streamlining CI/CD pipelines and improving deployment efficiency. Anirudh is passionate about infrastructure as code, cloud-native architectures, and automation best practices. In his free time, he explores new trends and enjoys optimizing workflows to enhance system reliability and performance.

Share

Comments

    Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!