There are two ways to deploy auritus:
If you had so far been using auritus by running launch_auritus()
from your project folder, create an R file called app.R
that contains that command.
Deploying on shinyapps.io is probably the easiest solution. This requires the RStudio IDE, which is available for free and runs on any platform (Linux, Max, and Windows).
Note that there is a thorough guide if the explanation below does not suffice.
rsconnect
with install.packages('rsconnect')
.rsconnect
with library(rsconnect)
.deployApp()
You should then be able to see your application live at https://myname.shinyapps.io/my-app/
You can setup a Shiny server on pretty much any machine, you can download the Community Edition for free.
The easiest way to set this up is probably on Digital Ocean which offers a great guide if the instructions below do not suffice.
On a Digital Ocean Ubuntu 16.04 machine, first install R.
sudo apt-get install r-base
Then install the shiny
and remotes
package:
sudo su - -c "R -e \"install.packages(c('shiny', 'remotes'), repos='https://cran.rstudio.com/')\""
Note that all packages should be installed as above so that all users (including shiny) have access to the packages.
Now install auritus.
sudo su - -c "R -e \"remotes::install_github('news-r/auritus')\""
You will also need the R package relevant to your database type
(in _auritus.yml
).
# SQLite
sudo su - -c "R -e \"install.packages('RSQLite', repos='https://cran.rstudio.com/')\""
# Postgres
sudo su - -c "R -e \"install.packages('RPostgres', repos='https://cran.rstudio.com/')\""
# MySQL
sudo su - -c "R -e \"install.packages('RMySQL', repos='https://cran.rstudio.com/')\""
# MariaDB
sudo su - -c "R -e \"install.packages('RMariaDB', repos='https://cran.rstudio.com/')\""
Now you can install the Shiny server.
sudo apt-get install gdebi-core
wget https://download3.rstudio.org/ubuntu-14.04/x86_64/shiny-server-1.5.9.923-amd64.deb
sudo gdebi shiny-server-1.5.9.923-amd64.deb
By default the shiny server runs on port 3838
, make sure it is accessible with:
sudo ufw allow 3838
You can change the port in the configuration file.
Your project folder which contains, at least, app.R
and _auritus.yml
, must be copied under srv/shiny-server/
, you can do so however you prefer, i.e.: using Git. You can then visit your application at domain.com/my-directory
.
Note that some options such as the theme
require the server to be restarted in order to take effect; you can do so with.
sudo systemctl restart shiny-server
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.