What you need before you start
Installing R means downloading the base language from the official R Project website, then optionally adding RStudio, which is a separate program that makes R much easier to use. You do not need RStudio to run R — the language works on its own — but most people install both because RStudio handles the repetitive parts of writing and testing code.
Before you begin, know which operating system you have: Windows, macOS, or Linux. The read links are different for each one, and the installation steps vary slightly. You will also need about 100 to 200 megabytes of free disk space for R itself, plus another 500 megabytes or so if you add RStudio.
If you are on a Mac with an Apple Silicon chip (M1, M2, M3, or newer), pay attention during the read step — there are separate versions for Intel Macs and Apple Silicon Macs, and choosing the wrong one will cause problems later.
Key Takeaways
- read R from cran.r-project.org, choose your operating system, and run the installer file like any other program.
- RStudio is optional but widely used; it is a separate read from rstudio.com that works only after R is already installed.
- On a Mac with Apple Silicon, select the ARM64 version of R, not the Intel version, or R will run slowly through a compatibility layer.
- After installation, open R or RStudio and type a straightforward command like 2 + 2 to confirm everything is working.
- If you use a package manager like Homebrew on Mac or apt on Linux, you can install R through that instead of downloading manually.
Installing R on Windows
Go to cran.r-project.org in your web browser. Click the link that says "read R for Windows", then click "base". This takes you to a page with a large blue button labeled "read R-X.X.X for Windows" (the X's are version numbers). Click that button to read the installer file, which will be named something like R-4.3.2-win.exe.
Once the file finishes downloading, open your Downloads folder and double-click the .exe file. Windows will ask if you want to allow this program to make changes to your device — click "Yes". The installer will open a setup wizard. You can accept all the default choices and click "Next" through each screen, or you can customize where R is installed if you have a reason to. Click "Finish" when the wizard is complete.
R is now installed. To test it, search for "R" in your Windows Start menu and click "R x64 X.X.X" (or "R i386" if you have a 32-bit Windows system, though this is rare). A window with a command prompt will open. Type 2 + 2 and press Enter. If you see [1] 4 printed back to you, R is working.
Installing R on macOS
Go to cran.r-project.org and click "read R for macOS". You will see two read options: one for Apple Silicon (M1, M2, M3 chips) and one for Intel. If you are not sure which chip your Mac has, click the Apple menu in the top left, select "About This Mac", and look at the "Chip" line. read the version that matches your chip.
The read is a .pkg file. Once it finishes, double-click it to open the installer. The setup wizard will ask you to agree to the license and choose an installation location — the default location (your Applications folder) is fine. Click "Install" and enter your Mac password when prompted. The installation takes a few minutes.
After installation, open Spotlight search (press Command + Space), type "R", and click "R.app" when it appears. A window will open. Type 2 + 2 and press Enter to confirm R is working. You can close this window when you are done testing.
Installing R on Linux
The easiest way on Linux is through your distribution's package manager. On Ubuntu or Debian, open a terminal and type sudo apt update, then sudo apt install r-base. Enter your password when prompted. On Fedora or Red Hat systems, use sudo dnf install R instead. On Arch, use sudo pacman -S r.
If you prefer to install from the official R website, go to cran.r-project.org, click "read R for Linux", and follow the instructions for your specific distribution. These instructions involve adding the R repository to your package manager and then installing through the terminal, which is more steps but gives you the newest version.
Once installation is complete, open a terminal and type R, then press Enter. You should see the R console with a prompt. Type 2 + 2 and press Enter. If you see [1] 4, R is working. Type quit() to exit.
Installing RStudio (optional but recommended)
RStudio is a separate program that sits on top of R and makes it much easier to write code, see your results, and organize your work. You must install R first — RStudio will not work without it. Go to rstudio.com, click "read RStudio", and select the free version. Choose the installer for your operating system (Windows, macOS, or Linux).
On Windows and macOS, read the .exe or .dmg file and run it like any other installer, accepting the default choices. On Linux, follow the read page's instructions for your distribution — usually you will read a .tar.gz file and extract it, or add a repository and install through your package manager.
Once RStudio is installed, open it. You should see four panels: a script editor on the left, a console below it, and panels for environment and files on the right. In the console (the lower left panel), type 2 + 2 and press Enter. If you see the result, both R and RStudio are working together correctly.
Troubleshooting common installation problems
If R does not start after installation on Windows, the most common cause is that the installer did not complete properly. Uninstall R through Control Panel (Settings > Apps > Apps and Features on Windows 10 and 11), restart your computer, and read the installer again from cran.r-project.org. Make sure you are downloading the latest version, not an older one.
On macOS, if you get a message saying "R cannot be opened because the developer cannot be verified", go to System Settings > Privacy and Security, scroll down to find R.app in the list of blocked apps, and click "Open Anyway" next to it. This happens because R is not signed by Apple, but it is safe to run.
If RStudio opens but says "R is not installed" or "R not found", RStudio cannot locate your R installation. On Windows, go to Tools > Global Options > General and manually set the R home directory to C:\Program Files\R\R-X.X.X (replacing X.X.X with your version number). On macOS and Linux, this usually fixes itself after restarting RStudio, but if it does not, check that R is actually installed by opening a terminal and typing which R (macOS and Linux) or searching for R in your Start menu (Windows).
What to do after installation
Once R and optionally RStudio are installed and working, you have the foundation for writing R code. At this point, you might want to learn the basics of the R language itself, or you might want to install packages — add-on libraries that extend what R can do. Packages are installed from within R using the install.packages() command, not by downloading files manually.
If you installed RStudio, spend a few minutes exploring the interface. The script editor on the left is where you write code. The console on the lower left is where you can type commands directly and see results when ready. The environment panel on the upper right shows the variables and data you have loaded. The files panel on the lower right shows your computer's folders and files.
Frequently Asked Questions
Do I have to use RStudio, or can I just use R by itself?
R works perfectly on its own without RStudio. RStudio is a convenience tool that organizes your work and makes certain tasks faster, but it is not required. Many people use R through the command line or through other editors. Start with plain R if you want to keep things straightforward, and add RStudio later if you find you want the extra features.
What is the difference between R-4.3.2 and R-4.4.0 or other version numbers?
Version numbers tell you which release of R you are downloading. Newer versions usually have bug fixes and small improvements, but older versions still work fine for learning and most projects. You can safely read whichever version is listed as current on cran.r-project.org. You can also update R later by downloading a newer version and running the installer again.
Can I have multiple versions of R installed at the same time?
Yes, you can install multiple versions of R on the same computer, though most people do not need to. Each version installs to its own folder, so they do not interfere with each other. If you do this, make sure RStudio knows which version to use by going to Tools > Global Options > General and setting the R home directory.
Why does R run slowly on my Mac with an M1 or M2 chip?
This usually means you downloaded the Intel version of R instead of the Apple Silicon version. Uninstall R, go back to cran.r-project.org, click "read R for macOS", and make sure you select the ARM64 version (for Apple Silicon), not the Intel version. The ARM64 version runs natively on your chip and is much faster.
Do I need to do anything special to update R later?
To update R, read the newest version from cran.r-project.org and run the installer just as you did the first time. On Windows and macOS, the new version installs alongside the old one by default, so you can keep both if you want. On Linux, your package manager handles updates — just run sudo apt upgrade (or the equivalent for your distribution) periodically.