← Back to Tutorials

Setting Up BookStack for Documentation Management

DevOps

Why Choose BookStack Over Confluence?

BookStack is an open-source documentation platform designed to be simple, self-hosted, and effective as a knowledge base or wiki. It offers an organized approach to documentation, using a familiar book-based structure that makes it easy to categorize and find information.

Unlike Confluence, which requires a subscription, BookStack is free, lightweight, and easy to deploy on your own server.

How to Install BookStack

Step 1: Update System Packages

sudo apt update && sudo apt upgrade -y

Step 2: Install Dependencies

BookStack requires PHP, MySQL/MariaDB, and Apache or Nginx:

sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql php-xml php-mbstring git unzip -y

Step 3: Clone the BookStack Repository

cd /var/www
sudo git clone https://github.com/BookStackApp/BookStack.git --branch release --single-branch bookstack

Step 4: Configure BookStack

cd /var/www/bookstack
cp .env.example .env

Edit the .env file to set your database credentials and other settings:

sudo nano .env

Step 5: Set Up the Database

sudo mysql
CREATE DATABASE bookstack;
CREATE USER 'bookstackuser'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON bookstack.* TO 'bookstackuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 6: Install Composer Dependencies

curl -sS https://getcomposer.org/installer | php
php composer.phar install

Step 7: Set Permissions and Start Apache

sudo chown -R www-data:www-data /var/www/bookstack
sudo systemctl restart apache2

Step 8: Access BookStack

Visit your server's IP address in a browser. Default login credentials:

Email: admin@admin.com | Password: password

Remember to change these credentials after logging in.

Configuring BookStack

General Settings

Go to Settings > App Settings to adjust the application name, theme, and logo.

User Permissions

BookStack allows you to set detailed permissions. Create roles with specific access levels and assign them to users.

Organizing Documentation

Organize documentation into books, chapters, and pages, or create shelves for larger projects.

Using BookStack

  • Rich Text and Markdown Support: Flexibility in how you format documents.
  • Search Functionality: Built-in search engine helps users find content quickly.
  • Page Revisions: Track changes with built-in version history.
  • API for Integrations: Expand functionality with the BookStack API.