Web push notifications for Ghost blogs
Ghost is built around email newsletters, but many readers would rather get a quick browser notification. On self-hosted Ghost, adding push takes ten minutes. On Ghost(Pro), the root-file rule makes it harder — here’s the honest picture.
- Add the snippet in Ghost Admin → Settings → Code injection → Site header.
- Self-hosted Ghost: serve /sw.js with a small nginx location block.
- Ghost(Pro) doesn’t let you add root files, and Ghost says other CDNs in front aren’t supported — so standard web push isn’t a clean fit there.
- Pusharoo’s RSS-to-push can announce each new post from Ghost’s /rss/ feed.
1. The snippet via Code injection
In Ghost Admin open Settings → Code injection and paste the snippet into Site header. It loads on every page without editing your theme:
<script src="https://pusharoo.com/sdk/pusharoo.js" data-site="pk_your_site_key" async></script>2. Self-hosted: serve /sw.js with nginx
Every web push service has the same requirement: browsers only deliver push to a service worker served from your domain, and Pusharoo registers its worker with scope /, so https://yoursite.com/sw.js must open as JavaScript. Platforms where you control the web root make this a one-minute job; hosted platforms that don’t let you place a root file need a workaround or won’t work.
Ghost themes can’t publish arbitrary files at the root, but a Ghost-CLI install sits behind nginx, which can. Save sw.js somewhere outside the theme (for example /var/www/ghost/push/sw.js) and add a location to your site’s nginx config (Ghost-CLI writes it under /etc/nginx/sites-available/, including the -ssl.conf file):
location = /sw.js {
alias /var/www/ghost/push/sw.js;
default_type application/javascript;
add_header Cache-Control "no-store, max-age=0";
add_header Service-Worker-Allowed "/";
}Test with sudo nginx -t, reload nginx, and open https://yourblog.com/sw.js. Ghost upgrades don’t touch this file because it’s outside the Ghost install.
Ghost(Pro): the honest answer
Ghost(Pro) is fully managed: you can inject code, but you can’t place a file at /sw.js. Ghost’s help centre states that using other CDNs on top of Ghost(Pro) infrastructure isn’t supported, and its Cloudflare guide asks for DNS-only records — so the Cloudflare Worker route we suggest for Shopify isn’t a supported option. Your realistic choices are:
- Self-host Ghost (or use a host that gives you nginx access).
- Collect push subscribers on another site you control — a main website that links to the blog — and let RSS-to-push announce posts.
- Rely on Ghost’s built-in email newsletter for now.
We’d rather say this than sell you an install that breaks on certificate renewal.
3. Announce every new post
Ghost publishes a feed at /rss/. Add it in Pusharoo under Integrations → Add a feed: the post title becomes the notification title, the excerpt the message and the feature image the large image. Choose “drafts” if you want to review each one, or automatic sending for a hands-off blog. Only posts published after you add the feed are sent, at most one per check.
Ghost members and push
Ghost’s membership system knows who your members are by email; web push doesn’t. To send push only to paid members, tag subscribers on a members-only page (Pusharoo.tag('member', 'paid')) — Ghost themes expose @member in Handlebars, so you can output the tag call only when @member.paid is true — and target that tag.
Push and email together
| Ghost newsletter | Web push | |
|---|---|---|
| Signup | Email address | One tap, no address |
| Best for | Long reads, weekly issues | New post alerts, breaking updates |
| Reach | Inbox, any device | Subscribed browsers; iPhone via Home Screen |
Offer both: push for “new post is live”, email for the full weekly issue (push vs. email).
Questions
Can I add push notifications to Ghost(Pro)?
Not with a standard web push install: Ghost(Pro) doesn’t allow root files like /sw.js and doesn’t support CDNs in front. Self-hosted Ghost works well.
Will Ghost updates break the setup?
No. The snippet lives in Code injection and sw.js is served by nginx outside the Ghost folder.
Can new Ghost posts send notifications automatically?
Yes — add your /rss/ feed to Pusharoo’s RSS-to-push, either automatic or as drafts.
Can I use Ghost’s native newsletter and push together?
Yes. Email newsletters stay in Ghost; push just adds an alert channel for readers who prefer it.
Does code injection work on Ghost(Pro) for the snippet?
Yes, the snippet works through Code Injection. The hurdle is the root /sw.js file, not the script.
Keep reading
Push notifications for publishers and blogs
What to push, breaking news vs. digests, frequency, segments and growing loyal returning readers.
Web push vs. email: which to use, and when
A side-by-side comparison of signup friction, reach, message length, cost and the jobs each channel does best.
Web push for WordPress and WooCommerce
Upload sw.js, paste one line, exclude it from caching. Works with WooCommerce too.
Web push notifications for Drupal
sw.js in the docroot (often web/), an external theme library with async, Asset Injector, caching and RSS.
More in Platforms: Web push on Shopify: what works, honestly · WooCommerce push notifications: setup and playbook · Magento 2 push notifications · Web push on Wix, Squarespace and Webflow · Web push notifications on BigCommerce · Web push notifications for PrestaShop · Web push notifications for Joomla · All guides
Free for life. No limits.
Unlimited subscribers, campaigns and automations. No badges. About five minutes to install.