1 # Full list of environment variables that can be used with BookStack.
2 # Selectively copy these to your '.env' file as required.
3 # Each option is shown with it's default value.
4 # Do not copy this whole file to use as your '.env' file.
6 # The details here only serve as a quick reference.
7 # Please refer to the BookStack documentation for full details:
8 # https://www.bookstackapp.com/docs/
10 # Application environment
11 # Can be 'production', 'development', 'testing' or 'demo'
15 # Shows advanced debug information and errors.
16 # CAN EXPOSE OTHER VARIABLES, LEAVE DISABLED
20 # Used for encryption where needed.
21 # Run `php artisan key:generate` to generate a valid key.
22 APP_KEY=SomeRandomString
25 # This must be the root URL that you want to host BookStack on.
26 # All URL's in BookStack will be generated using this value.
27 APP_URL=https://example.com
29 # Application default language
30 # The default language choice to show.
31 # May be overridden by user-preference or visitor browser settings.
34 # Auto-detect language for public visitors.
35 # Uses browser-sent headers to infer a language.
36 # APP_LANG will be used if such a header is not provided.
37 APP_AUTO_LANG_PUBLIC=true
39 # Application timezones
40 # The first option is used to determine what timezone is used for date storage.
41 # Leaving that as "UTC" is advised.
42 # The second option is used to set the timezone which will be used for date
43 # formatting and display. This defaults to the "APP_TIMEZONE" value.
44 # Valid timezone values can be found here: https://www.php.net/manual/en/timezones.php
46 APP_DISPLAY_TIMEZONE=UTC
49 # Used to specific a themes/<APP_THEME> folder where BookStack UI
50 # overrides can be made. Defaults to disabled.
54 # Used to indicate trust of systems that proxy to the application so
55 # certain header values (Such as "X-Forwarded-For") can be used from the
56 # incoming proxy request to provide origin detail.
57 # Set to an IP address, or multiple comma seperated IP addresses.
58 # Can alternatively be set to "*" to trust all proxy addresses.
62 # Host can contain a port (localhost:3306) or a separate DB_PORT option can be used.
63 # An ipv6 address can be used via the square bracket format ([::1]).
66 DB_DATABASE=database_database
67 DB_USERNAME=database_username
68 DB_PASSWORD=database_user_password
70 # MySQL specific connection options
71 # Path to Certificate Authority (CA) certificate file for your MySQL instance.
72 # When this option is used host name identity verification will be performed
73 # which checks the hostname, used by the client, against names within the
74 # certificate itself (Common Name or Subject Alternative Name).
75 MYSQL_ATTR_SSL_CA="/path/to/ca.pem"
78 # Refer to https://www.bookstackapp.com/docs/admin/email-webhooks/#email-configuration
80 MAIL_FROM=bookstack@example.com
81 MAIL_FROM_NAME=BookStack
90 MAIL_SENDMAIL_COMMAND="/usr/sbin/sendmail -bs"
92 # Cache & Session driver to use
93 # Can be 'file', 'database', 'memcached' or 'redis'
97 # Session configuration
99 SESSION_COOKIE_NAME=bookstack_session
100 SESSION_SECURE_COOKIE=false
103 # Can be used to prevent conflicts multiple BookStack instances use the same store.
104 CACHE_PREFIX=bookstack
106 # Memcached server configuration
107 # If using a UNIX socket path for the host, set the port to 0
108 # This follows the following format: HOST:PORT:WEIGHT
109 # For multiple servers separate with a comma
110 MEMCACHED_SERVERS=127.0.0.1:11211:100
112 # Redis server configuration
113 # This follows the following format: HOST:PORT:DATABASE
114 # or, if using a password: HOST:PORT:DATABASE:PASSWORD
115 # For multiple servers separate with a comma. These will be clustered.
116 REDIS_SERVERS=127.0.0.1:6379:0
118 # Queue driver to use
119 # Can be 'sync', 'database' or 'redis'
120 QUEUE_CONNECTION=sync
122 # Storage system to use
123 # Can be 'local', 'local_secure' or 's3'
126 # Image storage system to use
127 # Defaults to the value of STORAGE_TYPE if unset.
128 # Accepts the same values as STORAGE_TYPE.
129 STORAGE_IMAGE_TYPE=local
131 # Attachment storage system to use
132 # Defaults to the value of STORAGE_TYPE if unset.
133 # Accepts the same values as STORAGE_TYPE although 'local' will be forced to 'local_secure'.
134 STORAGE_ATTACHMENT_TYPE=local_secure
136 # Amazon S3 storage configuration
137 STORAGE_S3_KEY=your-s3-key
138 STORAGE_S3_SECRET=your-s3-secret
139 STORAGE_S3_BUCKET=s3-bucket-name
140 STORAGE_S3_REGION=s3-bucket-region
142 # S3 endpoint to use for storage calls
143 # Only set this if using a non-Amazon s3-compatible service such as Minio
144 STORAGE_S3_ENDPOINT=https://my-custom-s3-compatible.service.com:8001
147 # Used as a base for any generated image urls.
148 # An s3-format URL will be generated if not set.
151 # Authentication method to use
152 # Can be 'standard', 'ldap', 'saml2' or 'oidc'
155 # Automatically initiate login via external auth system if it's the only auth method.
156 # Works with saml2 or oidc auth methods.
157 AUTH_AUTO_INITIATE=false
159 # Social authentication configuration
160 # All disabled by default.
161 # Refer to https://www.bookstackapp.com/docs/admin/third-party-auth/
164 AZURE_APP_SECRET=false
166 AZURE_AUTO_REGISTER=false
167 AZURE_AUTO_CONFIRM_EMAIL=false
170 DISCORD_APP_SECRET=false
171 DISCORD_AUTO_REGISTER=false
172 DISCORD_AUTO_CONFIRM_EMAIL=false
174 FACEBOOK_APP_ID=false
175 FACEBOOK_APP_SECRET=false
176 FACEBOOK_AUTO_REGISTER=false
177 FACEBOOK_AUTO_CONFIRM_EMAIL=false
180 GITHUB_APP_SECRET=false
181 GITHUB_AUTO_REGISTER=false
182 GITHUB_AUTO_CONFIRM_EMAIL=false
185 GITLAB_APP_SECRET=false
186 GITLAB_BASE_URI=false
187 GITLAB_AUTO_REGISTER=false
188 GITLAB_AUTO_CONFIRM_EMAIL=false
191 GOOGLE_APP_SECRET=false
192 GOOGLE_SELECT_ACCOUNT=false
193 GOOGLE_AUTO_REGISTER=false
194 GOOGLE_AUTO_CONFIRM_EMAIL=false
198 OKTA_APP_SECRET=false
199 OKTA_AUTO_REGISTER=false
200 OKTA_AUTO_CONFIRM_EMAIL=false
203 SLACK_APP_SECRET=false
204 SLACK_AUTO_REGISTER=false
205 SLACK_AUTO_CONFIRM_EMAIL=false
208 TWITCH_APP_SECRET=false
209 TWITCH_AUTO_REGISTER=false
210 TWITCH_AUTO_CONFIRM_EMAIL=false
213 TWITTER_APP_SECRET=false
214 TWITTER_AUTO_REGISTER=false
215 TWITTER_AUTO_CONFIRM_EMAIL=false
217 # LDAP authentication configuration
218 # Refer to https://www.bookstackapp.com/docs/admin/ldap-auth/
223 LDAP_USER_FILTER="(&(uid={user}))"
226 LDAP_TLS_INSECURE=false
227 LDAP_TLS_CA_CERT=false
228 LDAP_ID_ATTRIBUTE=uid
229 LDAP_EMAIL_ATTRIBUTE=mail
230 LDAP_DISPLAY_NAME_ATTRIBUTE=cn
231 LDAP_THUMBNAIL_ATTRIBUTE=null
232 LDAP_FOLLOW_REFERRALS=true
233 LDAP_DUMP_USER_DETAILS=false
235 # LDAP group sync configuration
236 # Refer to https://www.bookstackapp.com/docs/admin/ldap-auth/
237 LDAP_USER_TO_GROUPS=false
238 LDAP_GROUP_ATTRIBUTE="memberOf"
239 LDAP_REMOVE_FROM_GROUPS=false
240 LDAP_DUMP_USER_GROUPS=false
242 # SAML authentication configuration
243 # Refer to https://www.bookstackapp.com/docs/admin/saml2-auth/
245 SAML2_EMAIL_ATTRIBUTE=email
246 SAML2_DISPLAY_NAME_ATTRIBUTES=username
247 SAML2_EXTERNAL_ID_ATTRIBUTE=null
248 SAML2_IDP_ENTITYID=null
252 SAML2_ONELOGIN_OVERRIDES=null
253 SAML2_DUMP_USER_DETAILS=false
254 SAML2_AUTOLOAD_METADATA=false
255 SAML2_IDP_AUTHNCONTEXT=true
257 SAML2_SP_x509_KEY=null
259 # SAML group sync configuration
260 # Refer to https://www.bookstackapp.com/docs/admin/saml2-auth/
261 SAML2_USER_TO_GROUPS=false
262 SAML2_GROUP_ATTRIBUTE=group
263 SAML2_REMOVE_FROM_GROUPS=false
265 # OpenID Connect authentication configuration
266 # Refer to https://www.bookstackapp.com/docs/admin/oidc-auth/
268 OIDC_DISPLAY_NAME_CLAIMS=name
270 OIDC_CLIENT_SECRET=null
272 OIDC_ISSUER_DISCOVER=false
274 OIDC_AUTH_ENDPOINT=null
275 OIDC_TOKEN_ENDPOINT=null
276 OIDC_USERINFO_ENDPOINT=null
277 OIDC_ADDITIONAL_SCOPES=null
278 OIDC_DUMP_USER_DETAILS=false
279 OIDC_USER_TO_GROUPS=false
280 OIDC_GROUPS_CLAIM=groups
281 OIDC_REMOVE_FROM_GROUPS=false
282 OIDC_EXTERNAL_ID_CLAIM=sub
283 OIDC_END_SESSION_ENDPOINT=false
285 # Disable default third-party services such as Gravatar and Draw.IO
286 # Service-specific options will override this option
287 DISABLE_EXTERNAL_SERVICES=false
289 # Use custom avatar service, Sets fetch URL
290 # Possible placeholders: ${hash} ${size} ${email}
291 # If set, Avatars will be fetched regardless of DISABLE_EXTERNAL_SERVICES option.
292 # Example: AVATAR_URL=https://seccdn.libravatar.org/avatar/${hash}?s=${size}&d=identicon
295 # Enable diagrams.net integration
296 # Can simply be true/false to enable/disable the integration.
297 # Alternatively, It can be URL to the diagrams.net instance you want to use.
298 # For URLs, The following URL parameters should be included: embed=1&proto=json&spin=1&configure=1
301 # Default item listing view
302 # Used for public visitors and user's without a preference.
303 # Can be 'list' or 'grid'.
305 APP_VIEWS_BOOKSHELVES=grid
306 APP_VIEWS_BOOKSHELF=grid
308 # Use dark mode by default
309 # Will be overriden by any user/session preference.
310 APP_DEFAULT_DARK_MODE=false
312 # Page revision limit
313 # Number of page revisions to keep in the system before deleting old revisions.
314 # If set to 'false' a limit will not be enforced.
317 # Recycle Bin Lifetime
318 # The number of days that content will remain in the recycle bin before
319 # being considered for auto-removal. It is not a guarantee that content will
320 # be removed after this time.
321 # Set to 0 for no recycle bin functionality.
322 # Set to -1 for unlimited recycle bin lifetime.
323 RECYCLE_BIN_LIFETIME=30
326 # Maximum file size, in megabytes, that can be uploaded to the system.
327 FILE_UPLOAD_SIZE_LIMIT=50
330 # Primarily used to determine page size of PDF exports.
331 # Can be 'a4' or 'letter'.
335 # Set a command which can be used to convert a HTML file into a PDF file.
336 # When false this will not be used.
337 # String values represent the command to be called for conversion.
338 # Supports '{input_html_path}' and '{output_pdf_path}' placeholder values.
339 # Example: EXPORT_PDF_COMMAND="/scripts/convert.sh {input_html_path} {output_pdf_path}"
340 EXPORT_PDF_COMMAND=false
342 # Export PDF Command Timeout
343 # The number of seconds that the export PDF command will run before a timeout occurs.
344 # Only applies for the EXPORT_PDF_COMMAND option, not for DomPDF or wkhtmltopdf.
345 EXPORT_PDF_COMMAND_TIMEOUT=15
347 # Set path to wkhtmltopdf binary for PDF generation.
348 # Can be 'false' or a path path like: '/home/bins/wkhtmltopdf'
349 # When false, BookStack will attempt to find a wkhtmltopdf in the application
350 # root folder then fall back to the default dompdf renderer if no binary exists.
351 # Only used if 'ALLOW_UNTRUSTED_SERVER_FETCHING=true' which disables security protections.
354 # Allow <script> tags in page content
355 # Note, if set to 'true' the page editor may still escape scripts.
356 ALLOW_CONTENT_SCRIPTS=false
358 # Indicate if robots/crawlers should crawl your instance.
359 # Can be 'true', 'false' or 'null'.
360 # The behaviour of the default 'null' option will depend on the 'app-public' admin setting.
361 # Contents of the robots.txt file can be overridden, making this option obsolete.
364 # Allow server-side fetches to be performed to potentially unknown
365 # and user-provided locations. Primarily used in exports when loading
366 # in externally referenced assets.
367 # Can be 'true' or 'false'.
368 ALLOW_UNTRUSTED_SERVER_FETCHING=false
370 # A list of hosts that BookStack can be iframed within.
371 # Space separated if multiple. BookStack host domain is auto-inferred.
372 # For Example: ALLOWED_IFRAME_HOSTS="https://example.com https://a.example.com"
373 # Setting this option will also auto-adjust cookies to be SameSite=None.
374 ALLOWED_IFRAME_HOSTS=null
376 # A list of sources/hostnames that can be loaded within iframes within BookStack.
377 # Space separated if multiple. BookStack host domain is auto-inferred.
378 # Can be set to a lone "*" to allow all sources for iframe content (Not advised).
379 # Defaults to a set of common services.
380 # Current host and source for the "DRAWIO" setting will be auto-appended to the sources configured.
381 ALLOWED_IFRAME_SOURCES="https://*.draw.io https://*.youtube.com https://*.youtube-nocookie.com https://*.vimeo.com"
383 # A list of the sources/hostnames that can be reached by application SSR calls.
384 # This is used wherever users can provide URLs/hosts in-platform, like for webhooks.
385 # Host-specific functionality (usually controlled via other options) like auth
386 # or user avatars for example, won't use this list.
387 # Space seperated if multiple. Can use '*' as a wildcard.
388 # Values will be compared prefix-matched, case-insensitive, against called SSR urls.
389 # Defaults to allow all hosts.
390 ALLOWED_SSR_HOSTS="*"
392 # The default and maximum item-counts for listing API requests.
393 API_DEFAULT_ITEM_COUNT=100
394 API_MAX_ITEM_COUNT=500
396 # The number of API requests that can be made per minute by a single user.
397 API_REQUESTS_PER_MIN=180
399 # Enable the logging of failed email+password logins with the given message.
400 # The default log channel below uses the php 'error_log' function which commonly
401 # results in messages being output to the webserver error logs.
402 # The message can contain a %u parameter which will be replaced with the login
403 # user identifier (Username or email).
404 LOG_FAILED_LOGIN_MESSAGE=false
405 LOG_FAILED_LOGIN_CHANNEL=errorlog_plain_webserver
407 # Alter the precision of IP addresses stored by BookStack.
408 # Should be a number between 0 and 4, where 4 retains the full IP address
409 # and 0 completely hides the IP address. As an example, a value of 2 for the
410 # IP address '146.191.42.4' would result in '146.191.x.x' being logged.
411 # For the IPv6 address '2001:db8:85a3:8d3:1319:8a2e:370:7348' this would result as:
412 # '2001:db8:85a3:8d3:x:x:x:x'
413 IP_ADDRESS_PRECISION=4