Skip to main content

Bookstack

th-2324090029.jpg

BookStack is a simple, self-hosted, easy-to-use platform for organising and storing information.

I rebranded my Bookstack instance to MyWiki and originally intended to use it only for my personal reference and possibly some journalling. I still use it for referencing but I am building it out as a "knowledge-base library" so others may benefit. If you're here, you probably figured that out already 🙂

 Screenshot from 2023-03-29 02-08-15.png


Installation

To install Bookstack, you will need Docker installed at a minimum and optimally Docker Compose as well. This installation guide assumes you are installing Bookstack on Ubuntu 22.04 and you have both Docker and Docker Compose installed.

If you do not have Docker and Docker Compose installed, you can follow my guides for doing so by clicking these links:

You don't have to install Bookstack using containers. It's just my preference. You can see all the installation methods by going to Bookstack's official installation web page.

I am using a pre-built container from LinuxServer.io

You gain access to the relevant container images via a Docker Compose YAML file. You will need to edit various parameters to configure Bookstack and your Bookstack database.

Container images are configured using parameters passed at runtime. These parameters are separated by a colon and indicate <external>:<internal> respectively. For example, -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080 outside the container.

Step 1 - Create a directory to store your docker-compose.yml file.

sudo mkdir /docker/bookstack

Step 2 - Create and open your docker-compose.yml for editing

cd /docker/bookstack
touch docker-compose.yml
nano docker-compose.yml

Step 3 - Copy and paste the following Docker Compose file template into your docker-compose.yml file.

---
version: "2"
services:
  bookstack:
    image: lscr.io/linuxserver/bookstack
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - APP_URL=
      - DB_HOST=bookstack_db
      - DB_PORT=3306
      - DB_USER=bookstack
      - DB_PASS=<yourdbpass>
      - DB_DATABASE=bookstackapp
    volumes:
      - /path/to/data:/config
    ports:
      - 6875:80
    restart: unless-stopped
    depends_on:
      - bookstack_db
  bookstack_db:
    image: lscr.io/linuxserver/mariadb
    container_name: bookstack_db
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=<yourdbpass>
      - TZ=Europe/London
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=<yourdbpass>
    volumes:
      - /path/to/data:/config
    restart: unless-stopped

Step 4 - Edit the file, changing the relevant portions of the template as outlined below:

  • Change