There are two main places to deploy Chirp:
- On shinyapps.io
- On your own server
Whichever deployment method you want to choose, you will need a file named
app.R that contains the functions which launches the Chirp:
chirp::chirp(). There is a convenience function to obtain the latter.
This will create a file named
app.R in the working directory.
If you had not specified your
_chirp.yml you should either do so or get a token with rtweet from your server. This won't work on shinyapps.io, if you deploy on the latter you have to add your
credentials to the config file.
Note that there is a thorough guide if the explanation below does not suffice.
- Open your Chirp project in RStudio.
- Create an account on shinyapps.io.
- Go to your shinyapps dashboard, click your username and then click "Tokens".
- Click the "Show" button and copy the command.
- Paste and run the command from your project.
- You can then deploy your application with
You should then be able to see your application live at
The best place to set this up is probably Digital Ocean which offers a great guide in case 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
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 Chirp.
sudo su - -c "R -e \"remotes::install_github('JohnCoene/chirp')\""
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-22.214.171.1243-amd64.deb sudo gdebi shiny-server-126.96.36.1993-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 to
80 in the Shiny configuration file.
Your project folder which contains, at least,
_chirp.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
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
If you have a question or issue feel free to raise it on Github. In case you're unsure how to deploy, I'll happily deploy it for you or your orgnisation in exchange for a ☕: hit the button below and contact me at firstname.lastname@example.org.Buy me a coffee