DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

How does AI transform chaos engineering from an experiment into a critical capability? Learn how to effectively operationalize the chaos.

Data quality isn't just a technical issue: It impacts an organization's compliance, operational efficiency, and customer satisfaction.

Are you a front-end or full-stack developer frustrated by front-end distractions? Learn to move forward with tooling and clear boundaries.

Developer Experience: Demand to support engineering teams has risen, and there is a shift from traditional DevOps to workflow improvements.

Related

  • Application Modernization and 6 R's
  • What Are the 7 Rs of Cloud Migration Strategy?
  • Power BI Embedded Analytics — Part 3: Power BI Embedded Demo
  • DGS GraphQL and Spring Boot

Trending

  • How You Clear Your HTML5 Canvas Matters
  • Improving Cloud Data Warehouse Performance: Overcoming Bottlenecks With AWS and Third-Party Tools
  • Integrate Spring With Open AI
  • Web Crawling for RAG With Crawl4AI
  1. DZone
  2. Coding
  3. Languages
  4. Install R Shiny Server on CentOS 7

Install R Shiny Server on CentOS 7

We look at how to install R, a popular language for data science, and get it running on the open source Linux distribution, CentOS.

By 
Sajid Qureshi user avatar
Sajid Qureshi
·
Updated Jan. 17, 19 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
11.1K Views

Join the DZone community and get the full member experience.

Join For Free

The shiny server is a web server which provides you with a platform to host R-powered shiny applications 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:

  • Free and open source.
  • Host multiple Shiny applications, each with its own URL.
  • Can be configured to allow any user on the system to create and deploy their own Shiny applications.
  • Pre-built installers for select Linux distributions.

Prerequisites

  • You must have Alibaba Cloud Elastic Compute Service (ECS) activated and verified your valid payment method. If you are a new user, you can get a free account in your Alibaba Cloud account. If you don’t know about how to set up your ECS instance, you can refer to this tutorial or quick-start guide. Your ECS instance must have at least 1GB RAM and 1 Core processor.
  • Root user privileges.

In this article, we are using root user to install Shiny server. You can also switch from non-root user to root user using sudo -i command.

Update the System

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

Install R

An R package is required to install the Shiny server so we need to install R. Before installing the 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.

Install Shiny Server

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.
wget https://download3.rstudio.org/centos6.3/x86_64/shiny-server-1.5.7.907-rh6-x86_64.rpm

Next, install the downloaded shiny server using the following command.
yum install --nogpgcheck shiny-server-1.5.7.907-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
firewall-cmd --reload

Web Interface

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.)

Host a Directory of Applications

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 for an 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.

Manage Your Own Applications

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 .

Conclusion

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.

By Sajid Qureshi, Alibaba Cloud Tech Share Author. Tech Share is Alibaba Cloud's incentive program to encourage the sharing of technical knowledge and best practices within the cloud community.

R (programming language) application

Published at DZone with permission of Sajid Qureshi. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Application Modernization and 6 R's
  • What Are the 7 Rs of Cloud Migration Strategy?
  • Power BI Embedded Analytics — Part 3: Power BI Embedded Demo
  • DGS GraphQL and Spring Boot

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • [email protected]

Let's be friends: