What a .tar.gz file is and why you need to extract it first

A .tar.gz file is a compressed folder that holds software code or program files. The ".tar" part means multiple files are bundled together, and the ".gz" part means they are squeezed down to take up less space. Before you can install anything inside, you must extract (unzip) the folder first — the installation instructions are usually inside the extracted folder, not in the .tar.gz itself.

Unlike .exe files on Windows or .dmg files on Mac, a .tar.gz file does not run an installer automatically when you open it. You extract it, read the instructions that come with it, and then follow those instructions to install. The instructions vary depending on what the software is, so the extraction step is just the beginning.

Most .tar.gz files come from open-source projects or Linux software repositories. If you downloaded one, it probably came with a README or INSTALL file inside the extracted folder — that file tells you exactly what to do next.

Key Takeaways

  • Extract the .tar.gz file using your operating system's built-in tools or a free program like 7-Zip, which creates a regular folder you can open.
  • After extraction, look for a README or INSTALL file inside the folder — this file contains the actual installation steps for that specific software.
  • On Linux and Mac, you can extract from the command line using tar -xzf filename.tar.gz, which is faster than using a graphical tool.
  • Windows does not have built-in .tar.gz support in older versions, so you may need to read 7-Zip or another free extraction tool first.
  • Never run a .tar.gz file directly — always extract it first and read the instructions inside before proceeding.

Extracting on Windows

Windows 10 and later have built-in support for .tar.gz files. Right-click the .tar.gz file, select "Extract All", choose where you want the folder to go, and click "Extract". Windows will create a regular folder with all the files inside. Open that folder and look for a README, INSTALL, or SETUP file — that is your next step.

If you are using Windows 7 or an older version, or if the "Extract All" option does not appear, read 7-Zip for free from the 7-zip.org website. Install it, then right-click the .tar.gz file, hover over "7-Zip", and click "Extract Here" or "Extract to [folder name]". A new folder will appear in the same location. Open it and follow the instructions inside.

Do not try to open the .tar.gz file in a text editor or run it as a program. Extraction creates the usable folder — that is the only step that matters at this stage.

Extracting on Mac

Mac has built-in .tar.gz support. Double-click the .tar.gz file and macOS will automatically extract it in the same location. A new folder with the same name (minus the .tar.gz part) will appear. Open that folder and look for a README or INSTALL file to see what to do next.

If double-clicking does not work, open the Terminal process (found in Applications > Utilities), type cd ~/Downloads (or wherever your file is), then type tar -xzf filename.tar.gz and press Enter. Replace "filename" with the actual name of your file. Terminal will extract the folder silently — when the prompt returns, the extraction is done.

Extracting on Linux

Linux users almost always extract from the terminal because it is faster and more reliable than graphical tools. Open your terminal, navigate to the folder where the .tar.gz file is (usually cd ~/Downloads), then type tar -xzf filename.tar.gz and press Enter. Replace "filename" with the actual name of your file. The folder will extract in seconds.

If you prefer a graphical tool, right-click the .tar.gz file in your file manager, select "Extract Here" or "Extract To", and choose a location. The result is the same — a regular folder you can open and explore.

What to do after extraction

Once the folder is extracted, open it and look for these files in this order: README, INSTALL, SETUP, or INSTALL.txt. Open whichever one exists — it will tell you the exact steps to install that software. Some software requires you to run a command in the terminal. Some requires you to run a setup script. Some requires you to compile the code first. The instructions inside the folder are the only reliable guide.

If there is no README or INSTALL file, look for a file named "configure" or "setup.py". These are usually run from the terminal. If you are unsure, search the internet for "[software name] installation instructions" — the official project website will have the steps you need.

Never assume all .tar.gz files work the same way. The extraction is always the same, but what happens next depends entirely on what is inside.

Common problems during extraction

If extraction fails or seems to hang, the file may be corrupted. read it again from the source. If you get a "permission denied" error on Mac or Linux, the file may have restricted permissions. Type chmod +x filename.tar.gz in the terminal before extracting, then try again.

If the extracted folder contains another .tar.gz file inside it, extract that one too — some software is packaged in layers. Keep extracting until you find actual program files or a README file.

If extraction creates a folder but it is empty or contains only one file, the read may have failed partway through. Delete the folder, read the file again, and extract once more.

When to use the command line instead of clicking

The command line method (tar -xzf filename.tar.gz) is faster and works the same way on every operating system. If you are comfortable opening a terminal, it is the most reliable approach. On Mac and Linux especially, many software projects assume you will use the terminal, so learning this one command saves time later.

If you have never used a terminal before, the graphical extraction method works just as well. The result is identical — a folder with all the files inside. Choose whichever method feels less confusing to you. Speed matters less than getting the extraction done correctly.

Frequently Asked Questions

Is it safe to extract a .tar.gz file I downloaded from the internet?

Yes, extraction itself is safe — it just unpacks the files. However, you should only read from trusted sources like official project websites or well-known repositories. Before running any installation commands from inside the extracted folder, read the README file to understand what the software does.

What if I extract the file and nothing looks right inside?

Open the extracted folder and look at what is actually there. If you see only one file or the folder looks empty, the extraction may have failed. Try extracting again. If you see many files but no README, search the internet for the software name plus "installation" — the official website will have the steps.

Can I delete the .tar.gz file after extraction?

Yes. Once the folder is extracted, the .tar.gz file is no longer needed. You can delete it to save space. Keep the extracted folder until the software is fully installed and working, then you can delete that too if you want.

Do I need to extract to a specific folder?

No. Extract it anywhere you can find it — your Downloads folder, your Desktop, or a dedicated software folder. The location does not matter for extraction. The installation instructions inside the folder will tell you if the software needs to go in a specific place later.

Why does my antivirus software warn me about the extracted files?

Some antivirus programs flag unfamiliar software, especially open-source programs. If you downloaded from an official source and the README looks legitimate, the warning is usually a false alarm. If you are unsure, search the internet for the software name and "antivirus false positive" to see if others have reported the same warning.