|
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
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:
- 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.
- 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
- 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
- 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:
|
1 2 3 4 5 6 7 8 9 |
techdocs: builder: local generator: runIn: docker dockerImage: spotify/techdocs publisher: type: local local: publishDirectory: /var/backstage/techdocs |
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:
- Developer pushes changes to Markdown
- CI pipeline detects doc changes
- CI installs TechDocs CLI + MkDocs
- CI builds the HTML site
- CI publishes to S3/GCS/Blob Storage
- Backstage only reads the published HTML
Backstage Configuration:
|
1 2 3 4 5 6 7 |
techdocs: builder: external publisher: type: awsS3 awsS3: bucketName: $TECHDOCS_BUCKET region: us-east-1 |
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:
- yml
Defines:
- site name
- navigation
- plugins
- theme
Example:
|
1 2 3 4 5 |
site_name: 'shopping-cart-docs' nav: - Home: index.md plugins: - techdocs-core |
2. catalog-info.yaml
Registers the service in Backstage.
Example:
|
1 2 3 4 5 6 7 8 9 |
apiVersion: backstage.io/v1beta1 kind: Component metadata: name: shopping-cart annotations: backstage.io/techdocs-ref: dir:. spec: type: service owner: shopping-team |
techdocs-ref tells Backstage where Markdown lives.
Storage
Documentation files are stored like:
|
1 2 3 4 5 |
/default/component/service-name/ index.html navigation.json search_index.json assets/ |
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?
- A change is made to .md files
- CI rebuilds docs (or Backstage does if using local builder)
- The new HTML overwrites the old version in the bucket
- 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
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.
Login

December 22, 2025
PREV
Comments