Extract archives from the Nextcloud web interface. Pick an archive in the Files app, choose Extract⦠and enter a new folder name or a relative path inside the archive directory.
- ποΈ Choose an extraction destination from the Files action, no shell access needed
- ποΈ Multiple formats: Zip, Rar, Tar, Tar.gz, Tar.bz2, Gzip, 7z and Deb
- π Works with external storage, including group folders
- π Imports files through Nextcloud's files API, checking destination permissions and rejecting symbolic links
- π§Ή Cleans up a temporary directory left behind by an interrupted run
- π Capabilities API so clients can discover the supported archive types
- π Translated through the Nextcloud translation pipeline
- π§ͺ Unit tested with Playwright integration coverage for Nextcloud 33β35
| Component | Version |
|---|---|
| Nextcloud | 33-35 |
| PHP | 8.3β8.5 |
| Node.js | 24+ (development only) |
| npm | 10.5+ (development only) |
| Tool | Purpose | Install |
|---|---|---|
PHP zip extension |
Zip archives | bundled with most PHP builds |
PHP rar, unrar or full 7z |
Rar archives | pecl install rar or apt-get install unrar or apt-get install 7zip |
p7zip / p7zip-full |
Tar, Gzip, Bzip2, 7z, Deb | apt-get install p7zip p7zip-full |
Extraction needs enough free space in the server's temporary directory for the uncompressed archive. Symbolic links in archives are not supported.
External decoders require PHP proc_open to be enabled; if it is disabled,
extraction fails closed rather than falling back to unsupervised exec().
ZIP extraction enforces the destination's available Nextcloud quota, staging
disk free space, and two configurable safety limits (defaults: 2 GiB total
uncompressed bytes and 10,000 entries). The limits apply before extraction
using ZIP metadata and during streaming using the actual bytes written.
Administrators may adjust them for trusted large archives, for example:
occ config:app:set extract max_extracted_bytes --value=4294967296
occ config:app:set extract max_archive_entries --value=20000The same configured limits and destination-space estimates are now checked
against the declared contents of archives handled by 7za (7z, tar,
Gzip, Bzip2 and Deb) before launching their extraction. Unlike the ZIP
streaming path, an external decoder may expand beyond dishonest archive
metadata before the app can stop it. Command-line decoders now run under a
best-effort supervisor that periodically measures the staging directory,
interrupts processes that exceed the configured size or entry budget, and
enforces a default 300-second timeout. Administrators can change it with
occ config:app:set extract max_extraction_seconds --value=600.
Checks are periodic and can be exceeded briefly; this is not a strict
filesystem quota. High-risk deployments should isolate temporary storage
with an operating-system-enforced limit. When available, the supervisor
runs command-line decoders in their own POSIX session and terminates remaining
child processes on completion or failure. The PHP rar extension follows a
separate bounded streaming path with CRC checks rather than spawning a decoder,
but it still cannot provide an operating-system-enforced CPU or disk quota.
The zip PHP extension is required for ZIP files. RAR uses the PHP rar
extension, unrar, or full 7z. TAR, XZ, 7z, gzip, bzip2, and DEB use 7za.
Zstandard (.zst and .tar.zst) uses the optional zstd executable, or full
7z 24.01 or newer. Zstandard archives do not reliably expose an expanded
size in archive listings, so the staging supervisor is the protection for these
formats; its limits are best-effort, not strict disk quotas.
sudo apt-get install p7zip p7zip-full unrar zstdsudo dnf install p7zip p7zip-plugins unrar zstdbrew install p7zip zstdNote: Release archives must be built, verified and signed by the publishing workflow. Use verified release assets rather than unreviewed source snapshots.
- Download the latest
extract.tar.gz(orextract.zip) from the releases page. - Extract it into your Nextcloud
appsdirectory, using the command that matches the archive you downloaded:The archive already contains the built frontend assets, so no Node.js step is needed.# If you downloaded extract.tar.gz: tar -xzf extract.tar.gz -C /path/to/nextcloud/apps # If you downloaded extract.zip: unzip extract.zip -d /path/to/nextcloud/apps chown -R www-data:www-data /path/to/nextcloud/apps/extract
- Enable the app:
occ app:enable extract
-
Clone the repository into your Nextcloud
appsdirectory:cd /path/to/nextcloud/apps git clone https://github.com/LibreCodeCoop/extract.git extract -
Set the permissions:
chown -R www-data:www-data extract
-
Install the PHP and frontend dependencies and build the assets:
cd extract composer install npm ci npm run build -
Enable the app:
occ app:enable extract
Or go to Settings β Apps, find "Extract" in the disabled apps section and click Enable.
- Open the Files app and navigate to an archive.
- Right-click the archive and choose Extractβ¦.
- Choose a new folder name or nested relative path and confirm. The default is derived from the archive name; cancelling does not extract anything.
The action is offered for readable archives when you can create files in their parent folder. Extraction never modifies the archive itself.
If an archive contains a filename the Nextcloud storage cannot represent (including some legacy character encodings), extraction fails explicitly rather than discarding those entries and reporting a misleading success. Valid UTF-8 names are preserved. A newly created target folder is removed if the import fails partway through. Legacy clients merging into an existing folder may still leave partial changes, since deleting that folder could destroy pre-existing user data.
| Format | Extensions | Extraction backend |
|---|---|---|
| Zip | .zip |
PHP zip extension |
| Rar | .rar |
PHP rar extension, unrar, or full 7z fallback |
| Tar | .tar |
7za |
| Tar + Gzip | .tar.gz, .tgz |
7za |
| Tar + Bzip2 | .tar.bz2, .tbz2 |
7za |
| Tar + XZ | .tar.xz, .txz |
7za (two-pass) |
| Zstandard | .zst, .zstd |
zstd or full 7z 24.01+ |
| Tar + Zstandard | .tar.zst, .tar.zstd, .tzst |
zstd or full 7z 24.01+, then 7za |
| Gzip | .gz |
7za |
| 7z | .7z |
7za |
| Deb | .deb |
7za |
On systems without the PHP rar extension or unrar, the full 7z
executable can extract supported RAR archives as an additional fallback.
The smaller 7za executable does not necessarily support RAR or Zstandard;
on Debian 13, install the 7zip package to obtain the full decoder. For
Zstandard, installing the zstd command is sufficient and works even when
older full 7z versions cannot decode .zst.
Note: Archives protected by a password are not supported. Extraction works on a normal Nextcloud data directory, on object storage and with server-side encryption enabled. On non-local storage the archive is unpacked into a temporary directory and the result is imported through the Nextcloud filesystem, so it appears in the Files app like any other folder.
Archives on external and local storage are unpacked into a request-owned temporary directory and imported through the Nextcloud files API. This avoids cross-device renames and updates the file cache for the destination. Temporary staging content is removed after the request, including on failure.
- Node.js 24+
- npm 10.5+
- PHP 8.1+ with the
zipextension - Nextcloud 33-35 development environment
git clone https://github.com/LibreCodeCoop/extract.git
cd extract
composer install
npm cinpm run dev # development build
npm run build # production build
npm run watch # rebuild on change
npm run lint # ESLint
npm run lint:fix # ESLint with autofix
npm run stylelint # Stylelint
npm run typescript:check # tsc --noEmit
npm run typescript:generate # regenerate OpenAPI types from openapi.jsonThe Makefile wraps the common flows:
make dev-setup # clean, install and build the production bundle
make production-setup # same as dev-setup
make appstore # build the installable extract.tar.gz and extract.zip
make test # run the PHPUnit suite and the frontend linter
make lint # run the PHP and frontend linters
make dist # build the source package and the app-store archivesmake appstore stages only the runtime files, then writes
build/artifacts/extract.tar.gz and, when zip is installed,
build/artifacts/extract.zip. Without zip it skips the zip with a warning;
install zip when both archive formats are required.
It packages whatever is already in js/ and css/, and it does not build the
frontend itself, so run make build first on a fresh checkout. make dist is
not a substitute: it only runs the source and app-store targets.
Run the PHPUnit suite:
composer run test:unit # phpunit -c tests/phpunit.xmlStatic analysis and linting:
composer run lint # php -l over every PHP file
composer run cs:check # php-cs-fixer --dry-run
composer run psalm # Psalm
npm run lint # ESLint
npm run typescript:check # TypeScriptThe PHPUnit suite covers the extraction service, the capabilities endpoint and the mapping between Nextcloud's archive MIME types and the extraction strategy.
Official releases are tracked in the LibreCodeCoop/extract repository.
The source build can be packaged with make build followed by make appstore.
A release must only be published after review and validation; this contribution does
not introduce automatic release publishing.
- Confirm the Extract app is enabled in Settings β Apps.
- Check that the file is one of the supported formats.
- Make sure you have permission to change the file; the action needs update rights.
- Review the Nextcloud log at
data/nextcloud.log.
The archive tool could not unpack the file. Common causes:
- Tool missing: for RAR install the PHP
rarextension,unrar, or full7z; for TAR, XZ, 7z, gzip, bzip2 and DEB installp7zip-fulland check that7zais on the web server user'sPATH. For Zstandard installzstdor full7zversion 24.01 or newer. - Damaged or unreadable archive: the file is truncated, corrupt, or not actually an archive of that format.
- Permissions: the web server user cannot read the archive or write into the target folder.
- Insufficient space on the volume holding the archive.
For a failed external decoder, the Nextcloud log records the rejection reason (for example a timeout, output limit or nonzero exit). To avoid unbounded memory consumption, raw decoder output is not retained in extraction logs.
The file's MIME type is not one the app can extract. See supported formats for the list.
This works. Nextcloud cannot hand out a path inside the data directory there, so the archive is unpacked into a temporary directory and the result is imported through the Nextcloud filesystem. The extracted folder then appears in the Files app like any other folder.
- Object storage (S3, Swift, β¦).
getLocalFile()returns a temporary copy rather than a file in the data directory. - Server-side encryption enabled. The encryption storage wrapper does the same, because it has to decrypt to a temporary file first.
Both local and non-local archives are staged separately and published through Nextcloud's files API. The backend never unpacks into an untracked path next to the original file.
If extraction used to report "Extraction is only supported on local storage" on these setups, update to a version that includes the import step.
Password-protected archives are not supported, including ZIP, 7z, and RAR. An encrypted archive must not be reported as successfully extracted.
Extraction happens on the server, so give the PHP process enough memory and
time. Very large archives may need a higher memory_limit and
max_execution_time.
Contributions are welcome.
- Fork the repository.
- Create a branch for your change.
- Make your change and add or update tests.
- Run the checks:
composer run test:unit && composer run lint && npm run lint. - Commit with a conventional commit
message, for example
fix: handle empty archives. - Push the branch and open a Pull Request.
The commit type drives the release:
| Commit | Release |
|---|---|
breaking change (feat!, BREAKING CHANGE) |
major |
feat |
minor |
perf |
minor |
fix(deps) |
minor |
fix (any other scope) |
patch |
chore, docs, test, ci, refactor, style, build, revert |
none |
So a dependency fix bumps the minor version, while an ordinary bug fix bumps the patch version.
This project is licensed under the GNU Affero General Public License v3.0 or later - see the COPYING file for details.
- Repository: https://github.com/LibreCodeCoop/extract
- Releases: https://github.com/LibreCodeCoop/extract/releases
- Upstream: https://github.com/LibreCodeCoop/extract
- Original author: Paul Lereverend
See release procedures for Nextcloud 33β35 release branches, the PHP matrix, Playwright, reproducible package validation and LibreCode Release Tool automation.