This guide covers setting up a Quartz v5 repository on GitHub, configuring GitHub Pages for automatic deployment, and connecting Quartz Syncer.
Create a Quartz Repository
If you haven’t set up a Quartz repository on GitHub yet, click here to create one using the official Quartz template. Make sure to check Include all branches so the v5 branch is included.
Set v5 as the Default Branch
The upstream Quartz repository currently defaults to v4. Change your repository’s default branch to v5:
- Go to your repository on GitHub.
- Navigate to Settings > General.
- Under Default branch, click the switch icon next to the current default branch.
- Select
v5from the dropdown and click Update. - Confirm the change.
This ensures new clones, pull requests, and GitHub Pages deployments all target v5.
Quartz v5 is in beta
Quartz v5 is currently in beta and not yet the default upstream branch. Once v5 leaves beta it will become the default, and this step will no longer be necessary. See the upstream migration guide if you are migrating existing content from v4.
Clone and Install
Clone your repository and install dependencies:
git clone https://github.com/<username>/<repository>.git
cd <repository>
git checkout v5
npm ciTo pull future Quartz updates, add the upstream repository as a remote:
git remote add upstream https://github.com/jackyzha0/quartz.gitRun the Setup Wizard
Quartz v5 uses an interactive setup command to create quartz.config.yaml and install all required plugins:
npx quartz createPick a template (default, obsidian, ttrpg, or blog), set your base URL (e.g. <username>.github.io/<repository>), and choose a content strategy. The obsidian template is recommended when publishing from an Obsidian vault.
Commit the generated quartz.config.yaml and quartz.lock.json:
git add quartz.config.yaml quartz.lock.json
git commit -m "Initial Quartz v5 setup"
git pushConfigure GitHub Pages
Enable GitHub Pages
- Go to your repository on GitHub.
- Navigate to Settings > Pages.
- Under Source, select GitHub Actions.
Add the Deploy Workflow
Create a new file .github/workflows/deploy.yml in your repository with the following content:
name: Deploy Quartz site to GitHub Pages
on:
push:
branches:
- v5
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # Fetch all history for git info
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Cache dependencies
uses: actions/cache@v5
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Cache Quartz plugins
uses: actions/cache@v5
with:
path: .quartz/plugins
key: ${{ runner.os }}-plugins-${{ hashFiles('quartz.lock.json') }}
restore-keys: |
${{ runner.os }}-plugins-
- name: Install Dependencies
run: npm ci
- name: Install Quartz plugins
run: npx quartz plugin install
- name: Build Quartz
run: npx quartz build
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: public
deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4Plugin install is mandatory in v5
Quartz v5 downloads community plugins into
.quartz/plugins/at build time. Thenpx quartz plugin installstep must run beforenpx quartz build, otherwise the build will fail. The.quartz/pluginscache above keys onquartz.lock.jsonso plugins are only re-downloaded when you change your configuration.
Your site will be deployed to <username>.github.io/<repository-name>.
Generate an Access Token
Token Expiration
Fine-grained tokens expire after the specified date, with a maximum of one year. GitHub will email you when your token is about to expire.
Fine-grained Access Token (Recommended)
- Go to GitHub’s Personal Access Token page.
- Set a Token name (e.g.,
Quartz Syncer). - Set an Expiration date.
- Under Repository access, select Only select repositories and choose your Quartz repository.
- Under Permissions > Repository permissions, set Contents to Read and write.
- Click Generate token.
- Copy the token immediately.
Classic Access Token
Classic tokens have access to all your repositories. Use fine-grained tokens when possible.
- Go to GitHub’s Classic Token page.
- Add a Note and click Generate token.
- Copy the token immediately.
Configure Quartz Syncer
- Open Obsidian and go to Settings > Community Plugins > Quartz Syncer.
- In the Git settings tab:
- Remote URL:
https://github.com/<username>/<repository>.git - Branch:
v5 - Provider: GitHub
- Authentication Type: Username & Token/Password
- Username: Your GitHub username
- Access Token: The token you generated
- Remote URL:
A green checkmark indicates a successful connection.
Custom Domain (Optional)
- In your repository, go to Settings > Pages.
- Under Custom domain, enter your domain and click Save.
- Configure your DNS:
- Apex domain (
example.com): CreateArecords pointing to:185.199.108.153185.199.109.153185.199.110.153185.199.111.153
- Subdomain (
docs.example.com): Create aCNAMErecord pointing to<username>.github.io.
- Apex domain (
Don’t forget to update baseUrl in quartz.config.yaml to match your custom domain.