publish.obsidian.md/your-site-id. You can configure a custom domain or subdomain — for example, notes.mysite.com — so visitors reach your site at a URL you control.
A custom domain also unlocks features that require it:
- Custom JavaScript via
publish.js - Analytics
Option 1: Set up with Cloudflare
Cloudflare is the only officially supported provider for custom domains. This method handles SSL/TLS automatically.Add a CNAME record in Cloudflare
- In Cloudflare, open the domain where you want to host your site (e.g.,
mysite.com) — even if you want a subdomain likenotes.mysite.com. - Go to DNS and click Add Record.
- Set the type to CNAME.
- In Name, enter your domain or subdomain — for example,
notesfornotes.mysite.com, or@for the root domain. - In Target, enter
publish-main.obsidian.md. Do not include your site ID here. - Ensure Proxy status is enabled (orange cloud icon). It’s enabled by default.
Redirect www to your root domain
If you want bothmysite.com and www.mysite.com to point to Publish, create a Cloudflare Page Rule:
- URL match:
www.mysite.com/* - Setting: Forward URL — 301 Permanent Redirect
- Redirect URL:
https://mysite.com/$1
www.mysite.com pointing to publish-main.obsidian.md, the same as you did for the root.
Option 2: Set up with a reverse proxy
If you’re already running a web server or prefer not to use Cloudflare, you can proxy requests to Obsidian Publish. This also lets you host your Publish site under a subpath of an existing site (e.g.,mysite.com/my-notes/).
Proxy all requests under your chosen path to:
mysite.com/my-notes.
For Apache,
mod_rewrite must be enabled and you may need to configure SSLProxyEngine.If your proxy doesn’t support query path forwarding, use the x-obsidian-custom-domain HTTP header set to your site URL (e.g., mysite.com/my-subpath) when proxying to https://publish.obsidian.md/.Redirect from your old Publish URL
If you previously shared your site atpublish.obsidian.md/your-site-id and want visitors to be redirected to your custom domain, enable Redirect to your custom domain in your site’s custom domain settings.
Troubleshooting
Redirect loop
Redirect loop
This almost always means the Cloudflare SSL/TLS mode is set to Flexible instead of Full. Go to SSL/TLS in Cloudflare and change the encryption mode to Full.
Fonts, graph, or password access broken after switching to custom domain
Fonts, graph, or password access broken after switching to custom domain
After switching from your
publish.obsidian.md URL to a custom domain, clear your browser cache. Modern browsers apply cross-domain security restrictions that can affect cached assets. Visitors who access your site exclusively through the custom domain will not encounter this issue.Custom domain not working with other DNS providers
Custom domain not working with other DNS providers
Cloudflare is the only officially supported provider for custom domains. Configurations with other DNS providers are not supported and may not work.