Change the maximum attachment/upload size

:bookmark: This guide explains how to change the maximum attachment upload size for self-hosted Discourse instances.

:person_raising_hand: 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

  1. Connect to your server:
  • Use SSH to access your server’s command line interface.
  1. Edit the configuration file:
  • Navigate to the configuration directory and edit the app.yml file:
cd /var/discourse/
nano containers/app.yml
  1. 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
  1. Save your changes:
  • Press Ctrl+X to exit, then Y to confirm, and Enter to save the changes.
  1. Rebuild the Discourse instance:
  • Run the following command from the /var/discourse directory:
./launcher rebuild app
  1. Update site settings:
  • Go to /admin/site_settings/category/files in your Discourse dashboard.
  • Adjust the max attachment size kb to 20480 (for 20 MB) or your preferred size.

Last edited by @SaraDev 2024-09-17T22:43:39Z

Check documentPerform check on document:
60 Likes