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

Why is the error message incorrect though? Here is my error message.

While trying to upload a 10mb file. The error message is incorrect.

1 Like

What kind of file was it? Are you able to upload other files to that site?

Sometimes there are browser issues during the upload process that cause temporary issues. Please try uploading your file again, in a new browser session.

2 Likes

Has this article not been updated for a long time? Why can’t I find “upload_size: 20m”???

1 Like

The first post was updated 5 days ago

The guide says you need to add that line. So, before adding it, you won’t find it. I added some formatting in the quote below. Does that help you?

5 Likes