How to install Bookstack

Bookstack is the document management solution.  To install:


Spin up an Ubuntu 18.04 Server, SSH in and then:

sudo apt-get update

wget https://raw.githubusercontent.com/BookStackApp/devops/master/scripts/installation-ubuntu-18.04.sh

chmod a+x installation-ubuntu-18.04.sh

sudo ./installation-ubuntu-18.04.sh



When complete it will give you the URL to connect as well as the default username and password:
admin@admin.com / password
Log in and change those credentials

Now secure it:

Command Notes
sudo apt install ufw Install Uncomplicated Firewall
sudo ufw default deny incoming Deny all incoming connections
sudo ufw default allow outgoing Allow outgoing connections
sudo ufw allow ssh Allow SSH inbound
sudo ufw enable Enable the Firewall
sudo ufw allow http Allow HTTP connections on port 80
sudo ufw allow https Allow HTTPS connections on port 443
sudo ufw allow from n.n.n.n Allow incoming from n.n.n.n
sudo ufw status verbose Check the status

This will allow only HTTP, HTTPS & SSH connections.  Once the install is complete it is a good idea to disable SSH

Add SSL via Letsencrypt:

Command Notes
sudo apt-get install software-properties-common Add the ability to add repositories
sudo add-apt-repository ppa:certbot/certbot Add the certbot repository
sudo apt install python-certbot-apache Install certbot
ls -lsa /etc/apache2/sites-available/ Check your domain is configured
sudo certbot --apache -d <your_hostname> Run the script to obtain the certificate.  The hostname can be mydocs.co.uk or docs.hellocomtec.com for example

This will ask a couple more questions and then check the hostname you have created exists and authority has been granted in DNS.  You may be asked to add an acme challenge DNS TXT record to your domain.
When the script gets close to the end, it will ask you if you want to redirect HTTP to HTTPS.  Enter 2 to redirect automatically.

Set up email sending

 

Edit /var/www/bookstack/.env and add:

MAIL_DRIVER=smtp

# Host, Port & Encryption mechanism to use
MAIL_HOST=<SMTP server>
MAIL_PORT=465
MAIL_ENCRYPTION=tls

# Authentication details for your SMTP service
MAIL_USERNAME=<email address>
MAIL_PASSWORD=<password>

# The "from" email address for outgoing email
MAIL_FROM=<email address>

# The "from" name used for outgoing email
MAIL_FROM_NAME=BookStack

Then go to settings/maintenance and click the button to send a test email.  If it works you'll get aa green success banner.  If it doesn't work you'll get a red banner with an error code.

 

Bookstack Install: https://www.bookstackapp.com/docs/admin/installation/#ubuntu-1804
Uncomplicated Firewall Install: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-18-04
Letsencrypt: https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-18-04
Email configuration: https://www.bookstackapp.com/docs/admin/email-config/

Did you find this article useful?