Zammad attachment storage: when the default is enough and when it is not
Keep attachments in the database, which is Zammad's default, until the attachment volume or the file-store operations make that choice a burden. Attachments are the files that travel with tickets: documents customers send through email, screenshots attached in the web form, and files agents add to replies or internal notes. Zammad keeps the ticket text and metadata in PostgreSQL, and the default setup stores attachments there as well, so a single backup and restore covers everything. For a small or moderate team, that simplicity is usually the right trade, and you should not move storage just because the file store feels large.
The decision changes when the database itself starts to suffer from the attachment load, or when your operations team needs file-level control. Two signals matter most. First, the database grows faster than your backup window or restore tests can accommodate. Second, your storage team wants attachments on storage they already manage, with its own replication, lifecycle and capacity reporting. Those are the cases where a filesystem location or an S3-compatible bucket configured through the S3_URL setting becomes relevant. Before you choose, confirm with your own environment how much attachment data you hold, how fast it grows, and how long your backups take to restore, because the facts supplied for this page do not give sizing thresholds.
Changing the storage location later is possible during production use, but it is not free. Moving files, updating configuration, and handling the recursive ownership change that Zammad runs on /opt/zammad/storage/ during updates all need a plan, and the cost of that plan grows with the size of the file store. Ask your Zammad partner or the Zammad admin documentation on storage how the move is performed for your installation type, and test it on a copy of production data before you commit.
Attachment storage options and when each fits
This table compares the three places Zammad can keep attachments across setup effort, backup scope, update impact and fit for busy or multi-node instances. Read each row against your own backup tooling and node count, and treat anything marked as a point to confirm as an open question for your vendor or test environment.
| Factor | Database (default) | Filesystem | S3 via S3_URL |
|---|---|---|---|
| Setup effort | No separate setup; attachments live with the rest of Zammad data | Choose and mount a storage path for the storage directory, then move existing files | Configure key, secret, bucket, region and force_path_style in S3_URL and confirm connectivity |
| Backup scope | Attachments are included in the PostgreSQL backup set | Back up the storage directory alongside the database, in step with it | Back up the database and the bucket separately, and confirm they stay consistent |
| Update impact | No recursive chown of a large file tree during updates | Updates run a recursive chown on the storage directory, which can be slow for many files | Updates avoid the local file tree; confirm how existing local files are migrated |
| Fit for busy instances | Suits smaller volumes; confirm database growth and backup duration with your own data | Suits busy instances when the file store sits on fast, well-sized storage | Suits large volumes; confirm latency and request costs with your provider |
| Fit for multi-node instances | Shared database serves all nodes; confirm node behavior with your architecture | Requires shared storage visible to every node; confirm mount and locking design | Shared bucket serves all nodes without a shared filesystem; confirm node behavior |
| Operational risk | Database size and backup windows grow with attachment volume | Chown duration and disk capacity need monitoring | Bucket credentials, versioning and retention become extra items to manage |
| Point to confirm | Your PostgreSQL sizing and backup tooling | Whether the symlink approach in Zammad's storage guidance fits your layout | Which S3-compatible service you will use and its current support status |
How the S3_URL environment variable configures object storage
Zammad reads S3_URL as an environment variable when its services start, so the value belongs in the environment of the Zammad processes, not in application data. The exact place depends on how you installed Zammad, and the variable name and value format should be checked against the Zammad environment variables reference before you change anything.
- Package installs: set the variable in the environment that the Zammad services for your distribution load, then restart those services. Confirm the file location in the installation documentation for your release.
- Docker Compose: pass the variable through the environment settings of the Zammad containers. Keep the value out of files that go into version control, because it carries a secret.
- Kubernetes: supply the value through your chart values or a Kubernetes Secret that the Zammad workloads read. Confirm with your chart version how secrets are referenced.
- One value per instance: every Zammad container or node that handles attachments must see the same value, or some nodes will write to a different location than others.
- Change control: record who set the variable, when, and which release was running, so a later storage problem can be traced.
Before restarting, compare the variable name and format line by line with the reference, because a small typo can leave Zammad silently using its default storage.
The key and secret are the access credentials that Zammad uses to sign its requests to the object store. Together they identify the principal that writes and reads attachments, so they determine what an attacker could do with a leaked value and what an auditor will ask about first. Treat them as production secrets from the moment they are created.
- Dedicated principal: create an identity that only the Zammad instance uses. Shared credentials make it hard to attribute storage activity to the application.
- Least privilege: grant only the object actions Zammad needs on the bucket it uses. Confirm the exact action set with your storage vendor, and decide whether your retention process requires delete permission.
- Secret storage: keep the secret in your secrets manager or the platform's encrypted secret store. Do not paste it into tickets, chat or shared runbooks.
- Paired values: the key and secret must come from the same credential. A mismatch usually shows up as access errors on the first upload, so test both values together.
- Rotation: plan how the secret will be rotated, and confirm with your deployment method that a restart is needed to pick up the new value.
Before go live, confirm that the principal can list, write and read objects in the target bucket using the same values Zammad will receive.
The bucket, region and force_path_style settings describe where objects go and how requests address them. The bucket name and region must match what your storage service expects, and the addressing style must match what the service accepts. These values are easy to copy incorrectly from a different storage product, so verify them against your own service.
- Bucket: use a bucket dedicated to Zammad attachments. Sharing a bucket with other applications makes access control, retention and restores harder to reason about.
- Region: set the region value your storage service requires. For self-hosted S3-compatible services, confirm which value the service accepts, since some ignore it and others reject unexpected values.
- Path style:
force_path_stylecontrols whether requests place the bucket name in the URL path. Many self-hosted S3-compatible services need path-style addressing, so confirm the setting with the vendor or project documentation. - Endpoint reachability: the host in the variable must be reachable from every Zammad node, including through any outbound proxy that a restricted network requires. Self-hosted MinIO is one option to evaluate, but its community repository is archived, so check the MinIO project README for current support and edition status before you choose it.
Record the bucket, region and addressing choice in your runbook, so restores, migrations and disaster recovery use exactly the same values.
A configuration that starts without errors has not yet proven that attachments reach the bucket. Verification means one controlled upload, one controlled download and a check of the storage location from the bucket side. Do this on a test instance or in a quiet window, and keep the results with the change record.
- Baseline: note the object count and the most recent object in the bucket before the test, so new objects are easy to identify.
- Test upload: after the restart, attach a small file to a test ticket through the Zammad interface.
- Bucket check: list the bucket with your storage client and confirm that a new object appears. Confirm the expected key layout with the storage settings in the Zammad admin documentation.
- Download check: open the attachment in Zammad and confirm that it downloads correctly. This tests the read path as well as the write path.
- Log review: check the Zammad application logs for storage or authentication errors during the test, and confirm which storage location the admin settings report as active.
Move production traffic onto the new storage only after every check passes, and keep the baseline and test results with the change record.
How to move Zammad attachments without breaking production
This sequence takes an instance from its current attachment location to a chosen backend, with a tested upload and download at each stage and a maintenance plan for moving existing files.
Confirm current storage location and size
The administrator checks where Zammad currently keeps attachments, whether in the database or on the filesystem, and measures how many files and how much data exist. Record the attachment count, total size, free disk space on the target volume, and the owner and permissions of the storage directory. Confirm with the team that will own the backend which backend is in scope, and ask any S3 provider or storage team to confirm bucket capacity. The step is done when the team has a written inventory that a reviewer can check against the next steps.
Back up the database and storage directory
Before any configuration change, take a full database backup and a copy of the storage directory, typically under /opt/zammad/storage/ on package installs. Store the copies outside the host that runs Zammad and confirm that they can be read. Test one restore in a non-production environment if the team has not done this recently. The step is done when the backup files exist, their checksums are recorded, and someone other than the author has confirmed they are readable.
Configure the chosen storage backend
Set the backend in the Zammad configuration. For S3, the S3_URL environment variable carries the key, secret, bucket, region and force_path_style values, so review it with the platform team and keep the secret in your secrets store rather than in a shared file. For filesystem storage, point the storage directory at the planned volume or symlink it. Restart Zammad using your standard procedure. The step is done when Zammad starts cleanly and the storage settings in the admin interface show the expected backend.
Test an upload and download
Create a test ticket in a non-production or dedicated test group, attach a file of a known size and type, then open the attachment and compare the downloaded file with the original by checksum. Repeat the test for an inbound email attachment, since mail ingestion uses a different path from the web form. Check the storage location, whether the bucket or directory, to confirm the file landed where you expected. The step is done when both uploads download intact and the storage location shows the object or file.
Plan the migration of existing files
Decide how historic attachments move to the new backend. Estimate the transfer window from the inventory in step one and the throughput you measure in the test, and confirm the approach with the storage owner. Choose whether to copy files while Zammad runs, which needs careful handling of files that change, or to schedule a maintenance window. Write down the rollback path, which keeps the original files until the copy is verified. The step is done when the plan is approved in writing and names an owner, a window and a rollback point.
Move existing files under a maintenance plan
Moving files during production use needs a maintenance plan that states who can stop changes, how new attachments are handled during the copy, and how the team will know the copy is complete. Copy the files, compare counts and checksums against the inventory, then switch the backend. Keep the original files until the team has confirmed a full working day of normal use or the agreed acceptance period. The step is done when counts and checksums match and a sample of historic attachments opens correctly from the new backend.
Account for the slow chown during updates
Zammad runs a recursive chown on /opt/zammad/storage/ during updates, which can be slow when the directory holds many files. Before the next update, check the file count in the storage directory and schedule the update window with that delay in mind. Zammad suggests moving files and symlinking the directory, so consider that layout with the platform team if the store is large. The step is done when the next update plan includes a measured or estimated chown time and the team has tested that layout in a non-production copy.
Why updates slow down on large file stores
Zammad runs a recursive chown on /opt/zammad/storage/ as part of updates, and the time that step takes grows with the number of files in that directory. On an instance that has accumulated years of ticket attachments, email content and inline images, every file is visited on each update, so the update window can stretch far beyond the application restart itself. The cost is paid on every upgrade, not once, which is why it belongs in the storage decision rather than in a late-stage maintenance surprise.
Zammad's documented workaround is to move the storage contents to a location you choose, typically a dedicated volume, and replace /opt/zammad/storage with a symlink to it. Because the update then operates on a symlink rather than a large tree of files, the chown pass no longer walks your attachment history. Confirm the exact steps for your install method and version in the Zammad admin documentation on storage before you change anything, and test the procedure on a copy of production first, since ownership and permissions on the target volume must still match what Zammad expects.
Before the next update, measure rather than guess. Record the number of files and total size under the storage directory, time a recursive ownership check in a staging copy of the same data, and note how long the last production update spent in that step, if your logs show it. Ask the vendor or your partner to confirm whether the version you plan to move to changes this behavior. If you move to S3 instead, the chown question changes, because attachments no longer sit on local disk, so the same measurements should include the local footprint that remains.
How an attachment travels from upload to storage
An attachment starts when an agent or customer adds a file to a ticket. The Zammad application receives it and decides where the bytes go, based on the storage setting it was configured with. In the default setup the content is written to the PostgreSQL database. When filesystem or S3 storage is chosen, the metadata stays in the database while the file content goes to the storage directory or to a bucket reached through S3_URL. The trust boundary sits between the application and external object storage, so check who can reach the bucket, which credentials Zammad holds, and that backups cover both the database and the object store.
Attachment content paths by storage mode, with backup and update touchpoints.
Security and operational considerations for attachment storage
Where attachments live decides who can read them, how they are backed up and how they are deleted. The cards below cover the controls that follow from the storage choice, so the database, filesystem or S3 decision is reviewed with security and recovery in mind rather than only performance.
Keep S3 credentials out of shared files
The S3_URL setting carries the access key, secret, bucket, region and path style for the object store. Anyone who can read the Zammad configuration or the process environment can use those credentials to read or delete every attachment in the bucket. Check who can read the environment file and the container or service definition, and confirm whether your secrets tool can inject the value at runtime. Rotate the key on a schedule and after any staff change.
Environment variables docsScope the bucket to Zammad alone
Give the Zammad credentials access to one bucket, with the minimum object actions the application needs. Do not reuse a shared application key or an administrator account. Block public access on the bucket and confirm that no anonymous read policy exists. Ask your storage team to confirm the exact permissions required by the Zammad version you run, because a policy that is too narrow fails at upload time rather than during setup.
Confirm encryption at rest with the provider
Attachments may contain personal data, contracts or health and payment details. Ask whether the object store encrypts data at rest, whether keys are provider managed or customer managed, and where the keys are held. Record the answer in the data flow documentation. Where the provider does not offer encryption at rest, plan it at the volume or filesystem layer for the filesystem option, or accept and document the gap.
Back up the database and the file store together
Zammad keeps ticket records in PostgreSQL and attachment content in the chosen store. A restore of the database without the matching files leaves tickets pointing at attachments that do not exist, and the reverse leaves orphaned files. Schedule both backups with a shared recovery point, and include the S3 bucket or filesystem path in restore tests. Ask the provider whether bucket versioning or replication is available and what it costs.
Check file permissions after the chown
On the filesystem option, the update process runs a recursive chown on the storage directory. If you moved files and symlinked the directory, confirm that the target keeps the owner and group the Zammad service expects, and that other local users cannot read it. Review the mode of the directory and the files after each update, since a path left with broad permissions exposes every attachment on the host.
Storage settings docsDefine retention and deletion before go-live
Deleting a ticket in Zammad does not by itself define how long attachment content survives in backups, object versions or replicas. Write down the retention period for tickets and attachments, and confirm how deletion propagates to backup copies and to bucket versions. Test a deletion request end to end, including the backup set, so you can answer an erasure or retention question with evidence.
Questions teams ask before choosing attachment storage
Is the database default enough for our Zammad attachments?
For many small and mid-sized instances, keeping attachments in the database is workable, but it becomes harder to live with as the file store grows. Every attachment adds to the PostgreSQL data set, which affects backup size, restore time and replication load. Before deciding, estimate your monthly attachment volume from your current helpdesk, check how many agents and channels feed it, and ask your database team how large they are willing to let the database grow. If the answer is unclear, run a sizing exercise with realistic ticket volumes before you commit to the default.
What does moving attachments to a filesystem or S3 involve?
Moving attachments is a configuration change plus a data migration, and the effort depends on how much data already exists. The work includes choosing the target, configuring Zammad to write new files there, moving existing files, verifying that downloads still work, and updating backup jobs so they cover the new location. Filesystem moves are mostly storage and permissions work. S3 moves add bucket design, credentials, endpoint configuration and a test of the full attachment lifecycle. Ask for a written plan that lists each step, the rollback path and who performs the verification.
How long does an attachment migration take, and what drives the duration?
No general duration can be given without knowing your environment, so plan around the drivers. The main ones are the total number and size of stored files, the speed of the source and target storage, network throughput between them, how many files are on each volume, and whether Zammad must stay available during the copy. Maintenance windows and the number of verification passes also matter. Ask for a timeline based on a measured file count and total size from your instance, and confirm how the plan handles downtime and resumption if the copy is interrupted.
What must our team provide for an S3 or filesystem attachment store?
Your team provides the storage target and the access that Zammad needs to use it. For a filesystem, that means a dedicated volume with enough capacity, a mount that the Zammad service user can write to, and a backup route that covers it. For S3, you provide a bucket, a region, an access key and secret with the least privilege needed, and an endpoint if you run a self-hosted object store. You also need access to backup tooling and to whoever can restore the bucket. Confirm these items in writing before the project starts, since they often delay the work more than the migration itself.
Can our own team move Zammad attachments without an outside partner?
A team with Linux administration, PostgreSQL and storage experience can usually carry out the change in-house, provided it has a tested backup and a staging copy. The risky parts are the file copy, permission handling and verifying that every attachment opens after the move. Teams with limited time or no staging environment often bring in a partner for the planning and verification steps. A partner engagement is fixed-scope, with deliverables and timelines agreed in writing before work starts, so you can compare that cost with the internal hours and risk.
Does changing attachment storage affect the Zammad update process?
Yes, it can. During updates, Zammad runs a recursive chown on the storage directory, which can be slow when there are many files. Zammad's guidance is to move the files and symlink the directory, which keeps the update from walking a very large tree. Check the current Zammad admin documentation for storage before each upgrade, because the exact procedure and paths depend on the version and install method. Include the storage layout in your upgrade runbook and test an update on a staging copy that holds a realistic file count.
Which storage option should we confirm before we start?
Confirm the storage model that fits your data governance, recovery targets and operating skills before any file moves. The database default keeps everything in one place, filesystem storage suits instances where you control a reliable volume and backup process, and S3 suits teams that already run an object store with lifecycle, access and backup controls. Ask your Zammad partner or internal owner to document the chosen model, the backup scope and the restore test. If you plan to run MinIO, check the project's current maintenance status first, because the minio/minio README says the repository is no longer maintained.
How DeployOpen scopes attachment storage work
DeployOpen starts with the storage decision itself, before any installation. We look at current attachment volume and growth, how many agents and channels feed the helpdesk, whether a filesystem location or an S3-compatible bucket already exists in your environment, and who owns backups and key management for each option. The output is a written decision record naming the chosen backend, the reasons for it, and the settings that will be changed. Each of these factors shapes the quote, because a database default needs little extra work while an S3 backend needs bucket policy, credentials, network paths and restore testing.
Once the backend is agreed, we implement it inside your infrastructure: the S3_URL environment variable or the filesystem location, file permissions for the Zammad service account, and any required migration of existing files during a planned window. We then test the paths that matter in production: uploading attachments through email, the web interface and the API, opening them after a service restart, confirming that a restore from backup returns the original files, and rehearsing an update on a copy of the file store so the timing of the ownership change under /opt/zammad/storage/ is known before the real maintenance window. Where a backup tool or service account is involved, we test its permissions on the same data.
The engagement ends with documentation your operations and compliance teams can review: the backend configuration, the backup and restore procedure, the update runbook, and the test results. Most engagements are fixed-scope, so the scope, deliverables and timeline are agreed in writing before work starts, and a quote follows from that written scope. Ask any provider, including DeployOpen, to state which storage backends, file counts and data volumes the quote covers, and which items such as ongoing support or retesting after upgrades are priced separately.

