Install R And RStudio On Windows, macOS, Linux, UNIX (2026)

By Leonard Cucosen
SPSS TutorialsR Programming

In this guide, we will learn how to install R and RStudio on Windows, macOS, Linux, and UNIX [FreeBSD] and get our machine ready for some statistical research and data science.

The whole R and RStudio installation on all the above-mentioned operating systems takes no more than 5-10 minutes. R is a free programming language and software environment for statistical computing and graphics created and maintained by the R Foundation for Statistical Computing. R is also a very popular programming choice among data scientists and statisticians for statistical computing, data mining, and design.

To use R to its maximum potential, you need to install two components on your machine: the R language and the RStudio Desktop IDE. This article covers both installations.

Install R and RStudio on Windows

Select a CRAN mirror

Open a browser and navigate to CRAN R-project website. CRAN is a set of worldwide distributed mirror servers to provide global coverage and fast download speeds for R setup and R packages. Select a mirror server that is nearest to your location. 

CRAN mirror selection page showing worldwide distributed servers for R downloads Select a CRAN mirror closest to your location for faster downloads

  1. On the Download and Install R section, click on Download R for Windows.

CRAN download page with Download R for Windows button highlighted Click "Download R for Windows" to proceed

  1. On the Download for Windows section, click on the base sub-directory.

R for Windows download page showing base subdirectory option Select the "base" subdirectory to download the installer

  1. Click on the latest R release for Windows 32/64bit. At the time of writing this guide, the latest version is R 4.0.4 but by the time you read this guide, a new R version might be available.

Latest R version download link for Windows 32/64 bit installer Download the latest R version for Windows

  1. Once the download is completed, click on Open File to launch the installer. Alternatively, you can find and launch the R installer from your Download folder. 

Browser download notification with Open File button to launch R installer Click "Open File" to launch the R installer

  1. Select Yes when prompted to allow this app to make changes to your computer.

Windows User Account Control dialog requesting permission to run R installer Allow the R installer to make changes to your computer

  1. On the Select Setup Language dialogue box, select your language and click OK.

R Setup language selection dialog with English and other language options Select your preferred language and click OK

  1. On the Information window, review the GNU General Public License agreement and click Next.

R installer showing GNU General Public License agreement text Review the GNU General Public License agreement

  1. On the Select Destination Location, click Next.

R installer destination location dialog showing default installation path Choose the installation directory or keep the default location

  1. Leave the default settings on the Select Components window to avoid 32/64 bit package compatibility issues later. Click Next.

R installer component selection showing 32-bit and 64-bit options checked Keep default settings to avoid package compatibility issues

  1. On the Startup Options window, you can customize the installation further. For most cases, the default settings are sufficient. Leave the default No option selected and click Next.

R installer startup options dialog with Yes and No customization choices Leave the default "No" option selected for startup customization

  1. On the Select Start Menu Folder window, leave the defaults and click Next.

R installer Start Menu folder selection with default R folder name Keep the default Start Menu folder location

  1. You can choose to create a Desktop or Quick Launch shortcut or proceed with the Select Additional Tasks window’s default settings. Click Install.

R installer additional tasks with desktop shortcut and quick launch options Optionally create desktop or quick launch shortcuts

  1. Windows will proceed to install R on your system. Once completed, click Finish to close the installation window.

R Setup completion dialog showing installation successful message R installation completed successfully

At this time, the R language is installed on our Windows machine. However, if you launch R now, you will be greeted by a console and a prompt. To make things much easier for us, we can install a front-end IDE for the R language called RStudio.

The RStudio IDE is a series of interconnected tools designed to enable you to code in R and Python more efficiently. It provides a console, syntax-highlighting editor that facilitates direct code execution, and a range of comprehensive resources for plotting, scanning, debugging, and handling the workspace.

  1. To download RStudio Desktop IDE on your Windows computer, head over to the RStudio Desktop website, scroll down to the Download section and select the RStudio Desktop Free option. Click the Download button.  

RStudio download page showing RStudio Desktop Free version with download button Select the free RStudio Desktop version and click Download

  1. In the All Installers section, download the Windows 10/8/7 .exe installer.

RStudio all installers section showing Windows 10/8/7 exe installer option Download the Windows 10/8/7 .exe installer

  1. Once the download is completed, click Open File to launch the RStudio Desktop Installer. The RStudio installer can be also found in your Download folder.

Browser download notification showing RStudio installer with Open File button Launch the RStudio installer from your Downloads folder

  1. Select Yes when prompted to allow this app to make changes to your computer.

Windows User Account Control dialog requesting permission for RStudio installer Allow RStudio installer to make changes to your computer

  1. On the Welcome to RStudio Setup window, select Next.

RStudio Setup wizard welcome screen with Next button Welcome to the RStudio Setup wizard

  1. On the Choose Install Location window, select Next.

RStudio installer showing destination folder selection with default path Select the installation directory for RStudio

  1. On the Choose Start Menu Folder window, select Install.

RStudio installer Start Menu folder selection with Install button Choose the Start Menu folder and click Install

  1. The RStudio Setup will proceed with the installation on your Windows machine. Once completed, click Finish.

RStudio Setup completion screen showing installation successful message RStudio installation completed successfully

  1. To launch RStudio, click the Search icon on the Windows bar, search for RStudio and launch the RStudio IDE on your machine.

Windows search bar showing RStudio application result ready to launch Search for RStudio in the Windows search bar

  1. When prompted to Enable Automated Crash Reporting, click Yes.

RStudio automated crash reporting dialog with Yes and No options Launch RStudio on Windows

You've successfully installed R and RStudio on Windows! Next, learn how to install packages in R using RStudio.

Install R and RStudio on macOS

Select a CRAN mirror

Open a browser and head over to CRAN R-project website. CRAN is a set of worldwide distributed mirror servers to provide global coverage and fast download speeds for R installers and R packages. Select a mirror server that is nearest to your country. 

CRAN mirror selection page for downloading R on macOS Select a CRAN mirror closest to your location

  1. On the Download and Install R page, click on Download R for (Mac) OS X

CRAN download page with Download R for Mac OS X link highlighted Click "Download R for (Mac) OS X"

  1. On the R for Mac OS X page, download the latest .pkg release.

R for Mac OS X page showing latest pkg installer download link Download the latest .pkg release for macOS

  1. Launch the installer. You should find the R.pkg installer in your Download folder. On the R Welcome window, click Continue.

R installer welcome screen on macOS with Continue button Welcome screen of the R installer on macOS

  1. Read the Important Information and click Continue.

R installer important information screen showing installation details for macOS Read the important information about R installation

  1. Read the Software Licence Agreement and click Continue.

R installer displaying software license agreement text on macOS Review the software license agreement

  1. When prompted to Agree with the Terms Of Software License Agreement, click Agree.

R installer license agreement confirmation dialog with Agree button on macOS Agree to the terms of the software license

  1. Click the Install button to start the installation.

R installer standard install screen showing disk space required on macOS Click Install to begin the R installation

  1. When prompted, type your user password.

macOS authentication dialog requesting user password for R installation Enter your macOS user password to authorize the installation

  1. Click the Close button. R is now installed on your macOS computer.

R installer completion screen showing successful installation on macOS R installation completed successfully on macOS

The RStudio IDE is a collection of tools created to enable coding in R and Python more efficiently. Let's install RStudio on our Mac next.

  1. To download RStudio Desktop IDE on your macOS machine, navigate to the RStudio Desktop website, scroll down to the All Installers section, and download the macOS 10.13+ installer by clicking the .dmg file.

RStudio download page showing macOS 10.13+ dmg installer in all installers section Download the macOS 10.13+ .dmg installer for RStudio

  1. Once the download is completed, launch the installer, usually located in your Download folder, and drag and drop the RStudio icon on your application folder.

RStudio dmg installer showing drag and drop icon to Applications folder on macOS Drag and drop RStudio into your Applications folder

  1. To launch the RStudio, head over to the Applications folder and double-click on the RStudio icon. When prompted if you want to open an application downloaded from the Internet, click Open.

macOS security dialog asking to confirm opening RStudio downloaded from internet Open RStudio from your Applications folder

  1. When prompted to Enable Automated Crash Reporting, click Yes.

RStudio automated crash reporting dialog on macOS with Yes and No options Choose whether to enable automated crash reporting

That’s it. We just installed R and RStudio on macOS. You are now ready to write some cool code in R.

RStudio IDE running on macOS showing console, editor, and environment panels RStudio successfully running on macOS

Install R and RStudio on Linux

In Linux, we have quite a number of distributions, but all of these distros are basically based on three main Linux branches: Debian (e.g., Ubuntu, Linux Mint, Pop OS, etc.), Red Hat (e.g., Fedora, Cent OS, Suse Linux), and Arch (e.g., Manjaro, Endeavors OS).

Install R and RStudio on Debian-based distributions

R installation on Debian and Debian-based distributions is a straightforward process. In this guide, I will install R on Ubuntu. The installation method should be the same for all recent Ubuntu versions.

  • To install R on Ubuntu, open a terminal and type:
` sudo apt -y install r-base`
  • To install RStudio on Ubuntu, open a browser and head over to the RStudio Desktop website, scroll down to the All Installers section and select the Ubuntu 18/Debian 10 .deb package.

RStudio all installers page showing Ubuntu 18/Debian 10 deb package download Select the Ubuntu 18/Debian 10 .deb package

  • When prompted, select Save to download the file on your computer.

Firefox download dialog showing save option for RStudio deb package on Ubuntu Save the RStudio .deb file to your computer

  • Navigate to your Download folder, right-click and select the Open in Terminal option. Alternatively, you can navigate to the Download folder using cd ~/download in the terminal.

Ubuntu file manager right-click context menu with Open in Terminal option Navigate to your Downloads folder and open terminal

  • To install the RStudio .deb package, type in the terminal the following command and use the Tab key on your keyboard to autocomplete the name of the file.
` sudo dpkg -i rstudio<Hit Tab Key>`
  • If the installer complains about any missing dependencies, type in the terminal the following command:
` sudo apt --fix-broken install`

Alternatively, you can use the following command to fix any broken dependencies:

` sudo apt -f install`
  • To launch RStudio, find the application in your App Launcher or type in the terminal:
rstudio

When prompted to Enable Automated Crash Reporting, click Yes.

That's it! You just installed R and RStudio on Ubuntu.

RStudio IDE running on Ubuntu Linux showing console and editor interface RStudio successfully running on Ubuntu Linux

Install R and RStudio on RPM-based distributions

Follow this guide if you are using an RPM-based Linux distribution such as RHEL, Fedora, Cent OS, etc. In this guide, I am going to use Fedora.

  • To install R on Fedora, open a terminal and type:
` sudo yum install R`
  • To install RStudio on Fedora, open a browser and head over to the RStudio Desktop website, scroll down to the All Installers section and select the Fedora 28/Red Hat 8 .rpm package.

RStudio download page showing Fedora 28/Red Hat 8 rpm package option Download the Fedora 28/Red Hat 8 .rpm package

  • When prompted, select Save to download the file on your computer. Navigate to your Download folder and double-click on the.rpm file you just downloaded. The Software Manager window will open. Click Install.

Fedora Software Manager showing RStudio package with Install button Click Install in the Software Manager window

  1. Once the RStudio package is installed, click the Launch button.

Fedora Software Manager showing RStudio successfully installed with Launch button Click Launch after installation completes

When prompted to Enable Automated Crash Reporting, click Yes.

You are now ready to write code in R on your RPM-based operating system.

RStudio IDE running on Fedora Linux showing complete workspace interface RStudio successfully running on Fedora

Install R and RStudio on Arch-based distributions

Follow this guide if you are using Arch or any other Arch-based Linux distribution. In this guide, I am going to use Manjaro.

  • To Install R language on Arch-based systems, open a terminal and type:
` sudo pacman -S r`

Type Y when prompted to proceed with the installation.

  • Install RStudio IDE. To install RStudio, in the terminal type:
` pamac build rstudio-desktop-bin`
  • Launch RStudio from the application launcher or by typing in the terminal: 
`Rstudio-bin`

When prompted to Enable Automated Crash Reporting, click Yes.

RStudio IDE running on Manjaro Arch-based Linux distribution RStudio successfully running on Manjaro (Arch-based distribution)

And just like that, we managed to install R and RStudio on an Arch-based distribution.

Install R and RStudio on UNIX [FreeBSD]

For UNIX, I chose the most popular UNIX distribution out there: FreeBSD. In this guide, I am using FreeBSD with GNOME Desktop Environment but the same installation procedure applies to other Desktop Environments or Windows Managers out there.

  1. Install R language by opening a terminal, switching to the root user (su -), and typing:
` pkg install r`

Bam! The R language is installed on FreeBSD!

  1. Install RStudio IDE on FreeBSD. To install RStudio, in the terminal type as root:
` pkg install RStudio`

Alternatively, you can build the RStudio package from freshports by running the following command as root: 

` cd /usr/ports/devel/RStudio/ && make install clean`

[Optional] RStudio requires /proc to be mounted in /etc/fstab. To edit /etc/fstab, use the ee text editor or install nano using the following command as root:

` pkg install nano`
  1. Next, edit the /etc/fstab:
` nano /etc/fstab`
  • Add the following line into the /etc/fstab file:
` proc /proc procfs rw 0 0`

Your /etc/fstab file should look like this after adding the above line:

FreeBSD terminal showing edited /etc/fstab file with proc mount configuration Edit /etc/fstab to mount /proc on FreeBSD

Save and quit the fstab file (press Ctrl+X then type Y to save).

  • Mount /proc by running the following command:
` mount /proc`
  • You can launch RStudio by launching the app or typing in the terminal:
`rstudio`

You are now ready to write code in R on FreeBSD operating system.

RStudio IDE running on FreeBSD UNIX system showing full interface RStudio successfully running on FreeBSD

Frequently Asked Questions

R is the programming language and computing environment for statistical analysis, while RStudio is an integrated development environment (IDE) that makes working with R easier. Think of R as the engine and RStudio as the car dashboard - you need R to run statistical computations, but RStudio provides a user-friendly interface with features like syntax highlighting, code completion, and visualization tools. You must install R first, then RStudio.
Yes, both R and RStudio are completely free and open-source. R is maintained by the R Foundation for Statistical Computing, and RStudio Desktop (the free version) is developed by Posit. There's also RStudio Server and commercial versions with additional features, but the desktop version is free for personal and commercial use with no limitations on functionality.
Technically, you only need R to run R code, but installing RStudio is highly recommended. While you can use R through its basic console interface, RStudio provides a much better experience with features like script editing, workspace management, plot viewing, package management, and debugging tools. Most R users install both - first R, then RStudio on top of it.
After installation, open R (or RStudio) and you should see the R console with a prompt (>). Type version or R.version.string and press Enter - this will display your R version information. You can also try a simple calculation like 2 + 2, which should return 4. If you see these outputs without errors, R is installed correctly.
On Windows and macOS, you typically need administrator rights for the standard installation. However, on Windows, you can download the R ZIP file and extract it to a user folder, then point RStudio to that R installation. On macOS and Linux, you might be able to install in your home directory. For Linux, using package managers or compiling from source can work without root access if configured properly.
Always install the latest stable version of R from CRAN (Comprehensive R Archive Network). As of 2026, this is typically R 4.x or newer. The latest version includes bug fixes, performance improvements, and new features. Avoid beta or development versions unless you specifically need cutting-edge features. You can check the current version at cran.r-project.org.
To update R, download and install the latest version from CRAN - it will install alongside your current version. On Windows, you can use the installr package: install.packages('installr') then installr::updateR(). On macOS, download the new .pkg file and install it. On Linux, update through your package manager (apt, yum, etc.). After updating, you may need to reinstall packages. RStudio will automatically detect the new R version.
If RStudio can't find R, go to Tools > Global Options > General > R version and click 'Change'. Browse to your R installation directory (usually C:/Program Files/R/R-4.x.x on Windows, /usr/local/bin/R on macOS/Linux). If R still isn't detected, try reinstalling R first, then RStudio. Make sure you've installed R before RStudio, as RStudio requires R to function.

Wrapping Up

In this article, we learned how to install R and RStudio on Windows, macOS, Linux, and UNIX [FreeBSD] operating systems.

Installing R and RStudio on any operating system is straightforward and takes just 5-10 minutes. Ready to start analyzing data? Learn how to calculate standard deviation in R to begin your data analysis journey.