You could earn up to $300 by adding new articles!Get Started Now
RStudio Server is the web edition of RStudio which is a series of tools designed to facilitate the coding job using the R programming language.
In this article, I will show you how to install RStudio Server on a CentOS 7 server.
Log in as a sudo user, and then execute the below commands:
sudo yum install epel-release sudo yum update sudo shutdown -r now
After the reboot, use the same sudo user to log in back.
sudo yum install R -y
Use the following commands to install the latest stable release of RStudio Server. At the time this article was written, it is
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
Note: You can always find the latest release of RStudio Server from its official download page.
After the installation, the RStudio Server service should have gotten started. You can check its status and set it to run on boot as below:
sudo systemctl status rstudio-server.service sudo systemctl enable rstudio-server.service
In order to allow web access, you need to modify firewall settings as below:
sudo firewall-cmd --permanent --zone=public --add-port=8787/tcp sudo firewall-cmd --reload
Now, point your web browser to
http://203.0.113.1:8787, and then sign in with the credentials of the current sudo user. If nothing goes wrong, you will be brought into the RStudio Server IDE in which you can write and test your R code.
If you want to install more packages from CRAN (Comprehensive R Archive Network), you can make it happen as follows:
Install development tools:
sudo yum groupinstall "Development Tools" -y
Enter the R shell:
sudo -i R
Install the package you need as below, and more packages can be installed in the same fashion:
quit the R shell:
That's it. Thanks for reading.