[ACCEPTED]-R Shiny Server installation package-shiny-server

Accepted answer
Score: 11

The problem is that shiny-server cannot 14 find the packages that you install, because 13 it runs them as a different user called 12 shiny. This is the user is created upon installation 11 of shiny-server.

The easiest (and safest IMHO) way to 10 solve this issue, is to install the required 9 packages using this user account (shiny). This 8 can be done using the following steps.

  1. Set a password for the shiny user account using sudo passwd shiny, now enter and confirm a password
  2. Switch to the shiny account using: su - shiny
  3. Call up R using R (without sudo)
  4. Install the required packages, in this case: install.packages("shiny")

Note 7 that if you have rstudio-server installed 6 on the same machine then you can perform 5 steps 2-4 using that interface. Simply go 4 the same domain/ip and use :8787 for the 3 rstudio-server interface instead of :3838 2 for shiny-server.

Adapted from my answer 1 here

Score: 5

I had similar issue. After reading the admin guide, here 6 might be a solution for you.

You are having 5 this error because whoever accessing the 4 app does not have the shiny package installed. If 3 you do less /etc/shiny-server/shiny-server.conf and you might notice the following 2 on the first two lines:

# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;

In order to fix the 1 issue, you may do either of the following:

  • Switch to user shiny and install all packages there. e.g., su shiny. However, this is going to duplicate your installed libraries for all users.
  • A clean way is to always run shiny from another user with all the packages, by editing run_as in /etc/shiny-server/shiny-server.conf. In this case, you may change the second line to run_as your_username shiny;, so that it looks for your .libPaths() and then shiny's .libPaths(). You may also add multiple users here.
Score: 0

I had similar troubles. Worked after I did 2 the following instead of the one line installation 1 of the package:

sudo su

then in R do:

install.packages('shiny', repos='http://cran.rstudio.com/')
Score: 0

I am also a newbie to Ubuntu and had similar 10 problems. In my case the problem was that 9 R packages were installed in the folders 8 belonging to user 'ubuntu'. However they 7 have to be available to the root.

I changed 6 user to 'root' with the appropriate command 5 and then ran the install.packages function 4 from R

sudo -i

Hope it will help you on your way. At 3 least your problem is not unique. I found 2 a lot of useful tips by just googling around 1 a bit. E.g.:


More Related questions