How to Set Up RStudio Server on CentOS 7

RStudio Server provides a browser-based interface for the RStudio environment, enabling developers to code using the R programming language directly through a web browser.

This guide walks you through the full process of installing RStudio Server on a CentOS 7 machine.

Requirements

  • A CentOS 7 server with at least 1GB of RAM (2GB or more is recommended)
  • An active user account with sudo privileges

Step 1: Perform System Updates

Start by logging in as a sudo-enabled user and executing the following commands:


sudo yum install epel-release
sudo yum update
sudo shutdown -r now

Once the server restarts, log in again with the same sudo user credentials.

Step 2: Install the R Programming Language

Use the command below to install R:

Step 3: Download and Install RStudio Server

Execute the following commands to download and install the current stable version of RStudio Server (version 1.0.136 at the time of writing):


cd
wget https://download2.rstudio.org/rstudio-server-rhel-1.0.136-x86_64.rpm
sudo yum install –nogpgcheck rstudio-server-rhel-1.0.136-x86_64.rpm -y

Tip: To check for the latest version, visit the official RStudio Server download page.

After installation, verify the service status and enable it on system startup:


sudo systemctl status rstudio-server.service
sudo systemctl enable rstudio-server.service

Step 4: Enable Web Access to RStudio Server

To make RStudio Server accessible via the browser, adjust the firewall to allow traffic on the required port:


sudo firewall-cmd –permanent –zone=public –add-port=8787/tcp
sudo firewall-cmd –reload

Open your web browser and visit:

http://203.0.113.1:8787

Use the credentials of the sudo user to sign in. If all went well, you’ll land in the RStudio Server IDE interface ready to start programming in R.

Step 5 (Optional): Install Additional CRAN Packages

If you’d like to extend R’s functionality with additional packages from CRAN, follow these steps.

Install Development Tools


sudo yum groupinstall “Development Tools” -y

Launch the R Shell

Install a CRAN Package


install.packages(‘txtplot’)

Exit the R Shell

Conclusion

With these steps completed, your CentOS 7 server is now equipped with RStudio Server, giving you a powerful platform to write and test R code directly from your web browser. You can further enhance your environment by installing additional CRAN packages as needed. This setup is ideal for remote R development and data analysis workflows.

Source: vultr.com

Create a Free Account

Register now and get access to our Cloud Services.

Posts you might be interested in: