May 7, 2025

Self managed NIP-05 via GitHub Pages with Custom Domain

Self managed NIP‐05 via GitHub Pages with Custom Domain

✅ Requirements

  • GitHub account
  • Own domain (e.g., yourdomain.com)
  • Public Nostr key in hex format (not npub!)
  • Basic DNS configuration knowledge

🛒 1. Register a Domain

Register a domain from a provider like orangewebsite, njal.la, or similar.


🌐 2. Configure DNS Records for GitHub Pages

Set the following A records for your domain (via your DNS provider):

TypeHostValueTTLPriority
A@ (or blank)185.199.108.153300
A@ (or blank)185.199.109.153300
A@ (or blank)185.199.110.153300
A@ (or blank)185.199.111.153300

Optional:
Add a CNAME record for wwwyourusername.github.io


📁 3. Create a GitHub Repository

  1. Go to github.com/new
  2. Repository name: e.g., nip5
  3. Check "Add a README"
  4. Click "Create repository"

🏗️ 4. Create Directory & File

a) .well-known/nostr.json

Path: .well-known/nostr.json

Put you nostrhandle (nostrname) and your nostr public key in the file. Example content:

{
  "names": {
    "petermuster": "ldajflasjföldsjflj..."
  }
}

IMPORTANT: Use your hex-encoded Nostr public key, not the npub1... format.

b) _config.yml in Root

Create a file named _config.yml with this content:

include: [".well-known"]

This ensures GitHub includes the .well-known folder in the build output.


⚙️ 5. Configure GitHub Pages

  1. Go to Settings > Pages inside your repository
  2. Under "Build and Deployment":
    • Choose: Deploy from branch
    • Branch: main or master
  3. Under Custom domain:
    • Enter yourdomain.com
    • Ignore any warning
  4. Enable ✅ Enforce HTTPS

It may take a few minutes for the certificate to be issued.

image


🔍 6. Configure Nostr Client

Open your Nostr client and set the NIP-05 identifier as:

nostrName@yourdomain.com  e.g. petermuster@yourdomain.tech

Save – done!


✅ Test

In your browser or via curl:

curl https://yourdomain.com/.well-known/nostr.json?name=petermuster

Expected output:

{
  "names": {
    "Nostr Benutzer": "elkajdlkajslfkjaödlkfjs..."
  }
}

🛡️ Privacy Tips

ItemRecommendation
Public key is visibleUse pseudonyms only
Register a KYC-free domaine.g., orangewebsite, njal.la
Use KYC-free email for GitHube.g., ProtonMail
GitHub repository visibilityMust be public for GitHub Pages
Commit metadataUse a separate pseudonymous user
Avoid trackingDon’t include analytics scripts