How to Install BookStack on POP! OS Latest

BookStack is an open-source platform that helps you create and organize documentation. In this tutorial, we will show you how to install BookStack on your POP! OS in just a few steps.

Prerequisites

Before you install BookStack, ensure that your POP! OS system is updated to the latest version. Additionally, you need to have administrative access to proceed with the installation.

Step 1: Install Apache web server

BookStack runs on top of the Apache webserver. To install Apache web server on your system, open the terminal by pressing CTRL+ALT+T keys and run the following command:

sudo apt update
sudo apt install apache2

Step 2: Install PHP

BookStack requires PHP version 7.2 or higher to run. To install PHP on your system, run the following command in the terminal:

sudo apt install php libapache2-mod-php php-curl php-mysql php-gd php-json php-mbstring php-xml php-zip

Step 3: Install MySQL Server

BookStack uses MySQL to store its information. Use the following command to install MySQL server:

sudo apt install mysql-server

Step 4: Create a MySQL database

To create a new database, log in to the MySQL shell by running:

sudo mysql -u root -p

Create a new database and grant a new user ${user} access with a password ${password}:

CREATE DATABASE bookstack;
GRANT ALL ON bookstack.* TO ${user}@localhost IDENTIFIED BY '${password}';
FLUSH PRIVILEGES;
exit;

Step 5: Install Composer

Composer is a dependency manager for PHP applications. Install it using the following command:

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

Step 6: Download and Install BookStack

Create a new directory and navigate into it:

mkdir -p ~/BookStack && cd ~/BookStack

Clone the BookStack repository into the ~/BookStack directory with Git:

git clone https://github.com/BookStackApp/BookStack.git .

Copy the env.example file as .env:

cp .env.example .env

Update the .env file to match your environment configuration. Set the database details and the URL where the BookStack is running.

Next, install the dependencies using Composer:

composer install --no-dev

Step 7: Run the setup script

The setup script will run database migrations and create the initial administrator account. Run the setup script with this command:

php artisan bookstack:install

It will prompt a series of questions that need to be answered. Make sure you provide the database and administrator account details that you previously created.

Step 8: Set file permissions

Ensure that the webserver has write permissions to the /public/uploads/ directory. Use the following command to set write permissions:

sudo chown -R www-data:www-data /path/to/BookStack/public/uploads

Step 9: Configure Apache

Create a new virtual host configuration file by running:

sudo nano /etc/apache2/sites-available/bookstack.conf

Copy and paste the following content into the file:

<VirtualHost *:80>
   ServerName bookstack.example.com
   DocumentRoot /var/www/BookStack/public
   
   <Directory /var/www/BookStack>
       AllowOverride All
       Order Allow,Deny
       Allow from All
   </Directory>
   
   <Directory /var/www/BookStack/public>
       AllowOverride All
       Order Allow,Deny
       Allow from All
   </Directory>
   
   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Save the file by pressing CTRL+X, Y, and then ENTER.

Enable the new virtual host configuration:

sudo a2ensite bookstack.conf

Restart Apache web server to apply changes:

sudo systemctl restart apache2

Step 10: Access BookStack

Open your web browser and navigate to the URL you specified in the Virtual Host configuration. You will be redirected to the BookStack login page. Log in with the administrator credentials and start using BookStack.

Congratulations! You have now installed and configured BookStack on your POP! OS system.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!