Shiny Server is a web server which provides you with a platform to host R-powered shiny application on the server. You can host multiple shiny applications on a single server without getting HTML, CSS, and other stuff involved. It enables you to support non-web socket-enabled browsers like Internet Explorer 10.
Some of the features of the Shiny server are listed below:
In this article, we are using root user to install Shiny server on an Alibaba Cloud Elastic Compute Service (ECS) instance. you can also switch from non-root user to root user using
sudo -i command.
It is recommended to install any package on a freshly updated system. So, first upgrade all the available packages using the following command.
yum -y install update
R package is required to install the Shiny server so we need to install R. Before installing R package you'll have to add EPEL repository to your CentOS 7 system. Execute the following command and it'll do the job for you.
yum install epel-release
Next, install R.
yum -y install R
You'll also need to install the Shiny R package and some other dependencies before installing Shiny Server:
su - -c "R -e \"install.packages(c('shiny', 'rmarkdown', 'devtools', 'RJDBC'), repos='http://cran.rstudio.com/')\""
The above command will take a few minutes, so hold on a bit. You should see something similar to this output in the end.
All the dependencies required for the Shiny server are installed now and we are ready to install it on CentOS 7. So let's download the latest stable release of the Shiny server using the following command.
Next, install the downloaded shiny server using the following command.
yum install --nogpgcheck shiny-server-220.127.116.117-rh6-x86_64.rpm
You'll see the following output at the end.
If you see the above-given output then the Shiny server is successfully installed on your CentOS 7 system. Now you'll need to start and enable the shiny server services. Execute the following commands and they'll do the job for you.
systemctl start shiny-server
systemctl enable shiny-server
Finally, you'll need to modify the firewall rules for your Shiny server to access it. Shiny server listen to port number 3838 by default.
firewall-cmd --permanent --zone=public --add-port=3838/tcp
Open up your favorite web browser and visit http://YourServerIP:3838/ then you'll see a welcome webpage of Shiny server like this:
(NOTE: Replace YourServerIP with your actual server IP address.)
Shiny Server allows you to host a directory of the shiny application. By default, Shiny Server will use a
site_dir to make any applications and assets stored in
/srv/shiny-server/ available. Place your directory of shiny applications in the default directory.
For example, suppose you have a directory of application called 'myApp'. This directory should be stored in the default directory of shiny server like
/srv/shiny-server/myApp. Now you can access your application on http://YourServerIP:3838/myApp . HTML files also can be placed in this directory and you can access them from Shiny Server.
You can manage your shiny applications and update your applications stored in the home directory. All the shiny applications are hosted inside the user's ShinyApps directory.
For example, suppose you stored your shiny application in
/home/user/ShinyApps/myApp then your new application is available on http://YourserverIP:3838/YourLinuxUsername/myApp .
In this article, you've learned how to install Shiny Server on your CentOS 7 server. You've also learned to host a directory of applications and managing your own applications. We hope now you have enough knowledge to work with Shiny Server.
Alibaba Clouder - November 1, 2018
roura356a - December 5, 2019
Hiteshjethva - January 8, 2020
Alibaba Clouder - May 15, 2019
Alibaba Clouder - April 1, 2019
Alibaba Clouder - April 12, 2019
Explore Web Hosting solutions that can power your personal website or empower your online business.Learn More
Web App Service allows you to deploy, scale, adjust, and monitor applications in an easy, efficient, secure, and flexible manner.Learn More
Explore how our Web Hosting solutions help small and medium sized companies power their websites and online businesses.Learn More
Learn how to obtain an ICP Filing or ICP Commercial License to host your website in Mainland China.Learn More