Download R from the official source

R is a free programming language maintained by the R Foundation. You download it from CRAN (the Comprehensive R Archive Network) at cran.r-project.org. The site looks basic, but it's the legitimate source — there's no official installer anywhere else.

When you land on the CRAN homepage, you'll see a section called "Download R" with three links: one for Windows, one for macOS, and one for Linux. Click the link that matches your operating system. Each one takes you to a page with the latest stable version ready to download.

The file size is roughly 80 to 100 megabytes depending on your system. Download time depends on your internet speed, but most people finish in under a minute on a standard connection.

Key Takeaways

  • R downloads from cran.r-project.org, the official repository run by the R Foundation — not from any other website.
  • Windows users download an .exe file and run the installer; macOS users download a .pkg file; Linux users typically install through their package manager or compile from source.
  • After installation, you can use R from the command line or download RStudio (a separate program) for a more user-friendly interface.
  • The download and installation process takes 5 to 10 minutes total on most machines.

Windows installation steps

Once you've downloaded the .exe file, double-click it to open the installer. Windows may ask if you want to allow this program to make changes to your device — click "Yes" to proceed.

The installer will ask you to choose a language (English is the default), then show you the license agreement. Click "Next" to move forward. You'll then see options for where to install R on your computer — the default location (usually C:\Program Files\R) works fine for most people. Click "Next" again.

The installer will ask which components to install. Leave the defaults checked (base R, 32-bit and 64-bit versions, message translations, and help files). Click "Next". You'll see startup options — again, the defaults are fine. Click "Next" one more time, then click "Finish" to complete the installation.

R is now installed. To open it, search for "R" in your Windows Start menu and click "R x.x.x" (the version number will vary). A window called the R Console will open, showing the R prompt (a > symbol). You're ready to use R.

macOS installation steps

After downloading the .pkg file, double-click it to open the installer. macOS will verify the file, which takes a few seconds. The installer window will appear with information about R and the space it needs.

Click "Continue" to move forward. You'll see the license agreement — click "Agree" to accept it. The installer will ask where to install R; the default location (/Library/Frameworks/R.framework) is correct. Click "Install" and enter your Mac password when prompted (this is normal for software installation on macOS).

Once installation finishes, click "Close". To open R, use Spotlight search (Command + Space) and type "R" — you'll see "R.app" in the results. Click it to open the R Console.

Linux installation from the command line

Linux users typically install R through their system's package manager rather than downloading an installer file. The exact command depends on your Linux distribution.

For Ubuntu or Debian-based systems, open a terminal and type: sudo apt-get install r-base. For Fedora, CentOS, or Red Hat systems, type: sudo yum install R. For Arch Linux, type: sudo pacman -S r. Your system will download and install R automatically.

Once installation finishes, type R in the terminal to start the R Console. You'll see the R prompt (>) and can begin working.

Using R from the command line versus RStudio

When you first open R, you're working in the R Console — a text-based interface where you type commands and see results. This works, but it's bare-bones. Many people find it easier to use RStudio, a separate program that wraps around R and adds features like a script editor, project management, and a visual environment for plots and data.

RStudio is optional — R works perfectly fine on its own. But if you plan to write longer scripts or work on projects, RStudio makes the experience smoother. You download RStudio from posit.co/download/rstudio-desktop (Posit is the company that maintains it). Choose the free version, download the installer for your operating system, and run it the same way you ran the R installer. RStudio will automatically find your R installation.

Once RStudio opens, you'll see four panes: a script editor (top left), the R Console (bottom left), your environment and history (top right), and files, plots, and help (bottom right). This layout gives you more control and visibility than the R Console alone.

Checking that R installed correctly

After installation, verify that R is working by typing a simple command. In the R Console (or RStudio's Console pane), type: 2 + 2 and press Enter. R should return [1] 4. If you see that result, R is installed and working.

You can also check the R version by typing: R.version. This shows you which version you installed, which is useful if you need to report it or check compatibility with a package later.

Troubleshooting common download and installation problems

If the installer won't run on Windows, check that you downloaded the file to a location you can access (like your Downloads folder). Some antivirus software blocks installers — temporarily disable it, run the installer, then turn it back on. If the installer still fails, try right-clicking the .exe file, selecting "Run as administrator", and running it again.

On macOS, if you see a message saying the file is from an unidentified developer, right-click the .pkg file and select "Open". macOS will allow it to run. If you're on an Apple Silicon Mac (M1, M2, or newer), make sure you download the "arm64" version, not the Intel version — CRAN provides both.

On Linux, if the package manager says R is not found, your system's package list may be out of date. Run sudo apt-get update (or the equivalent for your distribution) before trying to install again. If you still have trouble, you can compile R from source by downloading the source code from CRAN and following the build instructions, though this is more complex and rarely necessary.

Frequently Asked Questions

Do I need to pay for R?

No. R is free and open-source. You can download it, use it, and modify it without paying anything. RStudio Desktop (the free version) is also free. Some organizations offer paid support or commercial versions, but the core software costs nothing.

What's the difference between R and RStudio?

R is the programming language and environment itself. RStudio is a separate application that makes R easier to use by adding a visual interface, script editor, and project tools. You must install R first; RStudio is optional but recommended for most users.

Can I install multiple versions of R at the same time?

Yes, but it requires some care. You can install different versions in different folders, but only one can be set as the default. If you need multiple versions, consider using a version manager like RVM (on macOS and Linux) or managing them manually on Windows. Most people stick with one current version.

Will R work on my older computer?

R runs on machines with modest specs — you don't need a powerful computer to use it. However, very old systems (more than 10 years old) may not be supported by the latest R version. Check the CRAN download page for your operating system to see the minimum requirements.

How do I update R to a newer version?

Download and run the installer for the new version the same way you did the first time. On Windows and macOS, the new version installs alongside the old one by default, so you can keep both. On Linux, the package manager typically replaces the old version. If you use RStudio, it will automatically find the new R installation.