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 timezone
40 # Used where dates are displayed such as on exported content.
41 # Valid timezone values can be found here: https://www.php.net/manual/en/timezones.php
45 # Used to specific a themes/<APP_THEME> folder where BookStack UI
46 # overrides can be made. Defaults to disabled.
50 # Used to indicate trust of systems that proxy to the application so
51 # certain header values (Such as "X-Forwarded-For") can be used from the
52 # incoming proxy request to provide origin detail.
53 # Set to an IP address, or multiple comma seperated IP addresses.
54 # Can alternatively be set to "*" to trust all proxy addresses.
58 # Host can contain a port (localhost:3306) or a separate DB_PORT option can be used.
61 DB_DATABASE=database_database
62 DB_USERNAME=database_username
63 DB_PASSWORD=database_user_password
65 # MySQL specific connection options
66 # Path to Certificate Authority (CA) certificate file for your MySQL instance.
67 # When this option is used host name identity verification will be performed
68 # which checks the hostname, used by the client, against names within the
69 # certificate itself (Common Name or Subject Alternative Name).
70 MYSQL_ATTR_SSL_CA="/path/to/ca.pem"
73 # Can be 'smtp' or 'sendmail'
76 # Mail sending options
78 MAIL_FROM_NAME=BookStack
88 # Command to use when email is sent via sendmail
89 MAIL_SENDMAIL_COMMAND="/usr/sbin/sendmail -bs"
91 # Cache & Session driver to use
92 # Can be 'file', 'database', 'memcached' or 'redis'
96 # Session configuration
98 SESSION_COOKIE_NAME=bookstack_session
99 SESSION_SECURE_COOKIE=false
102 # Can be used to prevent conflicts multiple BookStack instances use the same store.
103 CACHE_PREFIX=bookstack
105 # Memcached server configuration
106 # If using a UNIX socket path for the host, set the port to 0
107 # This follows the following format: HOST:PORT:WEIGHT
108 # For multiple servers separate with a comma
109 MEMCACHED_SERVERS=127.0.0.1:11211:100
111 # Redis server configuration
112 # This follows the following format: HOST:PORT:DATABASE
113 # or, if using a password: HOST:PORT:DATABASE:PASSWORD
114 # For multiple servers separate with a comma. These will be clustered.
115 REDIS_SERVERS=127.0.0.1:6379:0
117 # Queue driver to use
118 # Can be 'sync', 'database' or 'redis'
119 QUEUE_CONNECTION=sync
121 # Storage system to use
122 # Can be 'local', 'local_secure' or 's3'
125 # Image storage system to use
126 # Defaults to the value of STORAGE_TYPE if unset.
127 # Accepts the same values as STORAGE_TYPE.
128 STORAGE_IMAGE_TYPE=local
130 # Attachment storage system to use
131 # Defaults to the value of STORAGE_TYPE if unset.
132 # Accepts the same values as STORAGE_TYPE although 'local' will be forced to 'local_secure'.
133 STORAGE_ATTACHMENT_TYPE=local_secure
135 # Amazon S3 storage configuration
136 STORAGE_S3_KEY=your-s3-key
137 STORAGE_S3_SECRET=your-s3-secret
138 STORAGE_S3_BUCKET=s3-bucket-name
139 STORAGE_S3_REGION=s3-bucket-region
141 # S3 endpoint to use for storage calls
142 # Only set this if using a non-Amazon s3-compatible service such as Minio
143 STORAGE_S3_ENDPOINT=https://my-custom-s3-compatible.service.com:8001
146 # Used as a base for any generated image urls.
147 # An s3-format URL will be generated if not set.
150 # Authentication method to use
151 # Can be 'standard', 'ldap', 'saml2' or 'oidc'
154 # Automatically initiate login via external auth system if it's the only auth method.
155 # Works with saml2 or oidc auth methods.
156 AUTH_AUTO_INITIATE=false
158 # Social authentication configuration
159 # All disabled by default.
160 # Refer to https://www.bookstackapp.com/docs/admin/third-party-auth/
163 AZURE_APP_SECRET=false
165 AZURE_AUTO_REGISTER=false
166 AZURE_AUTO_CONFIRM_EMAIL=false
169 DISCORD_APP_SECRET=false
170 DISCORD_AUTO_REGISTER=false
171 DISCORD_AUTO_CONFIRM_EMAIL=false
173 FACEBOOK_APP_ID=false
174 FACEBOOK_APP_SECRET=false
175 FACEBOOK_AUTO_REGISTER=false
176 FACEBOOK_AUTO_CONFIRM_EMAIL=false
179 GITHUB_APP_SECRET=false
180 GITHUB_AUTO_REGISTER=false
181 GITHUB_AUTO_CONFIRM_EMAIL=false
184 GITLAB_APP_SECRET=false
185 GITLAB_BASE_URI=false
186 GITLAB_AUTO_REGISTER=false
187 GITLAB_AUTO_CONFIRM_EMAIL=false
190 GOOGLE_APP_SECRET=false
191 GOOGLE_SELECT_ACCOUNT=false
192 GOOGLE_AUTO_REGISTER=false
193 GOOGLE_AUTO_CONFIRM_EMAIL=false
197 OKTA_APP_SECRET=false
198 OKTA_AUTO_REGISTER=false
199 OKTA_AUTO_CONFIRM_EMAIL=false
202 SLACK_APP_SECRET=false
203 SLACK_AUTO_REGISTER=false
204 SLACK_AUTO_CONFIRM_EMAIL=false
207 TWITCH_APP_SECRET=false
208 TWITCH_AUTO_REGISTER=false
209 TWITCH_AUTO_CONFIRM_EMAIL=false
212 TWITTER_APP_SECRET=false
213 TWITTER_AUTO_REGISTER=false
214 TWITTER_AUTO_CONFIRM_EMAIL=false
216 # LDAP authentication configuration
217 # Refer to https://www.bookstackapp.com/docs/admin/ldap-auth/
222 LDAP_USER_FILTER=false
225 LDAP_TLS_INSECURE=false
226 LDAP_ID_ATTRIBUTE=uid
227 LDAP_EMAIL_ATTRIBUTE=mail
228 LDAP_DISPLAY_NAME_ATTRIBUTE=cn
229 LDAP_THUMBNAIL_ATTRIBUTE=null
230 LDAP_FOLLOW_REFERRALS=true
231 LDAP_DUMP_USER_DETAILS=false
233 # LDAP group sync configuration
234 # Refer to https://www.bookstackapp.com/docs/admin/ldap-auth/
235 LDAP_USER_TO_GROUPS=false
236 LDAP_GROUP_ATTRIBUTE="memberOf"
237 LDAP_REMOVE_FROM_GROUPS=false
238 LDAP_DUMP_USER_GROUPS=false
240 # SAML authentication configuration
241 # Refer to https://www.bookstackapp.com/docs/admin/saml2-auth/
243 SAML2_EMAIL_ATTRIBUTE=email
244 SAML2_DISPLAY_NAME_ATTRIBUTES=username
245 SAML2_EXTERNAL_ID_ATTRIBUTE=null
246 SAML2_IDP_ENTITYID=null
250 SAML2_ONELOGIN_OVERRIDES=null
251 SAML2_DUMP_USER_DETAILS=false
252 SAML2_AUTOLOAD_METADATA=false
253 SAML2_IDP_AUTHNCONTEXT=true
255 SAML2_SP_x509_KEY=null
257 # SAML group sync configuration
258 # Refer to https://www.bookstackapp.com/docs/admin/saml2-auth/
259 SAML2_USER_TO_GROUPS=false
260 SAML2_GROUP_ATTRIBUTE=group
261 SAML2_REMOVE_FROM_GROUPS=false
263 # OpenID Connect authentication configuration
264 # Refer to https://www.bookstackapp.com/docs/admin/oidc-auth/
266 OIDC_DISPLAY_NAME_CLAIMS=name
268 OIDC_CLIENT_SECRET=null
270 OIDC_ISSUER_DISCOVER=false
272 OIDC_AUTH_ENDPOINT=null
273 OIDC_TOKEN_ENDPOINT=null
274 OIDC_ADDITIONAL_SCOPES=null
275 OIDC_DUMP_USER_DETAILS=false
276 OIDC_USER_TO_GROUPS=false
277 OIDC_GROUPS_CLAIM=groups
278 OIDC_REMOVE_FROM_GROUPS=false
279 OIDC_EXTERNAL_ID_CLAIM=sub
281 # Disable default third-party services such as Gravatar and Draw.IO
282 # Service-specific options will override this option
283 DISABLE_EXTERNAL_SERVICES=false
285 # Use custom avatar service, Sets fetch URL
286 # Possible placeholders: ${hash} ${size} ${email}
287 # If set, Avatars will be fetched regardless of DISABLE_EXTERNAL_SERVICES option.
288 # Example: AVATAR_URL=https://seccdn.libravatar.org/avatar/${hash}?s=${size}&d=identicon
291 # Enable diagrams.net integration
292 # Can simply be true/false to enable/disable the integration.
293 # Alternatively, It can be URL to the diagrams.net instance you want to use.
294 # For URLs, The following URL parameters should be included: embed=1&proto=json&spin=1&configure=1
297 # Default item listing view
298 # Used for public visitors and user's without a preference.
299 # Can be 'list' or 'grid'.
301 APP_VIEWS_BOOKSHELVES=grid
302 APP_VIEWS_BOOKSHELF=grid
304 # Use dark mode by default
305 # Will be overriden by any user/session preference.
306 APP_DEFAULT_DARK_MODE=false
308 # Page revision limit
309 # Number of page revisions to keep in the system before deleting old revisions.
310 # If set to 'false' a limit will not be enforced.
313 # Recycle Bin Lifetime
314 # The number of days that content will remain in the recycle bin before
315 # being considered for auto-removal. It is not a guarantee that content will
316 # be removed after this time.
317 # Set to 0 for no recycle bin functionality.
318 # Set to -1 for unlimited recycle bin lifetime.
319 RECYCLE_BIN_LIFETIME=30
322 # Maximum file size, in megabytes, that can be uploaded to the system.
323 FILE_UPLOAD_SIZE_LIMIT=50
326 # Primarily used to determine page size of PDF exports.
327 # Can be 'a4' or 'letter'.
330 # Set path to wkhtmltopdf binary for PDF generation.
331 # Can be 'false' or a path path like: '/home/bins/wkhtmltopdf'
332 # When false, BookStack will attempt to find a wkhtmltopdf in the application
333 # root folder then fall back to the default dompdf renderer if no binary exists.
334 # Only used if 'ALLOW_UNTRUSTED_SERVER_FETCHING=true' which disables security protections.
337 # Allow <script> tags in page content
338 # Note, if set to 'true' the page editor may still escape scripts.
339 ALLOW_CONTENT_SCRIPTS=false
341 # Indicate if robots/crawlers should crawl your instance.
342 # Can be 'true', 'false' or 'null'.
343 # The behaviour of the default 'null' option will depend on the 'app-public' admin setting.
344 # Contents of the robots.txt file can be overridden, making this option obsolete.
347 # Allow server-side fetches to be performed to potentially unknown
348 # and user-provided locations. Primarily used in exports when loading
349 # in externally referenced assets.
350 # Can be 'true' or 'false'.
351 ALLOW_UNTRUSTED_SERVER_FETCHING=false
353 # A list of hosts that BookStack can be iframed within.
354 # Space separated if multiple. BookStack host domain is auto-inferred.
355 # For Example: ALLOWED_IFRAME_HOSTS="https://example.com https://a.example.com"
356 # Setting this option will also auto-adjust cookies to be SameSite=None.
357 ALLOWED_IFRAME_HOSTS=null
359 # A list of sources/hostnames that can be loaded within iframes within BookStack.
360 # Space separated if multiple. BookStack host domain is auto-inferred.
361 # Can be set to a lone "*" to allow all sources for iframe content (Not advised).
362 # Defaults to a set of common services.
363 # Current host and source for the "DRAWIO" setting will be auto-appended to the sources configured.
364 ALLOWED_IFRAME_SOURCES="https://*.draw.io https://*.youtube.com https://*.youtube-nocookie.com https://*.vimeo.com"
366 # The default and maximum item-counts for listing API requests.
367 API_DEFAULT_ITEM_COUNT=100
368 API_MAX_ITEM_COUNT=500
370 # The number of API requests that can be made per minute by a single user.
371 API_REQUESTS_PER_MIN=180
373 # Enable the logging of failed email+password logins with the given message.
374 # The default log channel below uses the php 'error_log' function which commonly
375 # results in messages being output to the webserver error logs.
376 # The message can contain a %u parameter which will be replaced with the login
377 # user identifier (Username or email).
378 LOG_FAILED_LOGIN_MESSAGE=false
379 LOG_FAILED_LOGIN_CHANNEL=errorlog_plain_webserver
381 # Alter the precision of IP addresses stored by BookStack.
382 # Should be a number between 0 and 4, where 4 retains the full IP address
383 # and 0 completely hides the IP address. As an example, a value of 2 for the
384 # IP address '146.191.42.4' would result in '146.191.x.x' being logged.
385 # For the IPv6 address '2001:db8:85a3:8d3:1319:8a2e:370:7348' this would result as:
386 # '2001:db8:85a3:8d3:x:x:x:x'
387 IP_ADDRESS_PRECISION=4