Add files via upload

I have read and understood the Contributor's Certificate of Origin at the end of the template and I hereby certify that I meet the contribution criteria described in it.

Make sure that you have your email address visible on your Github account. If your tutorial is accepted, you will receive an email from our netcup Community Team asking for your netcup Customer-ID, so the reward can be processed.
This commit is contained in:
Phillip Unzen 2023-06-07 20:32:43 +02:00 committed by GitHub
parent 5b590036f4
commit 472e1c671c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,147 @@
---
title: Setup Bookstack on a debian server
description: How to install a Bookstack Server with docker-compose
level: [beginner]
updated_at: 2023-06-07
slug: setup-bookstack-with-docker
author_name: Phillip U
author_url: https://github.com/phillipunzen
author_image:
author_bio:
tags: [linux, wiki, docker, docker-compose]
netcup_product_url: https://www.netcup.de/bestellen/produkt.php?produkt=2948
language: en
available_languages: [de, en]
---
# Introduction
In this tutorial I describe how we can install the wiki software Bookstack on a Debian 11 server.
We use Docker for installation to keep the installation relatively simple. Bookstack is a free software for documenting certain information. Among other things, the software supports uploading files and embedding source code. Therefore, this wiki is suitable for all kinds of people who are interested in documenting things.
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 is in the beginner range. In this tutorial, we will use the hostname srv1.quicksrv.de. This can be chosen freely. You should be able to open our wiki with a browser on the website wiki.website.de afterwards.
# Requirements
The following are the requirements for the system to successfully complete the installation:
- Debian 11 operating system
- Administration user
- SSH access 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 VPS 200 G10s vServer model 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](https://www.netcup.de/bestellen/produkt.php?produkt=2948).
Existing customers can add the product easily and quickly.
# Step 2 - Basic configuration of the server
After provisioning of the server and the first login 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 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 not to have problems with dependencies on multiple applications. Furthermore, an application is much easier to install and update because the user does not have to deal with the installation of 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`
2. 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
To install Bookstack now, in the first step we need a folder on our server to put the files there. We create this 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`
In it we add the following content:
```
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
```
In the file we now only change the following things:
- Under `APP_URL` we enter the domain for our wiki
- Under `DB_PASS` we enter a password of 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 is taking a while now, but after max. 5 minutes we should be able to reach the website.
The Default login is with username: `admin@admin.com`and password: `password`.
# Conclusion
The wiki system can now be used. The settings can be adjusted in the settings.
# Licence
[MIT](https://github.com/netcup-community/community-tutorials/blob/main/LICENSE)
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 licence 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 licence and I have the right under that licence to submit that work with modifications, whether created in whole or in part by me, under the same licence (unless I am permitted to submit under a different licence), 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 licence(s) involved.