This guide explains how to change the maximum attachment upload size for self-hosted Discourse instances.
Required user level: System Admin
The default attachment upload size limit is 10MB
If you are self-hosting Discourse and need to allow uploads larger than 10 MB, follow the steps below.
Changing the upload size
- Connect to your server:
- Use SSH to access your server’s command line interface.
- Edit the configuration file:
- Navigate to the configuration directory and edit the
app.yml
file:
cd /var/discourse/
nano containers/app.yml
- Modify the upload parameters:
- Look for the section labeled
params
. Directly below, add your desired upload size with careful attention to formatting:
params:
## Which Git revision should this container use? (default: tests-passed)
version: tests-passed
## Maximum upload size (default: 10m)
upload_size: 20m
- Save your changes:
- Press
Ctrl+X
to exit, thenY
to confirm, andEnter
to save the changes.
- Rebuild the Discourse instance:
- Run the following command from the
/var/discourse
directory:
./launcher rebuild app
- Update site settings:
- Go to
/admin/site_settings/category/files
in your Discourse dashboard. - Adjust the
max attachment size kb
to20480
(for 20 MB) or your preferred size.
Last edited by @SaraDev 2024-09-17T22:43:39Z
Check document
Perform check on document: