Opening a PDF in Linux can be done with a dedicated reader like Evince or through a web browser. If you are wondering how to open pdf in linux, you have several simple options that work right out of the box.
Most Linux distributions come with a default PDF viewer pre-installed. But sometimes you need to install one yourself or use a different method. This guide covers everything from built-in tools to command-line tricks.
Let’s start with the easiest way first.
Using The Default PDF Viewer In Linux
Every major Linux desktop environment includes a default PDF reader. These are lightweight, fast, and perfect for basic viewing.
GNOME: Evince Document Viewer
If you use GNOME, Evince is already there. It opens PDFs, PostScript files, and even comic book archives.
To open a PDF with Evince:
- Locate your PDF file in the file manager (Nautilus).
- Double-click the file. It should open automatically in Evince.
- If not, right-click the file and select “Open With” then “Document Viewer.”
Evince supports search, zoom, and printing. It also remembers your last page when you close the file.
KDE: Okular
Okular is the default PDF reader for KDE Plasma. It is more feature-rich than Evince and supports annotations, forms, and bookmarks.
Steps to use Okular:
- Double-click the PDF file in Dolphin (KDE file manager).
- If it doesn’t open, right-click and choose “Open With” then “Okular.”
- You can also drag and drop the PDF onto the Okular window.
Okular lets you highlight text, add sticky notes, and even extract images from the PDF.
XFCE: Atril Document Viewer
Atril is a fork of Evince and comes with XFCE. It works almost identically to Evince.
Open a PDF by double-clicking it in Thunar file manager. Atril launches automatically.
How To Open Pdf In Linux Using A Web Browser
Sometimes you don’t want to install a dedicated reader. Modern web browsers like Firefox, Chrome, and Chromium can display PDFs natively.
Firefox
Firefox has a built-in PDF viewer that is simple and effective. To use it:
- Open Firefox.
- Press Ctrl+O (or Cmd+O on Mac).
- Navigate to your PDF file and select it.
- The PDF opens in a new tab.
You can also drag the PDF file directly into a Firefox window. Firefox’s viewer supports zoom, search, and printing.
Google Chrome Or Chromium
Chrome and Chromium also include a PDF viewer. It is very similar to Firefox’s.
To open a PDF:
- Open Chrome.
- Press Ctrl+O and select the PDF file.
- Alternatively, drag the file into the browser window.
Chrome’s viewer is fast but lacks advanced features like annotations. It works great for quick viewing.
Command Line Methods To Open PDFs
If you prefer the terminal, you can open PDFs from the command line. This is useful for scripting or when working on a headless server.
Using Xdg-Open
The xdg-open command opens a file with the default application. For PDFs, it will use whatever is set as default.
xdg-open document.pdf
This command works in any desktop environment. It’s the universal way to open files from the terminal.
Using Evince From Terminal
You can launch Evince directly from the terminal:
evince document.pdf
This opens the PDF in the Evince window. If Evince is not installed, you will get an error.
Using Okular From Terminal
Similarly, for KDE users:
okular document.pdf
Using Zathura: A Minimalist PDF Viewer
Zathura is a lightweight, keyboard-driven PDF viewer. It is popular among users who prefer minimal interfaces.
To install Zathura:
- On Debian/Ubuntu:
sudo apt install zathura - On Fedora:
sudo dnf install zathura - On Arch:
sudo pacman -S zathura
To open a PDF:
zathura document.pdf
Zathura uses Vim-like keybindings. Press q to quit, j and k to scroll, and / to search.
Installing A PDF Reader If Not Already Present
Some minimal Linux installations don’t include a PDF viewer. You can install one easily.
On Debian, Ubuntu, And Derivatives
Use APT to install Evince:
sudo apt update
sudo apt install evince
For Okular:
sudo apt install okular
On Fedora And RHEL
Use DNF:
sudo dnf install evince
Or for Okular:
sudo dnf install okular
On Arch Linux
Use Pacman:
sudo pacman -S evince
Or:
sudo pacman -S okular
How To Open Pdf In Linux With Adobe Reader
Adobe Reader for Linux is no longer officially supported. However, you can still install an older version from third-party sources.
This is not recommended for security reasons. Instead, use open-source alternatives like Evince or Okular.
If you must use Adobe Reader, download the .deb or .rpm package from the Adobe archive. Then install it with:
sudo dpkg -i AdobeReader_enu-9.5.5-1.i386.deb
Note that this version is outdated and may not render modern PDFs correctly.
Opening Password-Protected PDFs
Some PDFs require a password to open. Most Linux PDF readers support this.
In Evince or Okular, when you open a protected PDF, a dialog box appears asking for the password. Enter it and the file opens normally.
For command-line users, you can use qpdf to decrypt a PDF if you know the password:
qpdf --password=yourpassword --decrypt input.pdf output.pdf
Then open the decrypted file with any viewer.
Converting PDFs To Other Formats In Linux
Sometimes you need to convert a PDF to text or images. Linux has powerful tools for this.
Using Pdftotext
Install poppler-utils first:
- Debian/Ubuntu:
sudo apt install poppler-utils - Fedora:
sudo dnf install poppler-utils
Then convert:
pdftotext document.pdf document.txt
Using Pdftoppm For Images
To convert each page of a PDF to an image:
pdftoppm document.pdf output
This creates files like output-1.jpg, output-2.jpg, etc.
Fixing Common PDF Opening Issues In Linux
Sometimes a PDF won’t open. Here are common problems and solutions.
Missing Dependencies
If Evince or Okular crashes, you might be missing required libraries. Update your system:
sudo apt update && sudo apt upgrade
Corrupted PDF File
Try opening the PDF in a different viewer. If it opens in Firefox but not Evince, the file might be slightly corrupted. Use qpdf to repair it:
qpdf --linearize corrupted.pdf repaired.pdf
PDF Requires A Specific Font
Some PDFs embed fonts, but others rely on system fonts. Install common font packages:
sudo apt install fonts-liberation fonts-dejavu
How To Open Pdf In Linux On A Server Without GUI
If you are on a headless server, you cannot use graphical PDF viewers. Instead, convert the PDF to text or use a terminal-based viewer.
Using Pdftotext On Server
Extract text from the PDF:
pdftotext document.pdf -
The dash sends output to stdout. You can then read it in the terminal.
Using Lynx Or Links2
These text-based browsers can display PDFs if you have a converter installed. But it’s easier to just extract text.
Setting A Default PDF Viewer In Linux
You can set your preferred PDF reader as the default. This way, double-clicking a PDF always opens it in your chosen app.
In GNOME
- Right-click a PDF file.
- Select “Properties.”
- Go to the “Open With” tab.
- Choose your preferred viewer and click “Set as default.”
In KDE
- Right-click a PDF file.
- Select “Properties.”
- Go to “File Type Options.”
- Select your viewer and click “Apply.”
From The Command Line
You can set the default MIME association using xdg-mime:
xdg-mime default evince.desktop application/pdf
Replace evince.desktop with the desktop file of your preferred viewer.
How To Open Pdf In Linux With Snap Or Flatpak
If your distribution doesn’t have a PDF reader in its repositories, you can use Snap or Flatpak.
Installing Evince Via Flatpak
flatpak install flathub org.gnome.Evince
flatpak run org.gnome.Evince
Installing Okular Via Snap
sudo snap install okular
Then open it from the application menu or terminal.
Using PDF Editors In Linux
If you need to edit PDFs, you need more than a viewer. Here are some options.
LibreOffice Draw
LibreOffice can open and edit PDFs. It imports the PDF as a drawing, which you can then modify.
To use it:
- Open LibreOffice Draw.
- Go to File > Open and select the PDF.
- Edit as needed and export back to PDF.
Inkscape
Inkscape can also open PDFs for editing. It imports each page as a separate object.
Qpdf And Pdftk For Command-Line Editing
For merging, splitting, or rotating PDFs, use pdftk or qpdf.
Install pdftk:
sudo apt install pdftk
Merge two PDFs:
pdftk file1.pdf file2.pdf cat output merged.pdf
Frequently Asked Questions
What is the best PDF reader for Linux?
Evince is great for GNOME, Okular for KDE. Both are fast and reliable. For minimalists, Zathura is excellent.
Can I open a PDF in Linux without installing anything?
Yes, if you have a web browser installed. Firefox and Chrome can open PDFs natively.
How do I open a PDF from the terminal in Linux?
Use xdg-open filename.pdf or the specific viewer command like evince filename.pdf.
Why won’t my PDF open in Linux?
It could be corrupted, missing fonts, or you may not have a PDF reader installed. Try opening it in a browser first.
Is there a command-line PDF viewer for Linux?
Yes, Zathura and MuPDF are terminal-friendly. For text-only, use pdftotext to extract content.
How To Open Pdf In Linux On Different Desktop Environments
Each desktop environment has its own default viewer. Here’s a quick reference:
- GNOME: Evince (Document Viewer)
- KDE: Okular
- XFCE: Atril
- LXDE: Evince or Atril
- Cinnamon: Evince (Document Viewer)
- MATE: Atril (Document Viewer)
- Budgie: Evince
If you are using a window manager like i3 or Openbox, you can install any of these viewers manually.
Opening a PDF in Linux is straightforward once you know your options. Whether you prefer a GUI app, a browser, or the command line, there is a method that works for you.
Remember to keep your system updated for best compatibility. Most PDF issues are solved by installing the correct packages or using a different viewer.
Now you know how to open pdf in linux using multiple approaches. Choose the one that fits your workflow best.