Set up file storage
Mattermost requires a file storage system for storing user files, images, and attachments. Choose one of the following before you install, because moving between them later means migrating existing files:
- S3-compatible object storage (recommended)
- Network file storage
- Local file storage
For guidance on how much storage to provision, see backing storage benchmarks.
S3-compatible object storage (Recommended)
For production environments, we recommend using S3-compatible object storage such as:
- Amazon S3
- Digital Ocean Spaces
- Other S3-compatible services
When using S3 storage, you'll need:
- A bucket created specifically for Mattermost
- Access credentials (Access Key and Secret Key)
- Appropriate bucket policies configured
- The following information for configuration:
- Bucket name
- Region (if applicable)
- Access Key
- Secret Key
- Endpoint URL (for non-AWS S3 services)
You configure these values in System Console > Environment > File Storage. See the file storage configuration settings documentation for details.
Network file storage
For production environments that cannot use S3-compatible object storage, we recommend using a Network Addressable Storage (NAS) solution with Network File System (NFS).
You'll need to prepare an NFS server with a dedicated share for Mattermost (e.g. /mnt/mattermost_data) and mount it on all servers that will be running Mattermost.
Local file storage
For simple deployments, you can use local file storage. However, we don't recommend this for production environments or multi-node deployments, because the files aren't shared between application servers and aren't covered by a separate backup target.
-
Create a directory for file storage:
sudo mkdir -p /opt/mattermost/data -
Set appropriate permissions:
sudo chown -R mattermost:mattermost /opt/mattermost/data
Next steps
- Use an image proxy to keep clients from contacting third-party servers directly when they load external images.
- Set your encryption at rest approach for whichever storage system you chose.
- Return to the preparation checklist.