notes.domain.com - Initial Deployment

Date: 2026-06-02

Goal

Create a public read-only knowledge base based on Obsidian notes.

Target architecture:

Obsidian Notes

Quartz

Nginx

notes.domain.com

Initial Environment

Server:

Host: ubuntu-4gb-nbg1-1
Provider: Hetzner
OS: Ubuntu 24.04 LTS

Domain:

notes.domain.com

DNS:

notes.domain.com
    → 123.124.125.126

Existing infrastructure:

Nginx
Let's Encrypt
code-server
ttyd
lab.domain.com

Create Quartz Project

Create project directory:

sudo mkdir -p /srv/lab/projects
sudo chown -R terri:lab /srv/lab/projects
 
cd /srv/lab/projects

Clone Quartz:

git clone https://github.com/jackyzha0/quartz.git notes-site
 
cd notes-site

Install dependencies:

npm install

Initialize Quartz

Run:

npx quartz create

Selected options:

Template:
    Obsidian
 
Content Initialization:
    Empty Quartz
 
Base URL:
    notes.domain.com

Result:

Quartz configuration created
content/
quartz.config.ts
quartz.layout.ts

Build Site

Build static website:

npx quartz build

Output generated:

public/

Verify:

ls -la public

Expected:

index.html
404.html
sitemap.xml
static/
...

Configure Nginx

Create site:

sudo vim /etc/nginx/sites-available/notes.domain.com

Configuration:

server {
    listen 80;
    listen [::]:80;
 
    server_name notes.domain.com;
 
    root /srv/lab/projects/notes-site/public;
    index index.html;
 
    location / {
        try_files $uri $uri/ =404;
    }
}

Enable site:

sudo ln -s \
    /etc/nginx/sites-available/notes.domain.com \
    /etc/nginx/sites-enabled/

Validate:

sudo nginx -t

Reload:

sudo systemctl reload nginx

Fix Permission Issue

Initial test:

curl -I http://notes.domain.com

Result:

404 Not Found

Investigation:

namei -l /srv/lab/projects/notes-site/public/index.html

Found:

/srv/lab

was not traversable by nginx user.

Directory:

drwxrws--- terri lab /srv/lab

Solution:

Add nginx user to lab group:

sudo usermod -aG lab www-data
sudo systemctl restart nginx

Retest:

curl -I http://notes.domain.com

Result:

HTTP/1.1 200 OK

Configure HTTPS

Issue certificate:

sudo certbot --nginx -d notes.domain.com

Enable redirect:

HTTP → HTTPS

Verification:

curl -I https://notes.domain.com

Result:

HTTP 200 OK

First Published Note

Edit:

cd /srv/lab/projects/notes-site/content
vim index.md

Example:

# Welcome to Tri's common place book
 
This is a page to record knowledge and tools which I use during work.
 
It is also a common place book which I can access everywhere.
 
Created on 2026-06-02.

Rebuild:

cd /srv/lab/projects/notes-site
 
npx quartz build

Refresh browser.

Result:

https://notes.domain.com

successfully displays custom content.


Final State

Infrastructure:

notes.domain.com

Nginx

Quartz static files

/srv/lab/projects/notes-site/public

Project location:

/srv/lab/projects/notes-site

Publish workflow:

Edit content/*

npx quartz build

Refresh browser

Lessons Learned

  1. Quartz setup is straightforward once Node.js is available.

  2. Nginx may return 404 due to filesystem traversal permissions, even when configuration is correct.

  3. Group permissions on /srv/lab matter because nginx runs as www-data.

  4. Build output is static files only; no application server is required.

  5. Publishing new notes currently requires only:

npx quartz build

Future Work

Repository

Create personal repository:

github.com/domain/notes-site

Current repository still points to Quartz upstream.


Publishing Workflow

Investigate:

ExternBrain

Selected Notes

Quartz Content

Build

Automation

Potential future workflow:

git pull
npx quartz build

or

git push

CI/CD

Auto-build

Labserver Improvements

Pending:

Copy/Paste issue in ttyd + Zellij
Persistent Zellij workspace
Project organization
Workspace automation
Backups