Chapters
  1. Overview
  2. Installation
  3. Presets
  4. Post types, series and code
  5. Custom settings
  6. Members and comments
  7. Navigation
  8. Translations
  9. Demo content
  10. Customising
  11. Self-hosting
  12. Troubleshooting
  13. Changelog

Self-hosting

Logbuch loads nothing from other servers. Ghost does, and here is how to serve its tools yourself.

Logbuch loads nothing from other servers. Its fonts, icons and scripts are part of the theme and come from your own site, and so does the code highlighting. It sets no cookie. Ghost is different. Out of the box it loads some of its own tools from public servers, and a theme can't change that. If you run Ghost on your own server, you can serve them yourself. Checked against Ghost 6.75.0.

What Logbuch stores in the reader's browser

Logbuch keeps three choices in the reader's browser, each one only after the reader makes it. Nothing of it is sent to your site or anywhere else.

WhatWhereNameHow long
Light or dark, when the reader switches itsession storageniched-color-schemeuntil the tab closes
The chosen tab of a code example, such as pnpm or npmsession storagelogbuch-code-tabuntil the tab closes
The chapters read in a serieslocal storagelogbuch-series-progressuntil the reader unticks the box

Series progress is off until the reader ticks "Remember the chapters I have read" in a series. Before that, nothing is stored. Unticking it deletes what was stored, and so does clearing the browser's data for your site. If your privacy policy lists what your site keeps in the browser, these are the three entries.

What Ghost loads by default

WhatFromWhen
Portal, the sign-up windowcdn.jsdelivr.netmembers, donations or recommendations are on
Searchcdn.jsdelivr.netalways
Commentscdn.jsdelivr.netcomments are on and a reader scrolls near the end of a post
Announcement barcdn.jsdelivr.netan announcement is set
Admin toolbarcdn.jsdelivr.netonly for signed-in staff
Stripejs.stripe.compaid memberships are on
Fonts from Brand → Typographyfonts.bunny.netyou picked a font there (Fonts)
Profile images of membersgravatar.coma member is signed in

On Ghost(Pro) you can't change Ghost's configuration, so this list applies as it is. On your own server you can move almost all of it.

Turn off Gravatar

For a signed-in member, Ghost asks gravatar.com for a profile picture, using a code made from the member's e-mail address. Turn that off in Ghost's config.production.json:

"privacy": {
  "useGravatar": false
}

Use useGravatar and not useTinfoil. The second switch also removes the structured data that search engines read from your posts.

Serve Portal, Search and Comments yourself

Ghost can load its tools from any address you give it. I test Logbuch with Portal, Search, Comments and the announcement bar served this way.

1. Find the versions your Ghost uses

The copies have to match your Ghost version. Look them up in the file core/shared/config/defaults.json of the Ghost version you run (with a Ghost-CLI install, under current/). Search for portal, sodoSearch, comments and announcementBar. Each has a version, such as 2.72 for Portal in Ghost 6.75.0. Check again after every Ghost update.

2. Download the files

On the server, with Node.js installed (Ghost needs it anyway), fetch the packages with the versions from step 1:

mkdir -p /srv/ghost-apps && cd /srv/ghost-apps
npm install @tryghost/portal@~2.72 @tryghost/sodo-search@~1.9 @tryghost/comments-ui@~1.6 @tryghost/announcement-bar@~1.1
mkdir -p public
cp -r node_modules/@tryghost/portal/umd public/portal
cp -r node_modules/@tryghost/sodo-search/umd public/search
cp -r node_modules/@tryghost/comments-ui/umd public/comments
cp -r node_modules/@tryghost/announcement-bar/umd public/announcement

3. Serve them with Caddy

Caddy serves the files under /niched-apps/ on your own domain and passes everything else to Ghost. Your Caddyfile, with your domain:

example.com {
    encode zstd gzip
    handle_path /niched-apps/* {
        root * /srv/ghost-apps/public
        file_server
    }
    reverse_proxy 127.0.0.1:2368
}

Reload Caddy after the change (systemctl reload caddy, or restart the container).

4. Tell Ghost where they are

In config.production.json, with your domain:

"portal": {
  "url": "https://example.com/niched-apps/portal/portal.min.js"
},
"sodoSearch": {
  "url": "https://example.com/niched-apps/search/sodo-search.min.js",
  "styles": "https://example.com/niched-apps/search/main.css"
},
"comments": {
  "url": "https://example.com/niched-apps/comments/comments-ui.min.js"
},
"announcementBar": {
  "url": "https://example.com/niched-apps/announcement/announcement-bar.min.js"
}

If you run Ghost in Docker, set the same values as environment variables instead: portal__url, sodoSearch__url, sodoSearch__styles, comments__url, announcementBar__url, and privacy__useGravatar=false. Restart Ghost.

Because the files come from your own domain, the browser needs no extra permissions. If you serve them from another domain, that server has to send CORS headers, since Ghost loads them with crossorigin="anonymous".

Don't turn Portal off

Ghost also accepts "url": false to switch Portal off entirely. Don't do that if you use members: the sign-up block at the end of a post, the box on members-only posts and the members pages all rely on Portal to send their e-mails. Serve it yourself instead.

Video

A video you upload to Ghost comes from your own site. A link to YouTube or Vimeo, pasted as a bookmark, loads nothing from the provider until the reader plays the video, and YouTube's player then comes from its no-cookie address. An embed loads the provider's player with the page, and no theme can prevent that. If you use embeds, say so in your privacy policy (see Post types).

What you can't move

  • Stripe for paid memberships always loads from js.stripe.com.
  • Bunny Fonts: a font picked under Brand → Typography always loads from fonts.bunny.net. Leave both fonts on Theme default to avoid it.
  • Requests that Ghost's tools make by themselves once loaded. Portal, for example, contains an image address on static.ghost.org.

Check it

Open your site in a browser with the developer tools open (F12), on the Network tab, and reload the page. With the setup above and the fonts on Theme default, every request goes to your own domain, unless you use paid memberships.