Choosing Mattermost file storage: S3, NFS or local disk

Mattermost stores uploads, attachments and related files outside the database, and the backend you pick decides whether you can run high availability at all. This page compares S3-compatible object storage, NFS and local disk so you can choose before go-live.

On this page

Choosing Mattermost file storage before go-live

Before users arrive, you need to decide where Mattermost keeps uploaded files. The answer is S3-compatible object storage, an NFS share, or local disk on a single server, and the choice depends mainly on whether you will run a high availability cluster. File storage is separate from PostgreSQL: the database holds messages and metadata, while the file store holds the attachments themselves. Changing the backend after users have uploaded files means moving existing data, so settle this decision during planning rather than at go-live.

The high availability documentation requires shared file storage for a cluster. Each node must reach the same store, which can be Amazon S3, an S3-compatible service, or a NAS mounted on every node. Local file system storage will not work correctly in a cluster and risks corrupting files, so any multi-node design rules out local disk. If you plan to scale out later, choose shared storage now, because the high availability option is available only on the Enterprise and Enterprise Advanced plans. Confirm the plan level with your Mattermost account team before you commit to a design.

For a small single server, local disk is the simplest option, but it ties attachments to that host's disk capacity, backups and recovery. Confirm with your storage team how file backups will run alongside the database backups, and test a restore of both together. If you choose S3-compatible storage, confirm the endpoint, bucket, credentials and network path from every Mattermost node, and ask your provider which S3 API behaviors they support. Verify your choice against the Mattermost high availability documentation before you size the rest of the platform.

Which file storage backend fits which deployment

This table compares S3-compatible object storage, NFS or NAS, and local disk on fit, high availability support, operational burden and performance. Read the availability row first, because it decides which options remain open if you plan a high availability cluster. The performance rows show what you must measure on your own network before you commit.

Decision factorS3 or S3-compatible object storageNFS or NAS shareLocal disk
Single-server fitWorks for a single server, but adds an external service to run and secureWorks for a single server when the share is reachable and stableSimplest option for a small single server with one application node
High availability supportSupported for HA clusters, with shared storage mounted or reachable from each nodeSupported for HA clusters when the NAS is mounted on each nodeNot suitable for an HA cluster, because local file system storage will not work correctly and risks corrupting files
Operational burdenBucket, credential, lifecycle and encryption settings to manage, plus the storage service itself if self-hostedExport permissions, mount options, locking behavior and NAS availability to manageLowest setup effort, but backups and disk capacity become your responsibility
Network dependencyEvery upload and download crosses the network to the object store, so the network path mattersEvery file operation crosses the network to the NAS, which adds latency on each read and writeNo network hop for file access, but the server's disk is a single point of failure
Latency sensitivityRequest latency to the endpoint affects attachment upload and download times; measure it from each Mattermost nodeFile operations are sensitive to network latency and to how the NFS client handles caching and lockingLowest latency for file access on the same host
Scaling and capacityCapacity is managed by the object store, and storage grows independently of the application serversCapacity depends on the NAS, which may need its own growth planCapacity is limited by the disks in one server and must be expanded by hand
Backup and recoveryConfirm versioning, replication or backup of the bucket with the provider or storage teamBack up the share with the NAS tooling, and test restores of attachments alongside the databaseBack up the local directory on a schedule and test restores; there is no shared copy
Benchmark before go-liveTest upload, download and listing times from every node under expected concurrent useTest read and write throughput and latency under load, including file locking behaviorTest disk throughput and capacity growth on the target hardware

How the choice changes by environment

A single Mattermost server with one PostgreSQL database has the simplest file storage need. Local disk on the application server is the default and needs no shared service, but attachments then live on the same machine as the application, so the server's disk capacity, backup routine and restore procedure all govern how much history you can keep and how fast you can recover. Object storage or an NFS share can still be used here if the organization already runs one, which keeps uploads off the application host.

  • Capacity planning: Estimate attachment growth from your team's actual file sharing habits and watch disk usage from the first week, since the file store grows with every upload.
  • Backup scope: Confirm that your backup job captures the file directory or bucket along with the database, because a database restore without its files produces broken attachment links.
  • Restore time: Ask how long a full restore of files and database takes on your hardware, and test it before go-live.
  • Growth path: Decide now whether a later move to a high availability cluster is likely, because moving files later is more work than choosing a shared store early.
  • Proxy limits: Check how the reverse proxy handles large uploads so that file size limits match the storage you chose.

Before committing, confirm the expected attachment volume, the backup window and whether the site may need to grow into a cluster within the next few years.

When a self-hosted Ceph cluster can serve as the S3 backend

An organization without a cloud object store can still meet Mattermost's requirement for shared S3-compatible storage by running Ceph itself. The Ceph Object Gateway (RGW) exposes S3-compatible and Swift-compatible APIs, so each Mattermost node can point at the same bucket endpoint in the same way it would use Amazon S3 or another S3-compatible service. This option makes sense when your data centers already have the people and hardware to run a storage platform, and when policy keeps object data out of public cloud. Confirm with the Mattermost high availability documentation and your own test environment that the bucket settings, endpoint and credentials work for your Mattermost version before committing to the design.

Ceph's source is licensed under LGPL-2.1 or LGPL-3, and the project itself offers no paid edition, so license cost is zero. Any support contract, hardware, and staff time come from your budget or a vendor, not from the project. The maintained release lines are Tentacle (20.2.x) and Squid (19.2.x). According to the Ceph releases page, Tentacle's estimated end of life is June 1, 2027 and Squid's is October 31, 2026, so a cluster built on Squid will need an upgrade plan well before the Mattermost go-live date. Ask your Ceph operator which line you will run and when its next upgrade falls.

The Ceph hardware recommendations call for a dedicated drive per OSD, shared SSDs for WAL and DB on HDD-based OSDs, enterprise-class SSDs for metadata, and bonded network links across two switches. Size memory for peak use and benchmark before buying, because no two clusters behave alike. Ceph is a separate platform with its own monitors, managers, failure domains, backups and upgrades, so the storage team, not the Mattermost team, will carry most of the day-two work. Ask whether your organization has that capacity in the same way it would support a managed object store.

How to set up and verify the chosen file store

This sequence takes the storage decision from a documented requirement to a verified Mattermost file store that behaves the same on every node and survives a restart. Each step ends with a check you can record before go-live.

  1. Confirm the backend against HA and plan requirements

    Before touching any server, the platform owner and the security lead write down whether the deployment is a single server or a high availability cluster, and which plan level applies. Mattermost's high availability documentation requires shared file storage on Amazon S3, an S3-compatible service or NAS mounted on each node, and local file system storage will not work correctly and risks corrupting files. If the answer is a cluster, local disk is removed from the options at this point. Done when the decision record names one backend, the plan level, and the reason, and it has been signed off by the people who own the risk.

  2. Provision the bucket or share with scoped access

    The storage administrator creates either a dedicated bucket on the chosen S3-compatible service or an NFS export used only for Mattermost files, with a separate service identity or export rule for the application. Access should be limited to the Mattermost file path or bucket and should not reuse administrator credentials. Confirm the exact access settings with your storage vendor's documentation, since the required permissions depend on the product. Done when a test write and read succeed using the service identity and a test delete outside the Mattermost prefix is refused.

  3. Configure Mattermost file storage settings

    The administrator sets the file storage driver and its connection details in the server configuration, using the settings for the chosen backend described in the Mattermost deployment documentation. Secrets should be supplied through your secret handling process rather than pasted into shared files, and the configuration should be reviewed for the path or bucket name, region or endpoint, and TLS settings. Restart the server after the change so the new settings are loaded. Done when the server starts cleanly, the logs show no storage initialization errors, and the System Console reports the expected storage location.

  4. Test uploads and downloads from every node

    Upload a set of test files from a client on each application node, including a file of several megabytes, an image that generates a preview, and a file type your users commonly share. Download each file from a different node than the one that accepted the upload. Compare checksums of the original and downloaded files. Done when every upload is visible from every node, every checksum matches, and previews render, with the test results recorded by node name.

  5. Confirm permissions, paths and object layout

    Inspect the backend directly to confirm files land under the expected prefix or path, that filenames and folder structure match what the server reports, and that the service identity holds only the permissions it needs. On NFS, check the mount options and ownership on every node so the Mattermost service user can read and write. On object storage, check that the bucket policy and encryption settings match your data handling standard. Done when a written checklist shows the path, owner, permissions and encryption state, and a reviewer has accepted it.

  6. Verify behavior after a node restart

    Restart one application node at a time while a user downloads a file and a second user uploads one. Confirm that the uploads in progress complete or fail with a clear error, that previously stored files remain downloadable after the node returns, and that no file is truncated or duplicated. On a cluster, repeat the restart for every node. Done when each restart produces the expected result in the test log, and the team has a written rollback plan for the storage settings in case a later test fails.

Securing attachment storage and its credentials

Whichever backend you choose, attachments are sensitive data stored outside the database, and each storage path carries its own credentials, network exposure and recovery needs. The cards below cover the controls to confirm for S3, NFS and local disk before go-live, and they should be checked against your own environment rather than taken as settled.

Scope and rotate S3 access keys

Mattermost needs credentials to read and write objects in its bucket. Create a dedicated IAM identity that can only reach the Mattermost bucket and the actions it needs, and avoid reusing keys from other applications. Store the access key and secret outside config.json where your secrets process allows, and confirm how and how often your team rotates them. Ask your storage team how key rotation would be applied to running nodes in a cluster.

HA cluster docs

Encrypt storage traffic in transit

Attachment uploads and downloads move between Mattermost nodes and the storage endpoint, and that traffic can carry sensitive files. Confirm that the S3 endpoint or NAS path uses TLS where the service supports it, and that certificates are trusted by every Mattermost node. For NFS, confirm whether the network segment is isolated and whether your organization requires encryption on that path, since the traffic often is not encrypted by default.

Lock down NFS exports and permissions

An NFS share mounted on every node is only as protected as its export rules. Restrict each export to the Mattermost node addresses, avoid broad host wildcards, and map the Mattermost service account to a fixed UID and GID on all nodes. Confirm filesystem permissions so that other local users cannot read attachment directories, and test that a node outside the allowed list is refused.

Control bucket and share access

Limit who can reach the storage backend directly, separate from who uses Mattermost. Administrators of the storage platform should have an audited path to change buckets or shares, and routine operators should not hold storage root credentials. Enable access logging on the bucket or equivalent audit trail on the NAS, and confirm who receives the alerts when access is denied or policy changes.

Back up attachments separately from the database

Database backups do not contain attachment files, so a restore of PostgreSQL alone can leave messages that point to missing files. Back up the attachment store on its own schedule, and test that a restored database and a restored attachment store match in date and content. Ask whether your storage platform supports versioning or object lock, and confirm recovery time and retention targets with your compliance owner.

Deployment planning docs

Set Ceph controls when Ceph is chosen

If you back attachments with Ceph through its Object Gateway, confirm that messenger v2 secure mode is enabled, since it encrypts traffic after authentication with AES-GCM and adds integrity checks. Also confirm that Ceph Dashboard SSO is configured for administrators, and that Dashboard access is limited to named staff. Verify each setting in your own cluster, because defaults and enforced modes depend on your version and configuration.

Messenger v2 docs

Questions teams ask before choosing file storage

Is local disk acceptable for a small Mattermost team?

For a small team on a single server, local disk is a workable starting point, because the server writes attachments to one file system and nothing else needs to see them. The trade-off appears when you add a second application node. The Mattermost high availability documentation requires shared storage on each node, and local file system storage will not work correctly in a cluster and risks corrupting files. Ask yourself whether you expect to cluster within the life of the server. If you do, choose shared storage before go-live, because moving attachments later is extra work. Confirm the current single-server guidance in the Mattermost server deployment planning docs for your user count.

Why does NFS need careful testing in a Mattermost cluster?

NFS is an accepted option for a cluster because Mattermost documents NAS mounted on each node as shared file storage. The risk lies in the details: mount options, file locking behavior, latency, and what happens when a node or the NAS drops a connection during an upload. Each application node must see the same files with the same permissions, and a failover test should confirm that attachments written by one node are readable from another. Ask the storage team to document the export settings, the NAS failover behavior and the mount options used on every node, then test uploads and downloads under load before cutover.

What extra work does an S3 or S3-compatible backend add?

An S3 or S3-compatible backend adds a bucket, credentials, network paths from every application node, lifecycle and retention settings, and a monitoring plan. Amazon S3 and other S3-compatible services are documented as valid shared storage for a high availability cluster. Your team must decide how credentials are issued and rotated, whether buckets are encrypted and versioned, and how egress is routed through any outbound proxy. If you run your own S3-compatible service, such as Ceph Object Gateway, you also own its capacity planning, failure domains and upgrades.

What does Ceph add compared with a managed object store?

Ceph is open source and licensed under LGPL-2.1 or LGPL-3, and the project does not sell a paid edition, so your costs are hardware, operations staff and any support contract you buy elsewhere. Its Object Gateway offers an S3-compatible API, which is what Mattermost needs. The Ceph hardware recommendations advise a dedicated drive per OSD, enterprise-class SSDs for metadata, bonded network links across two switches, and benchmarking before purchase. Ceph also needs its own monitors, managers and upgrade plan, so budget for those alongside the Mattermost work.

What drives the cost and effort of file storage work?

The main drivers are the number of application nodes, the expected attachment volume and retention, the backend you choose, and how much of the storage platform is new to your team. Costs fall into four groups: provisioning the storage, testing uploads and failover, migrating any existing files, and running the platform afterward. Provisioning and testing are usually one-time costs. Monitoring, capacity growth, patching and backup recur. Ask a provider to price each group separately and to state which items are one-time and which are recurring. Mattermost licensing is quoted separately by Mattermost, Inc., and its pricing page lists no public prices.

Can our own team set up file storage without outside help?

Yes, if your team already runs NFS or S3-compatible storage, has Linux administration skills and can test failover. Setup is straightforward on a single server. For a cluster, the work that most often goes wrong is verification: confirming that every node reads and writes the same files, that permissions survive restarts, and that the storage recovers cleanly after a network interruption. Ask whether the team has a written test plan and staging environment. If storage is new to the team, an outside partner can run the build and testing, while your staff keep ownership of the runbooks and the on-call rotation.

What should we ask for in a file storage quote?

Ask for a written scope that names the storage backend, the number of application nodes, the test cases, the migration of existing attachments, the handover documents and the support period. Request a line for each of provisioning, configuration, testing, migration and documentation, and a separate line for any recurring service. Confirm who owns the storage hardware or cloud account, who holds the credentials and who responds during an incident. Ask how the quote changes if you add a node, change backend or move from a single server to a cluster. Finally, ask for the acceptance criteria in writing before work starts.

Which backend should we pick if we will move to high availability later?

Choose shared storage that can serve every node from the start, which means S3, an S3-compatible service or a NAS. Mattermost high availability is available on the Enterprise and Enterprise Advanced plans, according to the Mattermost pricing page, and a cluster needs shared file storage. Local disk would need to be replaced with shared storage, and existing attachments would need to move, which adds work and a window for error. Confirm the plan and cluster requirements with Mattermost before you decide, and document the choice in your architecture record.

How Mattermost nodes, the database and file storage connect

The diagram starts with users reaching a load balancer that spreads requests across several Mattermost application nodes. Each node talks to one PostgreSQL primary for writes and to read replicas for distributed reads. Attachments do not go to the database: every node reads and writes the same shared file store, which is either S3-compatible object storage or a NAS or NFS share mounted on each node. Local disk is shown as invalid for a cluster, because each node would hold a different copy of the files. Check that every node mounts the same store and that replicas are reachable from all nodes.

Cluster layout with shared file storage on every node; local disk is not valid.

What changes if you switch file storage later

Switching attachment storage after users have uploaded files is a planned data migration, not a configuration change. Existing files must be copied to the new backend, their paths and access rules must carry over, and the result must be verified file by file before the old store is retired. Users who open a message from last month should see the same attachment they uploaded, and a file that fails to copy should be found during the migration, not by a user months later. Treat the move as a project with its own test plan, rollback point and sign-off, and budget the work for the time it takes to copy and check the full file set, not only the time to change settings.

The Mattermost migration documentation covers moving chat history and database content between systems, and it is the right starting point for planning. It does not replace a storage-specific runbook, so confirm with Mattermost, for your exact server version, how file locations are recorded and updated after files are copied, and whether any database rewrite or re-indexing is required. Ask whether attachment references in the database point to a backend-independent path or to a backend-specific location, because that answer decides how much rewriting the move involves. Also confirm how the FileSettings block in config.json or its environment variable equivalent changes during the switch, and whether the server must be stopped while the move runs.

Plan the exit before you pick the entry point. If you may later move from local disk to NFS or from NFS to S3-compatible storage, record the storage choice, bucket or share layout, and credential model in your architecture notes now, and keep a current inventory of file counts and total size so you can measure progress. Test the migration on a copy of production data in a non-production environment, compare checksums or object counts after the run, and keep the original store read-only until users have confirmed their files open correctly. Ask your Mattermost contact and your storage team to agree these steps in writing before go-live.

How DeployOpen scopes Mattermost file storage work

DeployOpen starts with a written scope that fixes the storage backend, the sites and nodes it must reach, and the controls the security and infrastructure teams need to review. We then build, test and document the chosen option inside your own infrastructure, so your team can run it after handover.

How we scope

  • Engagements are fixed-scope, with the storage decision, deliverables and timeline agreed in writing before work starts.
  • We record your user count, high availability needs, network zones and whether S3-compatible object storage is allowed or NFS is the only option.
  • We confirm your Mattermost plan and version, since high availability clustering requires shared storage on every node.
  • The written scope lists the storage option, the test cases, the documentation set and the handover acceptance criteria.

How we build

  • We configure the chosen backend (S3, S3-compatible, NFS or local disk) in your environment with the bucket, share or path and access credentials.
  • We test upload, download, preview and deletion of attachments from each node and through your reverse proxy.
  • We check file permissions, encryption settings and the credential handling used by the Mattermost server.
  • We measure attachment behavior under the load your scope defines, so the performance trade-offs are documented with your own numbers.

How we hand over

  • You receive a written record of the chosen storage design, its trade-offs and the reasons each option was accepted or rejected.
  • Runbooks cover backup and restore of the file store, capacity checks, credential rotation and moving between backends.
  • We document the steps your team needs to repeat for a node addition, a failover test and a Mattermost upgrade.
  • Handover includes a review session where your engineers run the test cases themselves against the environment.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover.
  • Retainers can cover storage checks after each Mattermost monthly or Extended Support Release, so changes to file handling are reviewed before rollout.
  • Ask any provider to confirm which Mattermost versions and storage backends they have tested in your environment before signing.
  • Quotes should itemize build, testing, documentation and retainer effort separately, so you can compare them with your internal costs.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.