Root-Server Tutorial

ROOT-SERVER TUTORIAL

Set up BookStack on a Debian Server

How to install a BookStack server using docker-compose.

Author:

Phillip U

Last updated:

07/06/2023

Introduction

In this tutorial, I'm going to describe how you can install the BookStack wiki software on a Debian 11 server.

We use Docker for the installation to keep the process relatively simple. BookStack is a free software for organizing and storing information. Among other things, the software supports uploading files and embedding source code. This is why this wiki solution is suitable for people interested in documentation work.

The reading time of this article is approximately 10 minutes. A time of about 30 minutes should be planned for the implementation of this project. In terms of difficulty, this project is in the beginner range. In this tutorial, we'll use the hostname srv1.quicksrv.de. Please note that the hostname will be different in your case. After completing the instructions in this tutorial, you should be able to access your wiki via a browser at wiki.yourdomain.de.

Requirements

These are the requirements to follow the instructions in this tutorial:

  • netcup Root or vServer
  • Debian 11
  • superuser
  • SSH or Console access
  • At least 30 GB Hard Disk space (depending on the scope and type of documentation)
  • At least 1 GB of RAM -
  • At least 1 CPU Core
  • One IPv4 or IPv6 address

For this project, the smallest netcup VPS, the VPS 200 G10s vServer, is sufficient.

Step 1 - Ordering the VPS

At the time of the creation of this tutorial (June 2023), the recommended product to be used as SSH proxy is VPS 200 G10s. Existing customers can add the product easily and quickly.

Step 2 - Basic configuration of the server

After provisioning the server and logging in for the first time with the username root and the password sent by email, the first step is to update the basic configuration of the server.

  1. Change the root password by means of passwd.
  2. Import the current security updates with apt-get update && apt-get upgrade -y.
  3. Change the hostname with hostnamectl set-hostname NEW-NAME

Step 3 - Install Docker on the server

After the basic server installation, we now need to install Docker. Docker allows us to launch applications in so-called containers, so as to avoid any possible problems with dependencies on multiple applications. Also, an application is much easier to install and update, as the user does not have to deal with installing different packages.

  1. To install Docker, the following script must be executed:

apt update && apt upgrade -y && apt install sudo -y apt-get install ca-certificates curl gnupg -y sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y`

  1. To verify the installation, we enter the docker compose version command. The command line should now give us a version number. With this, we can make sure that our installation was successful and we can start installing our application.

Step 4 - Install BookStack on the server

Now, in order to install BookStack, the first step we need is to create a folder on our server to put the files there. We create this folder under /opt/bookstack. The location can be chosen freely. mkdir /opt/bookstack

In the next step, we change to the directory with the cd command. cd /opt/bookstack There, we now create the docker-compose.yml, which is to be understood as the configuration file of our application. We create the file with the nano editor. To do this, we enter the following command: nano docker-compose.yml

We add the following content to the file:

version: "2"
services:
  bookstack:
    image: lscr.io/linuxserver/bookstack
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - APP_URL=https://bookstack.example.com
      - DB_HOST=bookstack_db
      - DB_PORT=3306
      - DB_USER=bookstack
      - DB_PASS=<yourdbpass>
      - DB_DATABASE=bookstackapp
    volumes:
      - ./bookstack_app_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:
      - ./bookstack_db_data:/config
    restart: unless-stopped

We now only have to make the following changes within the file:

  • Under APP_URL we enter the domain for our wiki.
  • Under DB_PASS we enter a password for the database user.
  • Under MYSQL_ROOT_PASSWORD we enter a strong password.
  • Under MYSQL_PASSWORD we give the database user a password, which we also have to enter in the first point.

Now we can start the application with docker compose up -d. The process will take a while, but after a maximum of 5 minutes we should be able to reach the website. The default login uses the following credentials:

username: admin@admin.com password: password

Conclusion

The wiki can now be used. Please adjust the settings depending on your needs.

License

MIT

Copyright (c) 2023 netcup

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contributor's Certificate of Origin

By making a contribution to this project, I certify that:

  1. The contribution was created in whole or in part by me and I have the right to submit it under the license indicated in the file; or

  2. The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same license (unless I am permitted to submit under a different license), as indicated in the file; or

  3. The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

  4. I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the license(s) involved.

Published 07/06/2023 by Phillip U

Submit your tutorial

Get 60€ netcup vouchers for every published tutorial.