Skip to content

BookStack Installation on Ubuntu 24.04

This page documents the complete process for installing BookStack, a self-hosted wiki and knowledge base, on a fresh Ubuntu 24.04 server. BookStack is used as my primary knowledge repository.

Reference: BookStack Official Installation Guide

Prerequisites

  • Fresh Ubuntu 24.04 LTS server (minimal install, recommended as LXC or VM)
  • Root or sudo access
  • Static IP address

Ubuntu 24.04 Installation Script

A script is available to install BookStack on a fresh Ubuntu 24.04 instance.

Warning

This script is for a clean OS only and will install Apache, MySQL 8.0, and PHP 8.3. It may overwrite existing web setup and does not configure mail or server security. You are responsible for those steps separately.

Running the Script

# Download the installation script
wget https://codeberg.org/bookstack/devops/raw/branch/main/scripts/installation-ubuntu-24.04.sh

# Make the script executable
chmod a+x installation-ubuntu-24.04.sh

# Run the script with admin permissions
sudo ./installation-ubuntu-24.04.sh
The script will output a log file in your working directory for debugging. File and directory permissions will be set based on the user running the script.

Change BookStack Instance URL

1. Set Domain Name

Set up a DNS record (e.g., wiki.example.com) to point to your server’s public IP. You may use a service like Cloudflare Tunnel.

2. Configure the BookStack .env file

Edit the environment file to use your domain name:

sudo nano /var/www/bookstack/.env

Change the following line to match your domain:

APP_URL=https://wiki.example.com

Then restart Apache:

sudo systemctl restart apache2

Install Certbot and request a certificate for your domain:

sudo apt install certbot python3-certbot-apache
sudo certbot --apache -d wiki.example.com
Certbot will handle obtaining and installing your SSL certificate.

1. Edit .env for Mail Settings Open your environment config:

sudo nano /var/www/bookstack/.env

Add or edit the following section:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=tls
[email protected]
MAIL_FROM_NAME="BookStack"

Note

Replace values with those from your email provider.

2. Clear Config Cache (recommended after changing .env):

# From the BookStack installation directory:
php artisan config:clear

First Login

Once installation and setup are complete, access BookStack in your browser at:

http(s)://your-domain-or-server-ip

Follow the on-screen prompts to finish setup.

For more details and troubleshooting, consult the BookStack installation documentation.