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.ymlfile:
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: latest)
version: latest
## Maximum upload size (default: 10m)
upload_size: 20m
- Save your changes:
- Press
Ctrl+Xto exit, thenYto confirm, andEnterto save the changes.
- Rebuild the Discourse instance:
- Run the following command from the
/var/discoursedirectory:
./launcher rebuild app
- Update site settings:
- Go to
/admin/site_settings/category/filesin your Discourse dashboard. - Adjust
max attachment size kbandmax image size kbto your preferred size (e.g.20 MB). The setting UI allows you to enter the value and select a unit (KB, MB, or GB) from the dropdown.
Both settings are capped by the nginx client_max_body_size value, which is controlled by the upload_size param you set in step 3. The site settings cannot exceed this limit.
Last edited by @david 2025-09-29T13:05:48Z
Check document
Perform check on document: