Rstudio server setup on Ubuntu server 16.04 with xcms and MetaboAnalystR

Update system

sudo apt-get update && sudo apt-get upgrade -y

Update the sources.list to include latest R dist

sudo sh -c "echo deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/ >> /etc/apt/sources.list"

The Ubuntu archives on CRAN are signed with the key of “Michael Rutter marutter@gmail.com” with key ID E084DAB9. To add the key to your system with one command use

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9

Install R

sudo apt-get update && sudo apt-get install -y r-base r-base-dev

Install xcms dependencies

sudo apt-get install -y r-cran-xml
sudo apt-get install -y libcurl4-openssl-dev libxml2-dev libssl-dev build-essential software-properties-common libnetcdf-dev

Install xcms CAMERA

sudo R
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("xcms", version = "3.8")
BiocManager::install("CAMERA", version = "3.8")
BiocManager::install("msdata", version = "3.8")
BiocManager::install("IPO", version = "3.8")

Install Rstudio server

Install the current version of rstuido server(e.g.v1.1.453)

sudo apt-get install gdebi-core
wget https://download2.rstudio.org/rstudio-server-1.1.463-amd64.deb
sudo gdebi rstudio-server-1.1.463-amd64.deb

The service in running on default port: 8787

Install dependencies for MetaboAnalystR

For Rmpi

sudo apt-get install -y libopenmpi-dev

For Cairo

sudo apt-get install -y libcairo2-dev libxt-dev

For magick

sudo add-apt-repository -y ppa:opencpu/imagemagick
sudo apt-get update
sudo apt-get install -y libmagick++-dev

For rgl

sudo apt-get install libx11-dev libcgal-dev libglu1-mesa-dev libglu1-mesa-dev -y

For siggenes

sudo R
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("siggenes", version = "3.8")

Install Tex Live

sudo apt-get install texlive-full -y