Personal Wiki With BookStack

Without even knowing it, you probably know a lot. The problem is: there are also a lot of things that get lost in the brain. Goo thing we have stuff like a calendar or a list of contacts, so we don’t have to think about it anymore, but what do we do with all the other stuff?

Bookstack is one tool that can help you get information organized with a nice shelve-book-page structure. It can be used as a great personal wiki. In this blogpost I’m going to share how you can install it and how I use it in my daily life.

Login screen of BookStack
Login screen of BookStack

Installing BookStack

If you’ve read some of my previous blogposts, you will know that I love to manage my services with Docker Compose. It’s straightforward, portable and easy to move between servers if I ever need to. I am not married to it, but it has served me well over the years. For the images itself: I like to use linuxserver.io images, since they provide well maintained images and provide some consistency in my setup across the services.

Start by making a folder for BookStack’s configuration files and find your user and group id with the id $user command. We need to uid and the gid from the output:

uid=1024(admin) gid=100(users) groups=100(users),101(administrators),65537(docker)

BookStack depends on a MySQL compatible database. For this example I will be using MariaDB, since I’ve had good experiences with it in the past and it also has a linuxserver.io image. You will need to have a separate configuration folder for this database as well.

We can now assemble the docker-compose.yml file with the following contents:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
version: "3.7"
services:
  bookstack:
    image: lscr.io/linuxserver/bookstack
    container_name: bookstack
    environment:
      - APP_URL=http://127.0.0.1:6543 # Change this to https://<yourdomain>/ when ran behind a reverse proxy.
      - PUID=1024 # The user ID of the current user
      - PGID=100 # The group ID of the current user
      - TZ=Europe/Amsterdam # The Timezone where you live
      - DB_HOST=bookstack-mariadb
      - DB_USER=bookstack
      - DB_PASS=supersecretpassword
      - DB_DATABASE=bookstackapp
    volumes:
      - /volume1/docker/config/BookStack:/config # Replace with your configuration folder
    ports:
      - 6543:80
    restart: unless-stopped
    depends_on:
      - bookstack-mariadb

  bookstack-mariadb:
    image: lscr.io/linuxserver/mariadb
    container_name: bookstack-mariadb
    environment:
      - PUID=1024 # The user ID of the current user
      - PGID=100 # The group ID of the current user
      - TZ=Europe/Amsterdam # The Timezone where you live
      - MYSQL_ROOT_PASSWORD=supersecretpassword
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=supersecretpassword
    volumes:
      - /volume1/docker/config/BookStackMariaDB:/config # Replace with your configuration folder
    restart: unless-stopped

You should of course replace the password with something more secure in the above example, but for the rest you should be ready to start BookStack up with one simple command: docker-compose up -d. It can take a few minutes while BookStack is preparing itself. After that you can go to localhost:6543 in your browser to open it up. Replace localhost with the ip-address of the machine BookStack is hosted on.

If you plan on using BookStack behind a reverse proxy, you should set the APP_URL environment variable to the domain that BookStack will be on. Bookstack will not work correctly when you have not set this to your domain.

Setting up BookStack

BookStack comes with an admin user by default. The default credentials are: Username: admin@admin.com Password: password

This is as insecure as it can be, so we should change this as soon as possible. Click on Admin in the top-right corner and click on Edit Profile. You can change your password here. While you’re at it, you should probably also set up multi factor authentication for additional safety.

Edit profile screen of BookStack
Edit profile screen of BookStack

Oeh, I noticed there is a Dark mode. Yea definitely going to turn that baby on! Did you know this blog also has a darkmode switch in the top right corner? ;)

Gotta love that BookStack Dark Mode!
Gotta love that BookStack Dark Mode!

How I Use Bookstack

Managing Information

The way you manage your information in BookStack is quite unique and feels very natural for everybody that has ever held a book in it’s hand. At the top layer, you have your shelves. A shelve has books and a book consists of pages. It is so easy to visualize how this works!

I have the shelves categorized by a broad concept or subject, for example Home, Projects and Technology . On each shelve I have one or more books. For example on my Home shelve, there is a book for Installations, Construction and Garden. What is a book without a page? So every book has multiple pages. Take for example the Installations book. It contains pages about the Solar system, electricity, water and gas supplies and how to maintain all of it. I find it very easy to find information this way.

It is possible for a book to be on multiple shelves, so keep that in mind when you are making your own shelves. This structure works well for me, but you may want to structure it a different way to better match your personal situation.

Daily Usage

I use BookStack a lot while writing for this blog, while I am working at or around my home and or when I am working on other projects. It is part of a lot of routines. Do I want to change something in my home? I check how it currently works and make adjustments. Writing a new piece of code? I check if I have something written about it, and if I don’t, I make a new page where I document my findings. Do I need to upgrade my server? I check if my manuals are still up-to-date and follow them to the word.

This way I make sure that the documentation is always as up-to-date as it can be, but it also documents what I already know. If something might happen to me, I can be rest assured that my girlfriend is still able to look things up if she needs to. This also works vice-versa: when she has new information it is also available to me.

Wrapping Up

BookStack is a straight-forward way to manage information and using it is very easy and intuitive. You should definitely give it a go! As usual, the Docker Compose file is on the Selfhosted Heaven github page.

I also love to know your experiences with BookStack and how you use it. Do you have another tool you use? Let me know and I will check it out! Leave a comment and we can have a great discussion about it :)

comments powered by Disqus