Help Docs Server Administration Linux Server Administration Zstd

Zstd

Discover Zstandard (zstd): a fast gzip replacement for better compression & speed. Learn to install on CentOS (EPEL) & use equivalent commands.
Overview

Zstandard (zstd) is a fast, efficient compression algorithm designed to replace gzip, offering better compression speeds and slightly smaller file sizes. It is free, widely available, and lossless, meaning no data is lost during compression or decompression. Many industry leaders have adopted zstd as their default compression method, including Acronis, Plesk, Cloudflare, and Red Hat Enterprise Linux 9. Modern browsers like Chrome (v123+) and Firefox (v126+) also support zstd by default.

Why choose Zstandard?
  • Faster Compression and Decompression: Zstd outperforms gzip significantly in speed.
  • Better Compression Ratio: Files are typically compressed smaller than gzip.
  • Wide Adoption: Used by major software and platforms for improved performance.
  • Lossless Compression: Fully reversible without data loss.
  • Optimized for Modern Hardware: Utilizes more RAM and CPU optimizations than gzip’s 32 kB limit.
Equivalent zstd vs gzip commands
Taskzstd Commandgzip Equivalent
Compress (delete original)zstd --rmgzip
Compress (keep original)zstdgzip --keep
Decompress (delete original)unzstd --rmgunzip
Decompress (keep original)unzstdgunzip --keep
Multi-threaded compressionzstdmt --rmpigz
Multi-threaded (keep original)zstdmtpigz --keep
View compressed fileszstdlessless
Search compressed fileszstdgrepzgrep
Output to stdoutzstdcatzcat
Compress tar archive (single-threaded)tar -I zstdtar -z
Compress tar archive (multi-threaded)tar -I zstdmttar -I pigz

Installation

Zstandard (zstd) is available in the EPEL repository on CentOS systems. Follow the steps below to install it cleanly:

For CentOS 7 and 8

Enable the EPEL repository (if not already enabled):

yum install epel-release

Install zstd:

yum install zstd

If you prefer not to leave EPEL enabled system-wide (e.g., to avoid conflicts or updates from EPEL), you can temporarily enable it just for the installation:

yum install epel-release
yum-config-manager --disable epel
yum --enablerepo=epel install zstd
Note

This approach ensures that only zstd is installed from EPEL without affecting other system packages.

Summary

Zstandard (zstd) is a modern, lossless compression algorithm that offers faster performance and better compression ratios than gzip. Widely adopted by industry leaders like Cloudflare, Plesk, and Red Hat, it supports multi-threading and is optimized for modern hardware. Zstd is a drop-in replacement for gzip with equivalent commands and improved efficiency. It’s available via EPEL on CentOS and ideal for tasks like backups and file archiving.

Was this article helpful?