Applies to: ONLYOFFICE Docs (Document Server) — Self-hosted, Windows installation
By default, ONLYOFFICE Document Server stores its cache files at:
C:\Program Files\ONLYOFFICE\DocumentServer\server\App_Data\cache\filesIf you need to relocate the cache to a different drive or shared path, follow the steps below.
Step 1 — Create the new cache folder
Create the target directory on the desired drive. For example:
E:\Share\ONLYOFFICE\cache\filesThe subfolder structure must include both cache and files subdirectories, so the full path is:
E:\Share\ONLYOFFICE\cache\filesStep 2 — Set permissions
Grant write permissions on the new folder to the Local Service user. ONLYOFFICE DocumentServer services run under this account, so without this the server will fail to write cache files.
Step 3 — Copy existing cache data
Copy the contents of the current cache folder to the new location:
-
From:
C:\Program Files\ONLYOFFICE\DocumentServer\server\App_Data\cache\files -
To:
E:\Share\ONLYOFFICE\cache\files
Step 4 — Update local.json
Open (or create) the local.json file at:
%ProgramFiles%\ONLYOFFICE\DocumentServer\config\local.jsonAdd or update the storage.fs.folderPath parameter. The full object structure must be preserved:
{
"storage": {
"fs": {
"folderPath": "E:/Share/ONLYOFFICE/cache/files"
}
}
}> Note: Always edit local.json, never default.json or production.json. Changes to those files are overwritten on update. See Configuring ONLYOFFICE Docs for full parameter reference.
Step 5 — Update the nginx alias
Open the nginx configuration file at:
C:\Program Files\ONLYOFFICE\DocumentServer\nginx\conf\includes\ds-docservice.confFind the line:
alias ../server/App_Data$1;Replace it with the new base path (note: the path ends at the ONLYOFFICE directory, not cache/files):
alias E:/Share/ONLYOFFICE$1;This allows nginx to correctly serve cached files from the new location.
Step 6 — Restart all ONLYOFFICE services
Restart all ONLYOFFICE Document Server services via the Windows Services Manager or using the command line to apply both the local.json and nginx changes.
References
Comments
0 comments
Please sign in to leave a comment.