Basic Ubuntu commands for RStudio Shiny userslinux, rstats ·
RStudio Shiny is a great tool to create interactive reports and dashboards for R users. There are many ways to publish the results, e.g. shinyapps.io is a free online platform but sooner or later it is recommended to install it to a Linux server especially at an enterprise level usage. By the way I use a DigitalOcean VPS (this is a referral link) mainly for practice and to find a place for my free time projects. At the very first period it is best to improve your Linux skills on a virtual server (Oracle VM Virtual Box) because it is totally free and you cannot ruin anything.
Shiny needs a Linux environment so it is recommended to learn at least the basic commands. I use Ubuntu 16.04 server so commands may vary on different Linux distributions. There are great tutorials how to install and configure Linux servers here are some recommended materials:
- How to get your very own RStudio Server and Shiny Server with DigitalOcean by deanattali.com
- How To Install Linux, Nginx, MySQL, PHP (LEMP stack) in Ubuntu 16.04 by digitalocean.com
- Initial Server Setup with Ubuntu 16.04 by digitalocean.com
In the followings I collected the basic Linux commands which are good to know for Shiny Server administrators or owners:
install R packages from terminal to all users. It is quite rare that Shiny apps does not need any external packages so It is a useful command.
Install, uninstall Linux packages Sometimes you have to install other Linux packages to use R packages (e.g. package Cairo needs libcairo2-dev and libxt-dev)
Upgrade currently installed packages Soon or later previously installed packages need to be updated (e.g. R) if there is a new available version.
Modify Shiny config file When you move files from your computer to the Server it is recommended to Use an FTP tool (e.g. FileZilla) but if some command lines needs to be modified it is best to use some built in Linux text editor. I use VIM here is the basic tutorial of it. Here is more information about the config file.
Check Shiny Server logs It is a little bit trickier to fix a bug because you have to check the log files to find what is the problem with the application.
Change permissions According to r Linux Server settings you need to change the ownership of files or folders e.g. to update the R scripts if somebody else uploaded it earlier.
Finally some useful course for a deeper knowledge: