</span></code></pre></div><h3id=docker-cli-click-here-for-more-info>docker cli (<ahref=https://docs.docker.com/engine/reference/commandline/cli/>click here for more info</a>)<aclass=headerlinkhref=#docker-cli-click-here-for-more-infotitle="Permanent link">¶</a></h3><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-1-1><aid=__codelineno-1-1name=__codelineno-1-1href=#__codelineno-1-1></a>docker<spanclass=w></span>run<spanclass=w></span>-d<spanclass=w></span><spanclass=se>\</span>
</span></code></pre></div><h2id=parameters>Parameters<aclass=headerlinkhref=#parameterstitle="Permanent link">¶</a></h2><p>Containers are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate <code><external>:<internal></code> respectively. For example, <code>-p 8080:80</code> would expose port <code>80</code> from inside the container to be accessible from the host's IP on port <code>8080</code> outside the container.</p><h3id=ports-p>Ports (<code>-p</code>)<aclass=headerlinkhref=#ports-ptitle="Permanent link">¶</a></h3><table><thead><tr><thstyle="text-align: center;">Parameter</th><th>Function</th></tr></thead><tbody><tr><tdstyle="text-align: center;"><code>80</code></td><td>will map the container's port 80 to port 6875 on the host</td></tr></tbody></table><h3id=environment-variables-e>Environment Variables (<code>-e</code>)<aclass=headerlinkhref=#environment-variables-etitle="Permanent link">¶</a></h3><table><thead><tr><thstyle="text-align: center;">Env</th><th>Function</th></tr></thead><tbody><tr><tdstyle="text-align: center;"><code>PUID=1000</code></td><td>for UserID - see below for explanation</td></tr><tr><tdstyle="text-align: center;"><code>PGID=1000</code></td><td>for GroupID - see below for explanation</td></tr><tr><tdstyle="text-align: center;"><code>TZ=Etc/UTC</code></td><td>specify a timezone to use, see this <ahref=https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List>list</a>.</td></tr><tr><tdstyle="text-align: center;"><code>APP_URL=yourbaseurl</code></td><td>for specifying the IP:port or URL your application will be accessed on (ie. <code>http://192.168.1.1:6875</code> or <code>https://bookstack.mydomain.com</code></td></tr><tr><tdstyle="text-align: center;"><code>DB_HOST=yourdbhost</code></td><td>for specifying the database host</td></tr><tr><tdstyle="text-align: center;"><code>DB_PORT=yourdbport</code></td><td>for specifying the database port if not default 3306</td></tr><tr><tdstyle="text-align: center;"><code>DB_USER=yourdbuser</code></td><td>for specifying the database user</td></tr><tr><tdstyle="text-align: center;"><code>DB_PASS=yourdbpass</code></td><td>for specifying the database password (minimum 4 characters & non-alphanumeric passwords must be properly escaped.)</td></tr><tr><tdstyle="text-align: center;"><code>DB_DATABASE=bookstackapp</code></td><td>for specifying the database to be used</td></tr><tr><tdstyle="text-align: center;"><code>QUEUE_CONNECTION=</code></td><td>Set to <code>database</code> to enable async actions like sending email or triggering webhooks. See <ahref=https://www.bookstackapp.com/docs/admin/email-webhooks/#async-action-handling>documentation</a>.</td></tr></tbody></table><h3id=volume-mappings-v>Volume Mappings (<code>-v</code>)<aclass=headerlinkhref=#volume-mappings-vtitle="Permanent link">¶</a></h3><table><thead><tr><thstyle="text-align: center;">Volume</th><th>Function</th></tr></thead><tbody><tr><tdstyle="text-align: center;"><code>/config</code></td><td>this will store any uploaded data on the docker host</td></tr></tbody></table><h4id=miscellaneous-options>Miscellaneous Options<aclass=headerlinkhref=#miscellaneous-optionstitle="Permanent link">¶</a></h4><table><thead><tr><thstyle="text-align: center;">Parameter</th><th>Function</th></tr></thead><tbody><tr><td></td><td></td></tr></tbody></table><h2id=environment-variables-from-files-docker-secrets>Environment variables from files (Docker secrets)<aclass=headerlinkhref=#environment-variables-from-files-docker-secretstitle="Permanent link">¶</a></h2><p>You can set any environment variable from a file by using a special prepend <code>FILE__</code>.</p><p>As an example:</p><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-2-1><aid=__codelineno-2-1name=__codelineno-2-1href=#__codelineno-2-1></a>-e<spanclass=w></span><spa
</span></code></pre></div><p>Will set the environment variable <code>MYVAR</code> based on the contents of the <code>/run/secrets/mysecretvariable</code> file.</p><h2id=umask-for-running-applications>Umask for running applications<aclass=headerlinkhref=#umask-for-running-applicationstitle="Permanent link">¶</a></h2><p>For all of our images we provide the ability to override the default umask settings for services started within the containers using the optional <code>-e UMASK=022</code> setting. Keep in mind umask is not chmod it subtracts from permissions based on it's value it does not add. Please read up <ahref=https://en.wikipedia.org/wiki/Umask>here</a> before asking for support.</p><h2id=user-group-identifiers>User / Group Identifiers<aclass=headerlinkhref=#user-group-identifierstitle="Permanent link">¶</a></h2><p>When using volumes (<code>-v</code> flags), permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user <code>PUID</code> and group <code>PGID</code>.</p><p>Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.</p><p>In this instance <code>PUID=1000</code> and <code>PGID=1000</code>, to find yours use <code>id your_user</code> as below:</p><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-3-1><aid=__codelineno-3-1name=__codelineno-3-1href=#__codelineno-3-1></a>id<spanclass=w></span>your_user
</span></code></pre></div><h2id=docker-mods>Docker Mods<aclass=headerlinkhref=#docker-modstitle="Permanent link">¶</a></h2><p><ahref="https://mods.linuxserver.io/?mod=bookstack"title="view available mods for this container."><imgalt="Docker Mods"src="https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=bookstack&query=%24.mods%5B%27bookstack%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml"></a><ahref="https://mods.linuxserver.io/?mod=universal"title="view available universal mods."><imgalt="Docker Universal Mods"src="https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=universal&query=%24.mods%5B%27universal%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml"></a></p><p>We publish various <ahref=https://github.com/linuxserver/docker-mods>Docker Mods</a> to enable additional functionality within the containers. The list of Mods available for this image (if any) as well as universal mods that can be applied to any one of our images can be accessed via the dynamic badges above.</p><h2id=support-info>Support Info<aclass=headerlinkhref=#support-infotitle="Permanent link">¶</a></h2><ul><li><p>Shell access whilst the container is running:</p><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-5-1><aid=__codelineno-5-1name=__codelineno-5-1href=#__codelineno-5-1></a>docker<spanclass=w></span><spanclass=nb>exec</span><spanclass=w></span>-it<spanclass=w></span>bookstack<spanclass=w></span>/bin/bash
</span></code></pre></div></li><li><p>To monitor the logs of the container in realtime:</p><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-6-1><aid=__codelineno-6-1name=__codelineno-6-1href=#__codelineno-6-1></a>docker<spanclass=w></span>logs<spanclass=w></span>-f<spanclass=w></span>bookstack
</span></code></pre></div></li><li><p>Container version number:</p><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-7-1><aid=__codelineno-7-1name=__codelineno-7-1href=#__codelineno-7-1></a>docker<spanclass=w></span>inspect<spanclass=w></span>-f<spanclass=w></span><spanclass=s1>'{{ index .Config.Labels "build_version" }}'</span><spanclass=w></span>bookstack
</span></code></pre></div></li><li><p>Image version number:</p><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-8-1><aid=__codelineno-8-1name=__codelineno-8-1href=#__codelineno-8-1></a>docker<spanclass=w></span>inspect<spanclass=w></span>-f<spanclass=w></span><spanclass=s1>'{{ index .Config.Labels "build_version" }}'</span><spanclass=w></span>lscr.io/linuxserver/bookstack:latest
</span></code></pre></div></li></ul><h2id=updating-info>Updating Info<aclass=headerlinkhref=#updating-infotitle="Permanent link">¶</a></h2><p>Most of our images are static, versioned, and require an image update and container recreation to update the app inside. With some exceptions (ie. nextcloud, plex), we do not recommend or support updating apps inside the container. Please consult the <ahref=#application-setup>Application Setup</a> section above to see if it is recommended for the image.</p><p>Below are the instructions for updating containers:</p><h3id=via-docker-compose>Via Docker Compose<aclass=headerlinkhref=#via-docker-composetitle="Permanent link">¶</a></h3><ul><li><p>Update images:</p><ul><li><p>All images:</p><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-9-1><aid=__codelineno-9-1name=__codelineno-9-1href=#__codelineno-9-1></a>docker-compose<spanclass=w></span>pull
</span></code></pre></div></li></ul></li><li><p>You can also remove the old dangling images:</p><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-13-1><aid=__codelineno-13-1name=__codelineno-13-1href=#__codelineno-13-1></a>docker<spanclass=w></span>image<spanclass=w></span>prune
</span></code></pre></div></li></ul><h3id=via-docker-run>Via Docker Run<aclass=headerlinkhref=#via-docker-runtitle="Permanent link">¶</a></h3><ul><li><p>Update the image:</p><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-14-1><aid=__codelineno-14-1name=__codelineno-14-1href=#__codelineno-14-1></a>docker<spanclass=w></span>pull<spanclass=w></span>lscr.io/linuxserver/bookstack:latest
</span></code></pre></div></li><li><p>Stop the running container:</p><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-15-1><aid=__codelineno-15-1name=__codelineno-15-1href=#__codelineno-15-1></a>docker<spanclass=w></span>stop<spanclass=w></span>bookstack
</span></code></pre></div></li><li><p>Delete the container:</p><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-16-1><aid=__codelineno-16-1name=__codelineno-16-1href=#__codelineno-16-1></a>docker<spanclass=w></span>rm<spanclass=w></span>bookstack
</span></code></pre></div></li><li><p>Recreate a new container with the same docker run parameters as instructed above (if mapped correctly to a host folder, your <code>/config</code> folder and settings will be preserved)</p></li><li><p>You can also remove the old dangling images:</p><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-17-1><aid=__codelineno-17-1name=__codelineno-17-1href=#__codelineno-17-1></a>docker<spanclass=w></span>image<spanclass=w></span>prune
</span></code></pre></div></li></ul><h3id=via-watchtower-auto-updater-only-use-if-you-dont-remember-the-original-parameters>Via Watchtower auto-updater (only use if you don't remember the original parameters)<aclass=headerlinkhref=#via-watchtower-auto-updater-only-use-if-you-dont-remember-the-original-parameterstitle="Permanent link">¶</a></h3><ul><li><p>Pull the latest image at its tag and replace it with the same env variables in one run:</p><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-18-1><aid=__codelineno-18-1name=__codelineno-18-1href=#__codelineno-18-1></a>docker<spanclass=w></span>run<spanclass=w></span>--rm<spanclass=w></span><spanclass=se>\</span>
</span></code></pre></div></li><li><p>You can also remove the old dangling images: <code>docker image prune</code></p></li></ul><divclass="admonition warning"><pclass=admonition-title>Warning</p><p>We do not endorse the use of Watchtower as a solution to automated updates of existing Docker containers. In fact we generally discourage automated updates. However, this is a useful tool for one-time manual updates of containers where you have forgotten the original parameters. In the long term, we highly recommend using <ahref=https://docs.linuxserver.io/general/docker-compose>Docker Compose</a>.</p></div><h3id=image-update-notifications-diun-docker-image-update-notifier>Image Update Notifications - Diun (Docker Image Update Notifier)<aclass=headerlinkhref=#image-update-notifications-diun-docker-image-update-notifiertitle="Permanent link">¶</a></h3><divclass="admonition tip"><pclass=admonition-title>Tip</p><p>We recommend <ahref=https://crazymax.dev/diun/>Diun</a> for update notifications. Other tools that automatically update containers unattended are not recommended or supported.</p></div><h2id=building-locally>Building locally<aclass=headerlinkhref=#building-locallytitle="Permanent link">¶</a></h2><p>If you want to make local modifications to these images for development purposes or just to customize the logic:</p><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-19-1><aid=__codelineno-19-1name=__codelineno-19-1href=#__codelineno-19-1></a>git<spanclass=w></span>clone<spanclass=w></span>https://github.com/linuxserver/docker-bookstack.git
</span></code></pre></div><p>The ARM variants can be built on x86_64 hardware using <code>multiarch/qemu-user-static</code></p><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-20-1><aid=__codelineno-20-1name=__codelineno-20-1href=#__codelineno-20-1></a>docker<spanclass=w></span>run<spanclass=w></span>--rm<spanclass=w></span>--privileged<spanclass=w></span>multiarch/qemu-user-static:register<spanclass=w></span>--reset
</span></code></pre></div><p>Once registered you can define the dockerfile to use with <code>-f Dockerfile.aarch64</code>.</p><h2id=versions>Versions<aclass=headerlinkhref=#versionstitle="Permanent link">¶</a></h2><ul><li><strong>31.10.23:</strong> - Further sanitize sed replace.</li><li><strong>07.06.23:</strong> - Add mariadb-client for bookstack-system-cli support.</li><li><strong>25.05.23:</strong> - Rebase to Alpine 3.18, deprecate armhf.</li><li><strong>13.04.23:</strong> - Move ssl.conf include to default.conf.</li><li><strong>01.03.23:</strong> - Add php iconv.</li><li><strong>19.01.23:</strong> - Rebase to alpine 3.17 with php8.1.</li><li><strong>16.01.23:</strong> - Wrap <code>.env</code> values in quotes.</li><li><strong>05.01.23:</strong> - Fix db password setting (sed escape <code>&</code>).</li><li><strong>21.12.22:</strong> - Update db info in .env file when env vars are updated.</li><li><strong>10.10.22:</strong> - Remove password escape logic which caused problems for a small subset of users.</li><li><strong>20.08.22:</strong> - Rebasing to alpine 3.15 with php8. Restructure nginx configs (<ahref=https://info.linuxserver.io/issues/2022-08-20-nginx-base>see changes announcement</a>).</li><li><strong>14.03.22:</strong> - Add symlinks for theme support.</li><li><strong>11.07.21:</strong> - Rebase to Alpine 3.14.</li><li><strong>12.01.21:</strong> - Remove unused requirement, as of release 0.31.0.</li><li><strong>17.12.20:</strong> - Make APP_URL var required (upstream changes).</li><li><strong>17.09.20:</strong> - Rebase to alpine 3.12. Fix APP_URL setting. Bump php post max and upload max filesizes to 100MB by default.</li><li><strong>19.12.19:</strong> - Rebasing to alpine 3.11.</li><li><strong>26.07.19:</strong> - Use old version of tidyhtml pending upstream fixes.</li><li><strong>28.06.19:</strong> - Rebasing to alpine 3.10.</li><li><strong>14.06.19:</strong> - Add wkhtmltopdf to image for PDF rendering.</li><li><strong>20.04.19:</strong> - Rebase to Alpine 3.9, add MySQL init logic.</li><li><strong>22.03.19:</strong> - Switching to new Base images, shift to arm32v7 tag.</li><li><strong>20.01.19:</strong> - Added php7-curl</li><li><strong>04.11.18:</strong> - Added php7-ldap</li><li><strong>15.10.18:</strong> - Changed functionality for advanced users</li><li><strong>08.10.18:</strong> - Advanced mode, symlink changes, sed fixing, docs updated, added some composer files</li><li><strong>23.09.28:</strong> - Updates pre-release</li><li><strong>02.07.18:</strong> - Initial Release.</li></ul><hr><divclass=md-source-file><small> Last update: <spanclass="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">November 17, 2023</span><br> Created: <spanclass="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">January 27, 2019</span></small></div></article></div></div><buttontype=buttonclass="md-top md-icon"data-md-component=tophidden><svgxmlns=http://www.w3.org/2000/svgviewbox="0 0 24 24"><pathd="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12Z"/></svg> Back to top </button></main><footerclass=md-footer><navclass="md-footer__inner md-grid"aria-label=Footer><ahref=../docker-booksonic-air/class="md-footer__link md-footer__link--prev"aria-label="Previous: booksonic-air"><divclass="md-footer__button md-icon"><svgxmlns=http://www.w3.org/2000/svgviewbox="0 0 24 24"><pathd="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg></div><divclass=md-footer__title><spanclass=md-footer__direction> Previous </span><divclass=md-ellipsis> booksonic-air </div></div></a><ahref=../docker-budge/class="md-footer__link md-footer__link--next"aria-label="Next: budge"><divclass=md-footer__title><spanclass=md-footer__direction> Next </span><divclass=md-ellipsis> budge </div></div><divclass="md-footer__button md-icon"><svgxmlns=http://www.w3.org/2000/svgviewbox="0 0 24 24"><pathd="M411v2h12l-5.55.51.421.42L19.8412l-7.92-7.92L10.55.51611H4Z