A self-hosting alternative to Vercel/Netlify for notes published with the Obsidian Digital Garden plugin. The plugin lets you publish notes from Obsidian to a GitHub repository as a static site; this container clones that repository, builds it with Eleventy, and serves it with Nginx — automatically rebuilding whenever you push new notes.
- Automated Setup: Clones and builds your Digital Garden on startup.
- Nginx Powered: High-performance serving of static content.
- GitHub Webhooks: Automatically pulls and rebuilds your site when you push to GitHub.
- Lightweight: Based on Alpine Linux.
- Self-Healing: Docker Compose configured to restart automatically.
- A GitHub repository containing your Digital Garden source with the plugin setup in Obsidian (see the Digital Garden plugin docs).
- A GitHub Personal Access Token (PAT) with
reposcope (you can use the same one you supply to the Digital Garden plugin) - Docker and Docker Compose installed on a server that supports containerization.
- This repo cloned onto the server you plan to use.
Create a .env file in the same directory as docker-compose.yml with the following variables:
GITHUB_USERNAME=your-github-username
GITHUB_REPO=your-garden-repo-name
GITHUB_PAT=your-github-personal-access-token
WEBHOOK_SECRET=a-secure-random-secretYou should generate a long random password to use as the secret using eg. this tool (or any other password generator). I recommend using at least 64 characters.
Run the following command to build and start the container:
docker compose up -dOnce the container is running, you need to configure the webhook in GitHub for automatic updates:
- Go to your repository on GitHub.
- Navigate to Settings > Webhooks.
- Click Add webhook.
- Payload URL:
http://your-server-ip/webhook - Content type:
application/json - Secret: The value you set for
WEBHOOK_SECRET. - Events: Select "Just the push event."
- Click Add webhook.
You can check the logs to see the build progress and webhook status:
docker compose logs -fThe container runs a small Node.js manager script that:
- Clones your repository using the PAT.
- Runs
npm installandnpm run build. - Copies the generated static files to the Nginx web root.
- Starts Nginx.
- Listens for incoming GitHub push webhooks to trigger a rebuild.
Very important: Your GITHUB_PAT is used to clone the repository. If you are reusing your token that you use for the Digital Garden plugin, it will have read and write access to your content. Ensure your .env file is kept secure and not committed to any public repositories.