I use Obsidian to document my home lab and self-hosted services, here's how

2 weeks ago 3

When you start your self-hosting journey, it's not too difficult to keep track of everything. After all, you probably only have a single server with a few services; nothing too crazy. However, as my home lab has grown, I've simply found it too unwieldy to keep track of everything by myself. I've experimented with a few different self-hosted tools to try and keep on top of all of it, but in the end, I went back to Obsidian to track everything.

Obsidian isn't just a note-taker, which is why it's perfect for this project. With an incredible array of plugins and tools available, you can turn what would otherwise be a collection of notes into a full-on database. I use a combination of core plugins like Properties and Backlinks alongside community plugins like Dataview, Excalidraw, and Advanced Tables to keep on top of my servers and self-hosted services, and it's worked perfectly for my needs.

It has a bit of a curve to get started, mainly because you'll be manually importing everything by hand, but I'll walk you through my setup and how I make it easier on myself as well.

set up a local wiki for projects using Obsidian

Related

Setting out a structure

Templates and folders

For this demonstration, I've copied out some of my real documentation from my home lab to demonstrate how I organize my folders. I structure my home lab's documentation as follows:

  • 0 - Meta
    • Templates
  • 1 - Hardware
    • Network devices
    • Servers
  • 2 - Services
  • 3 - Automation
  • 4 - Incidents
  • 5 - Notes
  • 6 - Design

Templates are what you'd expect; I have templates for my servers, network devices, incidents, and services. These define a general layout that every subsequent note should follow, complete with property fields, names, last update dates, and more. My properties field, at the top of each note, looks like this:

---
type: server
hostname: "{{title}}"
role:
os:
ip:
mac:
cpu:
ram_gb:
disk_tb:
rack_u:
location: "{{location}}"
production: false
last_update: ""
tags:
- server
---

This structure allows me to create Dataview queries that look at an entire folder, and I can use the property fields to populate tables with information about each item. For example, one Dataview query I use is:

```dataview
TABLE WITHOUT ID
file.link AS "File",
hostname AS "Host",
ip AS "IP",
os AS "OS",
last_update AS "Last updated"

from "1 - Hardware/Servers"
where type = "server"
sort hostname
```

The above will create a table without an ID (as otherwise, file.link would double up with it), and it will show the host, IP, OS, and when it was last updated. It pulls from "1 - Hardware/Servers" where the type is equal to servers, then sorts alphabetically by hostname.

You don't need to organize it exactly like this, but something like it makes it easier. Automation is mostly populated by my most important Home Assistant automations, though my actual vault also contains information about the automatic updating of my OPNsense IP lists and my Backblaze B2 backups.

Obsidian Home Lab documentation incident template

"Incidents" is a bit of an overdramatic term and better suited to an actual service provider, but the point is that I can use it to document problems. For example, if I experience a server crash, I can save the log and the details of what was happening, and then in the future, if the server crashes again, I can compare it to a previous crash on the same server or service and see if it's the same. I use an "affected" property that links to the affected service or server, so that I can even make a Dataview query to show all of the incidents affecting a service. My home lab is still small enough scale that this isn't really necessary, though.

However, something that is useful is the ability to show all of my pending tasks on my servers and services. I've created a basic Dataview query that can pull all of the unchecked items in each server and service note. It looks like this:

```dataview
TABLE WITHOUT ID
file.link AS "File",
t.text AS "Task"

FROM "1 - Hardware" OR "2 - Services"
FLATTEN file.tasks AS t
WHERE !t.completed
SORT name, t.text
```

This will show me a table of the file and the task to be completed, so that I can click the file, go to the service details, and easily see what details I need to connect to it. I can add a bunch of tasks affecting different services, and then list them all in a table for action on my dashboard. These are dynamically created as well, so they are removed or replenished depending on what happens in the note.

Finally, Notes and Design are more "meta" descriptions that I don't typically use a whole amount, but are good to have. Notes holds my Obsidian daily notes when I do create them, and could serve as a changelog of sorts if I was bothered doing that, and Design is for my Excalidraw diagrams that I have of my home network.

Creating notes

Working from our templates

obsidian-home-lab-insert-template

Now, to use our template, we'll create a regular note in the correct folder. For example, if we're going to create a new server called PVE3, we'll create a new item under the Servers folder called "PVE3". Then, on the left, we'll click "Insert template" and choose our server template. This will then fill the rest of the template, replacing the {{title}} variables with the actual title of the note. I have not defined {{ip}}, {{location}}, or {{mac}} yet, as I am in the process of switching to Templater, which will allow me to raise prompts that request those details before creating the note.

Obsidian is an incredibly powerful tool, and I've slowly come to grips with it over the last half a year or so. Templates are particularly useful, and with them, I can create a standard notation that my notes can all be derived from. There's no manual copying and pasting, nor is there any risk of disorganization in the notes structure. They're all treated the same and look the same; they're just filled with the right values. That's also why I want to configure the Templater plugin, as it allows me to insert snippets for even more control and automation.

If you have an unwieldy home lab with countless self-hosted services and tools, I highly recommend giving Obsidian a try for documenting it. I've tried tools like NetBox and HomeBox, but I found them too over-the-top for my liking. Obsidian is simple, I can synchronize my notes anywhere, and it's in good old Markdown right alongside my other notes, too.

A comparison between Obsidian and Notion

Related

Read Entire Article