Uploads to external storage

Hi all,

I’m trying to change the Discourse uploads location to an external storage location on my self-hosted instance due to space constraints. I have a CIFS share mounted and already copied all existing uploads with the same directory structure to the mounted location.

Then, I added the following lines to the app.yml:

- volumes:
  - volume:
      host: /<storage-location>/uploads
      guest: /shared/uploads

After rebuilding the container with ./launcher rebuild app (I’m the root user), the images are not visible anymore on the website. I appears that they all return a code 404.

I tried mounting the CIFS share as root:root and _default_hostname:www-data, but every time, images don’t show up.

What is the best (or correct) way to perform this change of locations for uploads?

Thanks in advance guys!

Here is what is the default:

volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared

You probably want something like this:

volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /your/cifs/share/discourse-uploads
      guest: /shared/uploads
1 Like