'lib = "/usr/local/lib/R/site-library"' is not writable


I’m looking for some help very badly. When ever I tried to publish to Shiny Server, I get the error message “‘lib = “/usr/local/lib/R/site-library”’ is not writable”. I’m using windows 10 OS. In it I could not find the specified library. So where ever R is installed, I gave the full permissions but still Shiny throws exceptions. However RStudio is showing the publish process successful.

I tried all kinds of suggestions that I found in the internet with no luck. Any help is greatly appreciated.



Hi @smaramreddy,

I don’t have an answer for you, but I’d recommend you save yourself (and prospective answerers) some time by listing out what you’ve tried! :+1:


Yeah, it seems to me that your shiny app is trying to install some R package unsuccessfully. Does your App works? What does your shiny app depends on? What is your sessionInfo()?


The not writable path seems one in your shiny server. Is this a shiny server you have access to? Do you have write permissions for your user in the shiny server in the mentioned path?

When publishing your app, it tries to install some package in a libPaths that can be write to. You should look into how your app behave, why some packages tries to be installed, and look into the path in the shiny server.


I bet your app has install.packages() calls as part of its app code. Never do that; instead, install the necessary packages from the terminal, while logged in as either the user “shiny” or as root. From the terminal you can switch to the shiny user with the command sudo su - shiny (that’s a dash with a space on BOTH sides), then run R and call install.packages() as normal.

Keep in mind installing or upgrading packages will, by default, affect all apps on a server. Use something like packrat if you want to isolate each app to have its own private library.


Thanks to you all for the inputs. Yes, i did had install packages
command. It worked perfectly fine after remvoing it.