LinuxUbuntuHow-To

How to Compress a PDF on Linux — No Install Needed

Linux users often default to Ghostscript for PDF compression, which requires terminal commands and package installation. But if you just need to reduce a PDF's file size quickly, there's a faster option: ShrinkPDF runs entirely in your browser and works on any Linux distro — Ubuntu, Fedora, Debian, Arch, Mint, and more — without installing anything.

Browser Method — Fastest, No Install

Works on any Linux distro with Firefox, Chrome, or Chromium installed — which is essentially every modern Linux desktop.

1

Open Your Browser

Open Firefox, Chrome, or Chromium. Go to shrinkpdf.fyi. The site works identically on Linux as on any other OS.

2

Upload Your PDF

Click Choose PDF File. Your file manager (Nautilus on GNOME, Dolphin on KDE, Thunar on XFCE) will open. Navigate to the PDF and select it.

3

Choose Compression Level

Select Balanced for documents with images. Select Maximum for scanned files, forms, or text-heavy documents.

4

Download the Compressed PDF

Click Download. The file saves to your ~/Downloads directory. You can also right-click the download notification → Save to a specific folder.

Entirely local — no data leaves your machine

ShrinkPDF uses JavaScript and the WebAssembly runtime in your browser. The PDF is processed on your local CPU — nothing is sent to any server. On a modern Linux machine with 8GB RAM, a 50MB PDF typically compresses in 10–20 seconds.

Ghostscript Method — For Terminal Users

If you prefer the terminal or need to batch-process many files, Ghostscript is the standard Linux tool. Here's the one-liner:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

The -dPDFSETTINGS flag controls compression quality:

Install Ghostscript if needed:

# Ubuntu / Debian sudo apt install ghostscript # Fedora sudo dnf install ghostscript # Arch sudo pacman -S ghostscript

Browser vs Ghostscript — Which to Use?

Use the browser (ShrinkPDF) when:
  • You need to compress one or a few files quickly
  • You don't want to open a terminal
  • You're on a machine where you can't install packages
  • You want a visual preview of the compressed file before downloading
Use Ghostscript when:
  • You need to compress many files at once (batch processing with a loop)
  • You want to automate compression as part of a script or cron job
  • You need fine-grained control over specific DPI values or colour settings

✓ Compress PDF on Linux — Free, No Install

Works in Firefox, Chrome, and Chromium on any distro.

🗜️ Compress My PDF Now

Frequently Asked Questions

Can I compress a PDF on Linux without Ghostscript?
Yes. Open Firefox or Chrome on your Linux machine, go to shrinkpdf.fyi, upload your PDF, and compress it entirely in the browser. No package installation required. The compressed file downloads to your ~/Downloads folder.
Does ShrinkPDF work on Ubuntu, Fedora, and Arch Linux?
Yes. ShrinkPDF runs in the browser and works on any Linux distribution that has a modern browser installed. Tested on Ubuntu 22.04+, Fedora 38+, Debian 12+, Arch Linux, Linux Mint, and Pop!_OS. Any browser based on Chromium or Firefox works.
Which is better for Linux — ShrinkPDF or Ghostscript?
For single files: ShrinkPDF is faster to use. For batch processing or scripting: Ghostscript is more powerful. Compression quality is comparable — Ghostscript's /screen preset is slightly more aggressive than ShrinkPDF's Maximum, but for everyday document compression the results are virtually identical.
Can I use ShrinkPDF offline on Linux?
Once the ShrinkPDF page is fully loaded, compression works without an active internet connection because it runs locally in the browser. However, you need an internet connection to load the page initially. For fully offline use, Ghostscript is the better choice.