New Page
How to setup Bookstack on Unraid
Setup a SQL Server, I used a new MariaDB container since I like to have all my databases separated by function. This allows me to delete the database/users if I no longer use the applications.
- Search MariaDB under Apps, I prefer the Linuxservers repository, you might prefer the official one from mgutt. If you already have a MariaDB installed, you may have to allow for a 2nd container. Click Apps, down the left-hand side click settings, then "allow instance of second install" will have to be set to Yes. You will get warning of the same port numbers, just click yes.
- Leave all the default settings, if this is the 2nd ( or 3rd ) install, you will have to pick a port number that isn't in use. I picked 3308 as this is my 3rd install. Pick and type a strong root password, set both the MYSQL_DATABASE and MYSQL_USER both to bookstack, and type a MYSQL_PASSWORD. Both of the passwords don't have to be the same, and you will probably only use the MYSQL_PASSWORD, unless you are editing the SQL database with Adminer. I also changed the name to MariaDB-bookstack to make it more memorable in the future.
- Search bookstack on the Apps, and click install. I left the WebUI as it is, and set the APP_URL to be the Ip address of the Unraid server. This will have to be changed in the future, we are just getting it started up so we can see it. Since we left the Network Type of the MariaDB container to bridge, the DB_HOST value will be the ip address of the unraid server. The port will be the port that you specified in step 2, as well as DB_USER, DB_PASS, and DB_DATABASE.
- Click apply, then go in your web browser to http://unraid IP:6875 You should see the login for Bookstack. The login is admin@admin.com with a password of password. This should be change as soon as you login under settings in the top right corner. Change this, and re-log back in.
If you just would like a local copy, this is as far as you will need to go. You can add this to your Heimdall start page, or just type in the IP if you would like to access it.
I would like to access it anywhere in the world from the internet. There are many ways to do this, this is how I did it.
- I added a CNAME to my TLD or Top Level Domain. My CNAMES are setup with Cloudflare, login to your account, click on your TLD, then add a DNS record. I have a DuckDNS account that is also running on my Unraid server in case my IP ever changes, so I set my IPv4 address to be pointing to my DuckDNS account. If you have a static IP, enter it here. I chose not to have Cloudflare proxy my CNAME as I will be doing the proxy myself.
- Open the port 80 and 443 on your router and forward them to your Unraid server IP, or whatever IP you chose to run your SWAG server on. This will be different for each router, you will have to look this up
- Setup your SWAG container on Unraid. Pull the container from the APPs, and click install. Leave the WEBUI, and Port 80 as default, URL will be your TLD, Validation will be DNS, SUBDOMAINS will be set to wildcard. This will allow SWAG to handle all the different CNAMES that will be pointing to the different services on your internal network. Leave CERTPROVIDER blank to use Let's Encrypt, DNSPLUGIN is cloudflare, and add in your email address. ONLY_SUBDOMAINS I have set to true as I host my main domain elsewhere, EXTRA_DOMAINS is left blank, STAGING is set to false. Click "APPLY" and check the logs by left clicking on the container icon, and selecting logs. After a bit, it should say "server ready". Close the window.
- Now we have to add the configuration file for SWAG to work with bookstack. Under your server name in the top right corner, you will see the terminal button. Enter the following code into the terminal.
cd /mnt/user/appdata/swag/nginx/proxy-confs/ nano bookstack.subdomain.conf.sample
- On my server, I have to change the set $upstream_app from bookstack to my Unraid IP. This is because I am running the SWAG container in a different docker network then the Bookstack network is running in. You may also have to change this. Change the set $upstream_port to be 6875, not 80.
- Press Control and X to exit nano, type y to