Updated: 28 September 2026 · Applies to: zstd 1.5.5 to 1.5.7 on AlmaLinux and Rocky Linux 9 and 10, RHEL 9 and 10, Ubuntu 24.04 and 26.04, Debian 13
Zstandard (zstd) is a compression tool developed at Meta (Facebook). It compresses about as well as gzip or better, while being much faster, and it decompresses very quickly at every level. That makes it a good choice for backups, database dumps and log archives. It is in the main repositories of every current distribution, and many already use it for their own packages.
Install zstd
dnf install zstd # AlmaLinux, Rocky Linux, RHEL apt install zstd # Ubuntu, Debian
Check the version with zstd -V.
Compress and decompress files
zstd backup.sql # creates backup.sql.zst, keeps the original zstd --rm backup.sql # remove the original after compressing zstd -d backup.sql.zst # decompress (or: unzstd backup.sql.zst) zstdcat backup.sql.zst | less # read without unpacking
Unlike gzip, zstd keeps the original file unless you add --rm.
Choose speed or size
zstd -1 file # fastest zstd -3 file # default zstd -19 file # smallest of the normal levels, slow zstd -T0 -10 file # use all CPU cores
Levels go from 1 to 19 (up to 22 with --ultra). Decompression speed stays high at every level, so higher levels cost time only when compressing. -T0 uses one thread per CPU core, which matters for large files.
Folders: tar with zstd
tar --zstd -cf site.tar.zst /var/www/site # create tar --zstd -xf site.tar.zst # extract tar --zstd -tf site.tar.zst # list contents
GNU tar on all the systems above supports --zstd. To pass options such as the level or threads, use tar -I 'zstd -T0 -10' -cf site.tar.zst /var/www/site.
Compress on the fly
mysqldump mydb | zstd -T0 > mydb.sql.zst zstd -dc mydb.sql.zst | mysql mydb
Check an archive
zstd -t backup.sql.zst # test integrity zstd -l backup.sql.zst # show sizes and ratio
Official documentation: Zstandard and zstd on GitHub.
Ucartz services for this topic
- KVM VPS hosting: NVMe SSD and full root access, with Free Basic Managed Support.
- Unmanaged dedicated servers: full root access and free IPMI KVM, with Free Basic Managed Support.
- Linux server management: hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.
