-
Notifications
You must be signed in to change notification settings - Fork 289
CentOS step by step Installation Instructions
Complete list of instructions for installing Shiny Server and its prerequisites on CentOS.
Get the latest instructions and code from http://www.rstudio.com/shiny/server/install-opensource
We'll keep them here for posterity's sake, but you should not be using Shiny Server 0.3.x anymore.
We'll first need to install node.js. The recommended approach is to install from EPEL. If your system is already configured to leverage EPEL, you can skip to the last command in this section. (EPEL guide here.)
# Get the EPEL rpm
wget http://mirror.us.leaseweb.net/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm --test
# Import the EPEL GPG key
wget https://www.fedoraproject.org/static/0608B895.txt
sudo mv 0608B895.txt /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
# Verify that the key has been imported.
rpm -qa gpg*
## You should see a line like this: gpg-pubkey-0608b895-4bd22942
# Install the rpm
sudo rpm -ivh epel-release-6-8.noarch.rpm
Now that we have EPEL setup, we can install npm. This will likely take a few minutes.
sudo yum install npm
sudo yum install R-core R-devel
# Install Shiny in system-wide library
sudo su - -c "R -e \\"install.packages('shiny', repos='http://cran.rstudio.com/')\\""
sudo npm install -g shiny-server
# Install Upstart script
sudo wget\
https://raw.github.com/rstudio/shiny-server/master/config/upstart/shiny-server.conf\
-O /etc/init/shiny-server.conf
# or for init.d...
# sudo wget\
# https://raw.github.com/rstudio/shiny-server/master/config/init.d/redhat/shiny-server\
# -O /etc/init.d/shiny-server
# sudo chmod 755 /etc/init.d/shiny-server
# sudo chkconfig --add shiny-server
# Create a system account to run Shiny apps
sudo useradd -r shiny
# Create a root directory for your website
sudo mkdir -p /var/shiny-server/www
# Create a directory for application logs
sudo mkdir -p /var/shiny-server/log
# Start Shiny
sudo start shiny-server
# Optional: Install examples to test
sudo cp -R /usr/lib64/R/library/shiny/examples /var/shiny-server/www/
Now open a browser to http://<hostname>:3838/examples/
and see if they work. Keep in mind that port 3838 will need to be open on any firewall on or in front of your machine.