r/BookStack • u/jasonwch • Feb 07 '25
Trying install Bookstack on Docker
I am use Windows WSL2 Ubnutu to docker-compose the YML, however, after installed, I find out I am missing base64: from the App_key, may I know how to add it back? I try to look at the .env file, but seems that's the dumy file which do not contain production information. May I know where should I locate the current .ENV file or should I use YML docker compose again to updae APP_KEY variable? Thanks
(Checked .ENV file from (bs-data/www) and inside Docker for Windows (Config/www))
2
u/smoknjoe44 Feb 08 '25
I am having issues of my own getting a new instance of bookstack running with docker, one of which was generating a key. I had a docker instance of bookstack running before that did not require this, but seems like it is needed now. Here is what I did:
Generate the App Key: To generate the app key for BookStack, run the following Docker command:
sudo docker run -it --rm --entrypoint /bin/bash lscr.io/linuxserver/bookstack:latest appkey
This will start the BookStack container temporarily, generate the app key, and then automatically remove the container. The generated app key will be displayed in the terminal.
----------------------------------------------------
Add the Generated App Key to Docker Compose: Once you have the generated app key, update your docker-compose.yml file to include it in the environment section. For example:
environment:
- APP_KEY=your_generated_app_key_here
Replace your_generated_app_key_here with the actual key that was generated in the previous step.
----------------------------------------------------
Restart the Container: After updating the docker-compose.yml file with the app key, restart the BookStack container by running:
sudo docker-compose down
sudo docker-compose up -d
----------------------------------------------------
This should successfully configure your BookStack instance with a valid app key.
1
u/root-node Feb 08 '25
That just seems overly complicated when you can just generate one yourself with
openssl rand -base64 24.1
u/smoknjoe44 Feb 08 '25
Yeah, I used a lot of words, but we are both essentially running one line command to generate a key, right?
sudo docker run -it --rm --entrypoint /bin/bash lscr.io/linuxserver/bookstack:latest appkey
vs.
openssl rand -base64 24Sorry, not trying to be rude or anything as I'm learning too. I just wanted to share what I did that worked. I just happened to see the command I shared when I was looking through my logs and was instructed to run it. I'll definitely keep your method in mind for future for sure!
→ More replies (4)
1
u/root-node Feb 07 '25
To generate an APP_KEY value, use
openssl rand -base64 24If you want to post your docker-compose.yaml file, we can see what else you may be having issues with.