TiddlyWiki is a Wiki software that you can run a few different ways including locally only, online, or syncing a local wiki to an online wiki. You can see examples of online TiddlyWiki’s here:
The following tutorial will be an explanation on how to create a TiddlyWiki on a DigitalOcean droplet.
Initial Setup
-
Sign into DigitalOcean or create an account then create a Ubuntu 18.04 Droplet, the $5 tier is more than enough to start.
-
Follow these instructions for initial server setup: Initial Server Setup with Ubuntu 18.04
-
On your domain provider, create the following Host Records:
Type | Host | Value |
---|---|---|
A Record | @ | IP Address of Droplet |
A Record | www | IP Address of Droplet |
Install NodeJS and NPM
All of the following are commands you can copy and paste once connected via SSH:
-
sudo apt update
- Update the package index -
sudo apt install nodejs npm
- Install NodeJS and NPM -
nodejs --version
- Check NodeJS version -
npm --version
- Check NPM version
Install TiddlyWiki, Forever, and Nginx
-
sudo npm install -g tiddlywiki
- Install TiddlyWiki -
sudo npm install -g forever
- Install Forever which allows you to continuously run TiddlyWiki without being connected via terminal -
sudo apt install nginx
- Install Nginx -
sudo ufw app list
- Get Firewall Available Applications -
sudo ufw allow 'Nginx HTTP'
- Allow Nginx HTTP traffic through the firewall -
sudo ufw allow 'Nginx HTTPS'
- Allow Nginx HTTPS traffic through the firewall -
systemctl status nginx
- Confirm Nginx is running the output should look like this:? nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2019-02-20 18:53:51 UTC; 1min 2s ago Docs: man:nginx(8) Process: 8300 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS) Process: 8291 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS) Main PID: 8304 (nginx) Tasks: 2 (limit: 1152) CGroup: /system.slice/nginx.service +-8304 nginx: master process /usr/sbin/nginx -g daemon on; master_process on; +-8306 nginx: worker process ```
Initialize TiddlyWiki
-
mkdir -p ~/apps/wiki
- Make a folder in your home folder calledapps
with a sub folderwiki
(you can name this whatever you would like) -
cd apps/wiki
- Open the new folder -
tiddlywiki mywiki --init server
- Create a new wiki inmywiki
folder, you can change that name to what you would like.
Initialize Nginx and Add SSL via Certbot from Let’s Encrypt
-
cd /etc/nginx/sites-available/
- CD into Nginx directory -
sudo nano /etc/nginx/sites-available/DOMAIN.com
This will create your domain config file -
Paste the following into the file and change
DOMAIN.com
andwww.DOMAIN.com
to your domain:
server {
server_name DOMAIN.com www.DOMAIN.com;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Press Ctrl+O then Enter then Ctrl+X to save the file then exit the file
-
sudo ln -s /etc/nginx/sites-available/DOMAIN.com /etc/nginx/sites-enabled/
- Symbolic links site to enabled -
sudo apt install certbot
- Install Certbot -
sudo apt-get install python-certbot-nginx
Install Nginx Certbot plugin -
sudo certbot --nginx
- Create HTTPS cert with Let’s Encrypt- Select whichever domains you want your cert to cover
- Press 2 to redirect HTTP traffic to HTTPS, this is recommended
- The conf files for your selected domains will be updated with the cert information automatically
Running TiddlyWiki
-
cd ~/PATH/TO/WIKIFOLDER
Do not go into the directory of the wiki just to the folder that contains your wiki folder, for example if you created the directory as listed in step 14:cd ~/apps/wiki/
-
tiddlywiki mywiki --listen
replacing mywiki to what your wiki folder is called- Now navigate to your domain in a web browser and it should be served correctly.
-
To run the process without being connected to the server:
forever start --spinSleepTime 10000 /usr/local/bin/tiddlywiki /home/username/apps/wiki/mywiki --listen "readers=(anon)" writers=USERNAME username=USERNAME password=PASSWORD
-
Alternatively you can create a CSV file add it to the root of mywiki and run the following command which will allow anyone to read your wiki but only authenticated via the CSV to write:
forever start --spinSleepTime 10000 /usr/local/bin/tiddlywiki /home/username/apps/wiki/mywiki --listen credentials=users.csv "readers=(anon)" "writers=(authenticated)"
-
For Restricted reading and writing:
forever start --spinSleepTime 10000 /usr/local/bin/tiddlywiki /home/username/apps/wiki/mywiki --listen credentials=users.csv "readers=(authenticated)" "writers=(authenticated)"
Conclusion
I’ve been using TiddlyWiki since Friday, February 15, 2019, and have fallen in love with it. It gives me the flexibility I need for keeping track of all kinds of data and doesn’t make you stick to a rigid structure. Tiddlers (entries) are not required to connect to another, and therefore you can have Orphan Tiddlers that are only called upon by linking to one.
I highly recommend at least downloading TiddlyWiki to your local computer and trying it out if you are looking for a wiki software or something similar. Also, check out the Wikis I’ve listed above to see if there are new use cases you might not have thought of yet.
Finally, if TiddlyWiki isn’t for you, there is always DokuWiki as an alternative. An excellent example of DokuWiki is Andrew Canion’s Wiki, have a look there to see if that fits better with your style.