My first JPG to PDF Linux job was not planned. I had an old ThinkPad running Ubuntu, a scanned tenancy form the landlord wanted back as a PDF, and about twenty minutes before the letting agent closed. On Windows the whole thing would have taken two minutes. On Linux I had to work it out from scratch, and the first thing I learned is that there are about six ways to do it and only three of them are worth your time. This guide covers those three, in the order I would try them, with the exact commands and the exact clicks, so you can stop reading and get the PDF made.
Before the methods, one thing that saves a lot of confusion. A JPG and a PDF are not the same kind of file, and Linux treats them that way. A JPG is a photo: a grid of pixels, good for pictures, bad for documents. A PDF is a page: it holds the photo at a fixed size on a fixed page, which is why landlords, schools, and offices ask for it. Converting is not changing the photo. It is putting the photo on a page. Every method below does that, they just differ in how much control you get and whether you need the internet.

JPG to PDF Linux: the quickest way when you just want it done
If there is one photo and one deadline, use the browser. Open our free JPG to PDF converter, drop the JPG in, and download the PDF. It takes under a minute on a normal connection, and it works the same on Ubuntu, Fedora, Mint, Pop!_OS, and anything else with a browser, because the browser is doing the work, not the operating system.
There are a few settings worth getting right before you click convert. Page size first. A4 is the safe choice almost everywhere outside North America. Letter is the safe choice if the PDF is going to someone in the United States or Canada, and it is the size most American printers expect. Orientation second. A phone photo of a document is usually portrait, and a screenshot is usually landscape, so check the preview rather than guessing. Margins third. If the photo is a scan of a page with text near the edges, pick the smallest margin on offer, or the text will get cut off.
One practical detail: file size. A 4.8 MB photo from a phone camera makes a PDF of roughly the same size, sometimes a little smaller. That is fine for email. If the photo is 14 MB because it came straight off a camera at full resolution, the upload takes longer and some inboxes will reject the result. Shrink the JPG first if that is the case. On Linux you can do it in two seconds with a command I will show below, or just take the photo again at a lower resolution. There is no point sending a 6000 pixel wide image of a one page form.
The browser method has one real weakness, and it is worth saying plainly. Your photo leaves your machine. For a bus timetable or a worksheet that does not matter. For a passport scan or a medical form, I would not use any online converter, mine included. Use one of the offline methods below instead. That is not me being modest. It is the right call for sensitive documents.
The terminal method, for a folder full of photos
The terminal is where Linux stops feeling like a compromise and starts feeling like the right tool. If you have one photo, the browser is faster. If you have forty photos, a scanned booklet, or a folder of receipts, the terminal does the whole batch in one command and does not ask you to click through anything forty times.
The tool is ImageMagick. It is already installed on a lot of systems, and if it is not, installing it takes one command. On Ubuntu, Debian, and Mint: sudo apt install imagemagick. On Fedora: sudo dnf install ImageMagick. On Arch and Manjaro: sudo pacman -S imagemagick. After that, open a terminal in the folder with your photos and run one line per conversion:
magick photo.jpg photo.pdf
That is the whole method for a single file. The magick command is the current name. Older guides use convert, which still works on most systems, but ImageMagick renamed it in version 7, and new installs on some distros only ship magick. If your system says the command is not found, try the other name before assuming anything is broken. ImageMagick’s own site explains the current command names and the install steps for every distro, and it is the page I check when something does not match.
For a whole folder, a loop does it:
for f in *.jpg; do magick "$f" "${f%.jpg}.pdf"; done
And to put every JPG in a folder into a single PDF, in alphabetical order:
magick *.jpg booklet.pdf
That last one is the command I use most. Rename the photos first so they sort correctly, page01.jpg, page02.jpg, and so on, because the shell sorts them alphabetically and page10.jpg comes before page2.jpg if you do not pad the numbers. I learned that the embarrassing way, with a ten page scan that went 1, 10, 2, 3.
There is one more tool worth knowing about, called img2pdf. ImageMagick re-encodes the photo when it builds the PDF, which is fine, but it is not lossless. img2pdf puts the original JPG bytes into the PDF untouched, so the quality is exactly the same as the photo and the file is often smaller. Install it with sudo apt install img2pdf on Ubuntu and Debian, then run img2pdf photo.jpg -o photo.pdf, or img2pdf *.jpg -o booklet.pdf for a batch. If quality is the thing you care about most, use img2pdf.
Now the gotcha that wastes more time than anything else in this guide. On Ubuntu and Debian, ImageMagick ships with a security policy that blocks PDF writing. You will run the command, and instead of a PDF you get an error saying the operation is not allowed by the security policy, or that the PDF delegate failed. The file is fine. The policy is the problem. It lives at /etc/ImageMagick-6/policy.xml on Ubuntu, and the line to change is the one that reads <policy domain="coder" rights="none" pattern="PDF" />. Change rights=”none” to rights=”read|write”, save the file, and try again. You need sudo to edit it, and you should only change the PDF line, not the others. If you are not comfortable editing system files, use img2pdf or LibreOffice instead, which do not hit this policy at all.

LibreOffice Draw, when you want to see the page first
Sometimes you do not want a command. You want to see the page, drag the photo where it belongs, and check it looks right before you save. That is what LibreOffice Draw is for, and it is installed on most Linux desktops already. If it is not, it comes with the LibreOffice suite, which is free.
Open Draw and you get a blank page. Go to Insert, then Image, and pick your JPG. Drag the corners to size it, and drag it into the middle of the page. If the photo is bigger than the page, Draw will ask if you want to scale it down. Say yes. Then go to File, then Export As, then Export as PDF. A small dialog appears with a JPEG quality slider. Leave it at 90 percent unless you have a reason to change it. Ninety is the sweet spot: the photo stays sharp and the file stays a reasonable size. Drop it to 70 if the PDF has to go by email and it is over a few megabytes, and raise it to 100 only if the photo is a detailed scan you need at full quality.
Draw is the best choice when the job is fiddly. A photo that needs cropping. Two photos that need to sit side by side on one page. A caption or a heading above the photo. A signature you want to add under a scanned form. The terminal cannot do any of that without a fight. Draw does it with a mouse.
It is also the best choice when you are making a PDF from photos and text together. A common one is a school project or a small portfolio: a few photos, a title, a paragraph under each. Write it in Writer, drop the photos in, and export the whole thing as a PDF from the same menu. The photos stay where you put them, and the PDF looks like a document rather than a stack of images.

Print to PDF, the method already on your machine
There is a fourth way, and it is the one most Linux users never notice. Your system can already print to a PDF file, with no extra software at all. Open the photo in your image viewer. On GNOME that is Image Viewer, or Loupe on newer versions. On KDE it is Gwenview. Press Ctrl+P, or open the menu and choose Print. In the print dialog, change the printer to Print to File, pick PDF as the format, and choose where to save it. That is the whole method.
It is not fancy. You get one photo per page, and the page size comes from the print settings, which default to A4 on most systems. But it is completely offline, it needs nothing installed, and it works when everything else is fighting you. I have used it on a train with no Wi-Fi, on a live USB stick with no persistent storage, and on a machine where I did not have the admin password to install anything. It just works.
One detail worth knowing: the print dialog has a scale setting, and it matters. If the photo is a landscape phone shot and the page is portrait A4, the default scale will shrink it to fit, leaving big white bands at the top and bottom. Change the orientation to landscape first, and the photo fills the page properly. The same applies in reverse for a portrait document photo on a landscape page. Two seconds of checking saves a PDF that looks wrong.
The mistakes that waste the most time
Most JPG to PDF Linux failures are the same five problems, and they are all easy to avoid once you know them.
- Sideways photos. A photo taken on a phone stores its rotation as a note in the file, not as a change to the pixels. Some converters read the note and some do not, so the PDF comes out sideways. If a photo looks right in your viewer but wrong in the PDF, rotate it first in the viewer or with
magick photo.jpg -auto-orient fixed.jpg, then convert the fixed file. - Files that are far too big. A 14 MB phone photo makes a 14 MB PDF, and a lot of email systems and upload forms cap attachments at 10 MB or 25 MB. Shrink first:
magick photo.jpg -resize 2000x2000 photo-small.jpgkeeps the photo sharp on screen and on paper, and usually drops the file to under 2 MB. - The ImageMagick policy error. Covered above. If you see the words security policy, it is the policy file, not your photo.
- Wrong page size. A PDF made on Letter paper and printed on A4, or the other way round, comes out with the edges cut or shrunk. Check the page size before you convert, not after you have sent it.
- Uploading sensitive files to a random converter. If a site has no padlock in the address bar, or it asks you to create an account before converting one photo, close it. A decent converter needs neither. For anything with personal details, stay offline and use the terminal, Draw, or print to PDF.

Which one should you actually use
It comes down to how many photos you have and whether you are online. One photo and a deadline: use the browser converter. It is the fastest, and the page size and margin settings are right there in front of you. A folder of photos: use the terminal, either magick for convenience or img2pdf for perfect quality. A job that needs arranging, cropping, or captions: use LibreOffice Draw. No internet, no admin rights, or a sensitive document: use print to PDF from your image viewer.
If you only remember one thing, remember the file naming rule for batches. Pad the numbers. page01, page02, page03, up to page10, or the order will be wrong, and you will only notice after you have sent the PDF. Everything else can be fixed in a minute. A mixed up order means starting again.
And if you ever have to do the same job on a borrowed machine, the browser method is the one that travels. It is the same on a Chromebook, a Windows laptop, or a library computer. Our guide to converting JPG to PDF online covers that version, and the steps are near identical. The Linux specific parts are the terminal and the offline tools, and once you have used them once, they stop feeling like Linux things and start feeling like the normal way to do it. If you also use a Chromebook, our guide to converting JPG to PDF on Chromebook shows the browser method on ChromeOS, which is handy when the Linux laptop is at home and the Chromebook is the one in your bag.
A last check before you send it
Open the PDF and look at every page before you send it anywhere. Check the order, check nothing is sideways, and check the file size. A three page scan of a form should be well under 5 MB. If it is 30 MB, something went wrong, usually a photo that was never resized. Rename the file to something a stranger would understand, form-tenancy-agreement.pdf rather than converted.pdf, because the person on the other end gets dozens of files called converted.pdf and yours will get lost.
JPG to PDF Linux conversion is a small skill, but it is one that comes up again and again, for forms, for school, for work, for selling something second hand and needing a receipt in the right format. Learn the browser method for speed, the terminal for batches, and print to PDF for the days when nothing else is available, and you will never be stuck. The whole job takes a minute once you know which of the three to reach for, and after the second or third time, you will not need this guide at all.