Using RStudio Server Open Source in WSL2

open source
Windows
Published

January 29, 2026

Abstract

How to set up a single-user deployment of RStudio Server Open Source on Windows. ```

Description

RStudio Server enables you to run the RStudio IDE. However, as RStudio Server is designed to work with Linux distributions, Windows users require a virtualization technology, called Windows Subsystem for Linux - version 2 (WSL2), to run a Linux kernel inside their system.

Note

Windows Subsystem for Linux is not a supported platform for RStudio Server. An up-to-date list of our supported platforms page is maintained here. This article is provided as a convenience for setting up RStudio Server Open Source for a single user. Multi-user deployments should use Posit Workbench.

Prerequisites

Using WSL2 for setting up RStudio Server requires Windows 10 (version 2004; build 19041 or higher).

  1. You can check your Windows version by pressing the Windows logo key + R, entering “winver”, and hitting return.
  2. If your system is lower than the suggested version, please update to the latest Windows version.

Solution

WSL2 setup

Once you have met the prerequisites, you need to enable WSL2 features on your system.

  1. Open Windows PowerShell with admin privileges.
  2. Turn on the WSL2 feature using the following command in PowerShell:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  1. Enable the Virtual Machine Platform feature by running the following command in the PowerShell:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
  1. Restart your system.

  2. Open Windows PowerShell with admin privileges again.

  3. Set WSL2 as your default version using the following command in PowerShell:

 wsl --set-default-version 2
  1. If you see the following message, download and install the latest WSL2 Linux kernel from Microsoft:

    WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel

Linux distribution setup

  1. Next, download and install a Linux distribution from the Microsoft Store.

  2. You can download the Ubuntu installation file to install manually from here: Download Ubuntu 24.04. While RStudio Server supports other distributions, this article is specific to Ubuntu 24.04.

  3. The Ubuntu documentation shows how to install other versions in the section Install specific versions of Ubuntu on WSL2

  4. Once you install and launch the distribution, you will see a prompt for the initial user configuration like below:

Installing, this may take a few minutes…

Please create a default UNIX user account. The username does not need to match your Windows username. For more information visit: https://aka.ms/wslusers

Enter new UNIX username:

Provide a username followed by password for both your WSL2 distribution and RStudio Server authentication later.

You can now close the WSL2 instance by entering the following command:

exit
Note

You might find it useful to enable ctrl+shift+c/+v as Copy/Paste between WSL2 and the Windows host. Or, use the right-click button to use the copy/paste function.

RStudio Server setup

Now that you have successfully installed a Linux distribution on your system via WSL2, you can setup and run RStudio Server by following these steps:

  1. Press the Windows logo key to open the start menu, then enter wsl to launch your installed Linux distro.

  2. Make sure your Linux packages are up-to-date using the following commands (these steps assume that you have installed an Ubuntu distribution):

sudo apt-get update
sudo apt-get upgrade -y
Note

Provide the password of your user account that you created for the Linux system, not the Windows password used to log in to your PC.

  1. Add the following apt credential to your repository list for Getting the Latest R (v4.5.2 as of this writing):
curl -fsSL https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo gpg --dearmor -o /usr/share/keyrings/cran-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/cran-archive-keyring.gpg] https://cloud.r-project.org/bin/linux/ubuntu noble-cran40/" | sudo tee /etc/apt/sources.list.d/cran.list
sudo apt-get update
Note

More detailed information on installing the latest R for Linux can be found at the official CRAN page.

  1. Install R with some essential dependencies for the RStudio Server and devtools:
sudo apt install -y r-base r-base-core r-recommended r-base-dev gdebi-core build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev
  1. Install latest stable release of RStudio Server for Ubuntu 18 or newer. While we recommend installing the current stable release, you may evaluate pre-release versions by consulting their download pages at RStudio Daily.
wget https://rstudio.org/download/latest/stable/server/bionic/rstudio-server-latest-amd64.deb
sudo gdebi rstudio-server-latest-amd64.deb
Note

You might receive a warning message like Couldn’t find an alternative telinit implementation to spawn. This is a known issue and can be safely ignored.

Note

See the RStudio Release page for full list of supported platforms. Make sure you choose RStudio Server (not Desktop) and match with your installed Linux distribution type and version.

  1. Launch RStudio Server:
sudo rstudio-server start

If you terminate and restart WSL2, you will need to run sudo rstudio-server start again to get RStudio Server up and running.

Note

If you see no error message, your RStudio Server has successfully loaded.

  1. Access your server at http://localhost:8787.
Note

The user name and password are the same as your Linux system’s.

Removing RStudio Server

The following steps explain how to uninstall RStudio Server from WSL2:

  1. Press the Windows logo key to open start menu, then enter wsl to launch your installed Linux distro.

  2. To stop RStudio Server, enter the following command in the WSL2 terminal:

sudo rstudio-server stop
Note

Provide the password of your user account that you created for the Linux system, not the Windows password used to log in to your PC.

  1. Remove your Server:
sudo apt-get remove rstudio-server -y