How to setup Bookstack Email.

This is how I setup the email on Bookstack. I used the SMTP method as I already have smtp setup on my domain so creating a new email address was quick and easy. My Bookstack environment is installed on a free AWS Ubuntu 20.04 Instance. For more options see the official guide HERE.

The email was setup as follows:

Find the .env file by searching on your server by running the following command:

find / -name *’env

My .env was a hidden file in /var/www/bookstack

How to setup Bookstack Email.- Find .env

Find the file by running the following command:

ls -a

How to setup Bookstack Email.- Find File using Is- A

Edit the .env file:

vim /var/www/bookstack/.env

This will display the .env file:

How to setup Bookstack Email.

The section that need to be updated is the SMTP mail Options:

How to setup Bookstack Email.

My settings were as follows (passwords redacted for security):

How to setup Bookstack Email.

The settings were saved by typing esq plus :wq

The settings were then tested by logging into bookstack as an Admin user and opening Settings:

How to setup Bookstack Email.

And clicking on Maintainance:

How to setup Bookstack Email.

The SEND TEST EMAIL was then pressed:

How to setup Bookstack Email.

If there is an issue with the settings an error message will be shown:

How to setup Bookstack Email.

I originally received this message as I had the MAIL_ENCRYPTION=null when it needed to be MAIL_ENCRYPTION=SSL.

If the settings are correct then you will recieve the following message in the top right of the page:

How to setup Bookstack Email.

You will also receive and email in the logged in user’s inbox:

How to setup Bookstack Email.
How to setup Bookstack Email.

That is the email setup completed. For more Bookstack configuration take a look HERE.

Bookstack Initial Setup

Bookstack is a wiki that organises categories into virtual librarys so that you have the top level of a shelf, then on that shelf you have books and in those books you have chapters and pages. I like this visual way of organising documents as it is very visual and easy to follow.

First of all you will need to create a new shelf. To do this click on the Shelves Button:

Bookstack Initial Setup - Create new shelf

As this is a new installation there will not be any shelves created so click on CREATE ONE NOW:

Bookstack Initial Setup - Create

Fill in the Shelfs name and description

Bookstack Initial Setup - Add Name

As we have no books at the moment we can ignore the Books on this shelf option:

Bookstack Initial Setup - Ignore

If you want to add a cover image to the shelf then expand the Cover image section and either drag the image into the section or click on the SELECT IMAGE button to search for the Image:

Bookstack Initial Setup - Add Cover

The new Image will be displayed:

Bookstack Initial Setup - Select Image

Add Tags if needed:

Bookstack Initial Setup - Add Tags

To add more tags click on Add another tag:

Bookstack Initial Setup - Add more tags

Once finished click on SAVE SHELF:

Bookstack Initial Setup - Save Shelf

The new Shelf will now be shown on the Shelves screen:

Bookstack Initial Setup

The next step is to add a new book. This can be done by clicking on the Create New Book Link:

Bookstack Initial Setup - Add new book

Fill in the details of the new book as you did above for the new Shelf:

Bookstack Initial Setup - Fill in details

Once all the details are adduced click on SAVE BOOK:

Bookstack Initial Setup - Save Book

You will now be taken to the chapter setup page:

Bookstack Initial Setup - Chapter setup

Click on Create Add a new chapter to add a new chapter:

Bookstack Initial Setup - Add new chapter

Add the chapter details:

Bookstack Initial Setup - add chapter details

Once all the details are added click the SAVE CHAPTER button:

Bookstack Initial Setup - Save chapter

You will then be taken to the new page creation page.

Create a new page by clicking the Create new page link:

Bookstack Initial Setup- Create new page link

Add the title to the new page in the title field:

Bookstack Initial Setup - add title

Add the contents of the document in the document field:

Bookstack Initial Setup - add content of document

Once the contents of the document is complete click on Save Page:

Bookstack Initial Setup - Save page

This will take you to the view of the page:

Bookstack Initial Setup - View Page

You can now add more Shelves, books or pages as required in the same way as before.

For more Books stack how too’s click HERE.

For the official Bookstack documents page click HERE.

Bookstack User creation

For more Bookstack articles take a look HERE. For the official Bookstack documentation take a look HERE.

In order to create a user in Bookstack you need to log into Bookstack with an Admin user and do the following:

Click on Settings to open the settings page:

Bookstack User creation

Click on the Users button at the top of the page:

Bookstack User creation

Click ADD NEW USER to open the add new user page:

Bookstack User creation

Add the new user’s Full name and Email address:

Bookstack User creation

Set the users permission level. Admin has full control access, Editor can create and edit documents, Public can view Public accessible documents and Viewer can view documents:

Bookstack User creation

Untick Send user invite by email:

Bookstack User creation

Add the password and confirm the password and:

Bookstack User creation

Click Save to save the new user:

Bookstack User creation

The new user will now be listed in the Users list:

Bookstack User creation

You have now successfully created an new Bookstack user.

Installing Bookstack wiki on AWS free instance.

This guide is how I installed Bookstack Wiki on my AWS Free instance Ubuntu 20.04 server:

Bookstack has a handy Ubuntu 20.04 Installation script that can be run on a fresh install of Ubuntu 20.04 to automatically install Bookstack and the prerequisite software needed for it to run (Apache, MySQL 8.0 & PHP-7.4).

The script can be found at: https://www.bookstackapp.com/docs/admin/installation/

The process is really simple but for some reason the page has been locked so you can not copy and paste from it!:

Download the script by running:

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

Installing Bookstack wiki on AWS free instance.

Change the downloaded script to make it executable:

chmod a+x installation-ubuntu-20.04.sh

You will now see that the script is executable:

Installing Bookstack wiki on AWS free instance.

Run the script by running:

sudo ./installation-ubuntu-20.04.sh

The script will then ask for the fqdn so add what you would like the site to be called. I used wiki.ithowtoo.com and pressed enter.

Let the script run.

It will ask if you want to run Composer as root/super user:

Installing Bookstack wiki on AWS free instance.

I chose Yes as its the only user I have and the install continued:

Installing Bookstack wiki on AWS free instance.

When the script has finished you will see a similar message to the one below:

Installing Bookstack wiki on AWS free instance.

From the ASW interface an inbound rule was created to allow https:

Installing Bookstack wiki on AWS free instance.

You will then be able to get to the login page:

Installing Bookstack wiki on AWS free instance.

Login using the default user and password given by the script:

User Email = admin@admin.com

password = password

On first login you will be advised to change the default password for security reasons:

Installing Bookstack wiki on AWS free instance.

Click OK.

To edit the Admin user details click on Admin in the top left corner of the page:

Installing Bookstack wiki on AWS free instance.

Select Edit Profile:

Installing Bookstack wiki on AWS free instance.

Edit the details to your details:

Installing Bookstack wiki on AWS free instance.

Click save to save the details:

Installing Bookstack wiki on AWS free instance.

You will now see your new user in the list of users as an Admin:

Installing Bookstack wiki on AWS free instance.

Click on the user icon in the top left corner of the page and select Logout to log out of the page and then log in with the new user to make sure everything works as it should:

Installing Bookstack wiki on AWS free instance.

I have also setup a new A record for wiki.mydomain to point to the external IP address of the server so that I can access the site via wiki.domain instead of the external IP address.

The final security measure is to set the mysql root password as it is not setup by default.

Log into mysql by typing:

mysql

You will then see the mysql prompt:

Installing Bookstack wiki on AWS free instance.

Type the following to set the root password to password:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'PASSWORD';
Installing Bookstack wiki on AWS free instance.

Obviously you will want to change the PASSWORD to something more secure.

You will then need to quit mysql by typing quit. This will take you back to the normal command line:

Installing Bookstack wiki on AWS free instance.

At the command prompt stop the MySQL daemon by typing:

sudo systemctl stop mysql

With the daemon stopped issue the following command:

sudo mysqld -init-file=~/mysql-pwd

Start the daemon:

sudo systemctl start mysql

You should now be able to access mysql using the root user by typing:

mysql -u root -p

Installing Bookstack wiki on AWS free instance.

You have now successfully installed Bookstack on an AWS free instance.

For more documents on Bookstack configuration go click HERE.