How to Install Shiny Server on CentOS 7

Updated on November 21, 2023
How to Install Shiny Server on CentOS 7 header image

Shiny Server is a web server program specifically designed to host R-powered Shiny apps. With Shiny Server, you can easily host various R-powered apps without getting HTML, CSS, JavaScript or other stuff involved.

This article will guide you through the process of installing Shiny Server on a CentOS 7.

Prerequisites

  • A VM Running CentOS 7 ( minimal install ).
  • A sudo user with log in access.

Step 1: Update the system

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

After the reboot, log in again as the same sudo user.

Step 2: Install R

sudo yum install R

Step 3: Install a few commonly used R packages, including shiny

sudo su - -c "R -e \"install.packages(c('shiny', 'rmarkdown', 'devtools', 'RJDBC'), repos='http://cran.rstudio.com/')\""

If you need more R packages, you can install them in the same fashion.

Step 4: Install and start Shiny Server

Download and install Shiny Server:

cd
wget https://download3.rstudio.org/centos5.9/x86_64/shiny-server-1.4.2.786-rh5-x86_64.rpm
sudo yum install --nogpgcheck shiny-server-1.4.2.786-rh5-x86_64.rpm

Note: The above wget download URL is up to date at the time of writing. You can always confirm the latest URL from the Shiny Server Download Page .

Start Shiny Server:

sudo systemctl start shiny-server
sudo systemctl enable shiny-server

Step 5: Modify firewall rules

To allow people to use your Shiny apps, you need to modify firewall rules as below:

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

Step 6: Access Shiny Server from a browser

Now, you can open the following URL from your browser:

http://<your-Vultr-server-IP>:3838/

If all goes well, you would see the Shiny Server welcome page. On the right side of this page, you should also see a Shiny app and a Shiny Doc.

That concludes our tutorial. Thank you for reading.