A D2 homelab map redraws itself on every Git push—and its creator now uses the workflow at work

D2, homelab, diagram-as-code

This is the read-only HTML version. For the full Visual Space experience, open the app.

Network map, infrastructure —

Network map, infrastructure —

Credit: mortennordbye r/selfhosted

GitHub Actions, documentation

A text file, a GitHub Action and icons fetched at render time keep this sprawling infrastructure map easy to republish. Its creator has shared a guide after adopting the same approach for client platforms. The important distinction: automatically rendering a diagram doesn’t automatically verify what’s running.

❤️ 1

Reddit user mortennordbye keeps a homelab architecture map in the same repository as the infrastructure it describes, then lets a GitHub Action handle rendering it. In a November 13, 2026 post on r/selfhosted, the platform engineer said the workflow had become a frequently used tool both at home and when drawing client platforms at work. That regular use prompted a new guide for others who want to try it.

The useful idea isn’t the size of the homelab. It’s making the diagram another output of the repository, rather than a separate document that needs its own export-and-upload routine.

A text file becomes the published map

According to mortennordbye, the diagram lives as a .d2 text file in the homelab repository. A GitHub Action renders it on every push and commits the resulting image back to the repo. Icons are fetched at render time, so there’s no local collection of image files to maintain.

That gives the workflow a small, understandable chain: diagram text goes in, an updated image comes out, and both live in Git. Fetching the icons also removes one category of repository housekeeping, although it makes those remote assets part of the rendering process.

The creator’s diagram-as-code guide is the supplied starting point for adopting the approach.

The map separates traffic from deployment

The shared image shows much more than a list of servers. Across its upper portion, GitHub, a container registry and a secrets manager feed a grouped GitOps-and-configuration section. Alongside that, an Internet connection passes through Cloudflare toward the network edge. Those paths converge farther down around ingress and cluster networking.

Below are separate groups for observability, personal applications, media services and AI, followed by databases, storage, backups and physical hosts. Labels on the connecting lines identify relationships such as secrets, SQL, media storage and critical alerts.

That grouping is worth borrowing even for a smaller setup: it helps distinguish how software gets deployed from how requests and data move through the system. The icons make individual services recognizable; the boxes and labeled connections explain their roles.

Rendering is automatic; accuracy still needs an input

Mortennordbye describes the setup as preventing drift from what actually runs. There’s an important limit to that claim: rendering keeps the image aligned with the D2 file, not necessarily with the live infrastructure.

Other builders asked whether the D2 is written by hand or partly generated from Compose or Kubernetes files, and whether anything flags services moved outside the repository. Those questions remain unanswered in the supplied discussion. Generating diagram content from configuration was a suggestion, not a reported feature.

The workflow still removes a useful piece of friction: publishing the picture no longer requires a separate manual step. For anyone adopting it, the next decision is who—or what—updates the diagram’s description when the infrastructure changes. Automating the render handles publication; keeping that input accurate is what makes the map dependable.

Written by the Visual Space team.

Source: I posted my diagram-as-code homelab map a while back. I use it so much at home and at work now that I wrote proper docs for it

Software Hub

1 Follower

Discover software worth understanding and discuss how it works in practice. Share useful tools, releases and workflows, compare alternatives with clear criteria, and help others choose and use software for the work they actually need to do.

Visual Space is built for projects like this—where creators collaborate, organize goals, and grow communities around real work.