Self-hosting TiddlyWiki with GitHub Pages

TiddlyWiki is most often used as a private wiki for personal note taking and creating private journals.

Because it is a single text file usually named index.html written in HTML, CSS and some JavaScript, I thought it would make an ideal candidate for a simple-to-use personal website that can be hosted on one’s own domain. As a researcher who appreciates the IndieWeb and Domain of One’s Own philosophies and uses my personal website as a commonplace book for both work and personal reasons, how could I resist?

TiddlyWiki

TiddlyWiki is easy to use, highly flexible, modifiable, and can be easily copied, backed up, and shared. There’s an active community of users and developers for the platform which dates back to 2004. There are a variety of examples and documentation online and plugins are literally as simple as dragging and dropping some files from one source directly into your own Wiki. For those interested in the OER movement, individual Tiddlers (TiddlyWiki’s name for cards or discrete entries within the wiki) can be easily dragged and dropped from other TiddlyWikis to copy them!

There are some useful instructions for hosting it almost everywhere–except on one’s own domain name.

The few easy options I’ve found for hosting a TiddlyWiki publicly online as a website were rely on someone else’s service as a subdomain. As much as I like the idea of TiddlySpot I really wanted to use my own domain name (not to mention that it’s non-obvious how to host a newer TiddlyWiki version 5 (TW5) instance there). I’d also seen TiddlySpace shut down a few years ago and didn’t want to deal with that potentiality—though I will admit that exporting would be as simple as downloading and moving a single file!

So after a month or so at tinkering around at several complicated solutions that always seemed beyond my grasp, I went back to IndieWeb basics. What is their recommendation for the easiest way to get a website up and running? The fact that an empty TiddlyWiki file is named index.html gave me my answer: set up a GitHub Pages-based website and simply connect it to my domain!

However, as simple as this pathway may seem to some, I thought I’d briefly document the process I took so others can do the same for themselves.

First I’ll presume you’ve got a domain name and a host that will allow you to change the CNAME for where your domain name is pointed. (If you don’t, check out details.)

In short, you’re going to upload a single file to your GitHub account and then point your domain name at it.

The idea of GitHub may scare a lot of people, but you won’t need to use git, know any git commands, or even know how git works since I’ll describe steps that entirely use the graphical user interface and don’t come anywhere near using the command line or any complicated GitHub applications. It’ll be as easy as dragging and dropping.

Let’s start!

Step-by-Step Tutorial

Get TiddlyWiki

Go to click on the “Download Empty” button on their homepage. This will allow you to save a file called index.html to a convenient place on your computer.

This one file is the entirety of your future website! Guard it well.

GitHub

If you don’t already have one, create an account at

You’ll use this account and their free GitHub Pages service to host your website for free as long as the project folder (also known as a repository) you are hosting is public.

At GitHub create a new repository.

Name it username.github.io, where username is your username (or organization name if you’re doing it for your organization) on GitHub.

Give your repository an optional descriptive name. I named mine “A TiddlyWiki commonplace book”

Choose the “Public” option, otherwise no one will be able to visit your new website.

Click “Create Repository”

Upload your TiddlyWiki to your new repository

In the Quick Set Up box click on the link for “uploading an existing file”.

On the subsequent page you can either drag and drop the empty TiddlyWiki index.html file you saved on your computer or you can click “choose your files” to find and upload the file.

If you like, you can optionally add any additional README, License, or gitignore files as necessary. If you don’t know what these are you can safely skip them or revisit doing this later.

Under “Commit changes” give your upload a short title; the suggested “Add files via upload” is fine. You can add an optional extended description if you like.

Click on the “Commit Changes” button.

P.S.: If you haven’t done so before you’ve just made your first Git commit. Congratulations!!

Your folder should now be ready and have your index.html file in it.

Setting up your domain

Here you may need to consult with the the instructions your specific domain name registrar or host has for pointing your domain name (or subdomain) at your new GitHub Pages website. Usually they will have step by step instructions for doing this, but they can also often do it for you via email or phone support if you prefer.

Examples:

Instructions for Reclaim Hosting:
Instructions for 1&1 using a subdomain:

Now you’ll want to configure your GitHub Pages site to dovetail with your domain.

In your newly created GitHub repository, click on the “Settings” tab in the top right corner or go to
Scroll down the page to the “GitHub Pages” section

In the “Custom Domain” section enter your domain name example.com into the field and click the “Save” button.

Setting up your website

It may take a while for the DNS system to propagate the changes from your host, but you should be able to visit your website and see your empty TiddlyWiki online. Congrations! You’ve got a new website.

You’ll notice in the TiddlyWiki documentation that the first rule of TiddlyWiki is to always save or back up your wiki!

(The second rule, in true Fight Club fashion, is–let’s say it together–to always save or back up your wiki!)

Since our wiki is on GitHub, we’ll want to use the Save to a Git Service instructions. Once set up, the changes to our TiddlyWiki should automatically self-save (this can be changed within your wiki’s Control Panel too) or they can be saved manually using the TiddlyWiki checkmark save functionality.

I’ll note that you can presently use your GitHub password in these settings, but this isn’t quite as secure as generating a custom token (or password), and sometime in late 2020, GitHub won’t allow you to use your basic account password this way, so you may as well set up the personal access token now.

Setting up Personal Access Tokens

You will need a Personal Access Token (essentially a password that will be specific to your TiddlyWiki account) in order to save your TiddlyWiki file.

On GitHub, click on your user icon, select “Settings”, then “Developer Settings”

Next click on the “Personal Access Tokens” tab and then click “Generate new token”

Give your token a descriptive name like “TiddlyWiki”

Under scopes, select “repo” (and all of its sub-scopes)

Click the “Generate Token” button at the bottom of the page.

Once created, immediately copy this string somewhere safe since navigating away from the page will not allow you to recover it. (If you do, you’ll need to regenerate a new token.)

Finally copy the text of your token into the Tiddler noted above in place of your password. There’s no explicit save button, just ‘X’ out of the settings control panel and click your TiddlyWiki’s main save button.

Your token value should be stored in browser local storage.

Now you can edit any Tiddler and save it.

After edits to your wiki, you’ll see that the checkmark icon on the page is red (depending on your theme), indicating changes to save. You can click on it to force a save.

I’ve found it convenient to wait for the TiddlyWiki to schedule the save on its own, however, make sure you’ve saved any changes you want before closing your browser tab.

Sometimes saves aren’t always successful and you’ll see error warnings, but usually they’ll clear themselves up on subsequent auto saves.

If necessary, you can visit your GitHub repository for your wiki and it will indicate the interval of time since the last save.

We’re done!

Everything after this you may be able to either handle yourself by poking around your new wiki or you can find lots of help in the two Google Groups listed above or by searching around online, in fora, or even step-by-step videos on YouTube.

If you’ve done this as part of the IndieWeb or A Domain of One’s Own, be sure to log yourself into the IndieWeb wiki and add yourself to the examples on their TiddlyWiki page where you might also find some other useful ideas.

If you like, you can delve deeper into GitHub and use one of their apps or command line functionality to regularly back up your website to your desktop, or you can make branches of your site on your local computer and then push those changes up to the cloud.

If you find problems or encounter issues, feel free to drop me a line or catch me or others in the IndieWeb chat.