It is easy to get started with Shiny – luckily, your apps can be hosted for free to be shared with the world.
Shiny is an incredible piece of technology. The ease of which with you can make simple prototypes or even production-grade applications is unparalleled. All you need is a bit of R skills.
But all this is worthless unless you can present your app to your users. If you are just starting out, you don't need any headaches with deployment. You also probably don't want to pay big bucks for hosting either.
So what are your options for free Shiny app hosting? And how many apps can you host for free?
I ask this question on Twitter and got a bimodal response. Most people (51%) thought you can host 5 apps for free. However, the choice 'As many as you like' was voted second (36%). 9% of respondents thought you cannot host any apps for free.
Free hosting options
By free I mean that the total cost of ownership is $0. You are not paying monthly fees for cloud hosting, and you are not paying licensing fees.
You can use the Shiny Hosting Options table to find all the free options here:
At the time of writing (December 16, 2021), there are three platforms (PaaS) that offer free hosting:
In principle, you can sign up for each service and use the free tier to host your apps.
This is a fully managed platform for hosting Shiny apps. It is operated by RStudio. You can host up to 5 apps for free. The free tier gives you 25 active hours per month. This is the uptime for the 5 apps combined. Apps are served by instances with 1 GB RAM, and you have a 1 GB upload bundle size limit.
This is the option that most respondents of the Twitter poll likely referred to. Shinyapps.io offers push-button publishing that makes deployment real easy.
The other two platforms are a bit more involved because the Shiny apps need to be containerized first.
The Free plan gives your 550 dyno hours per month and 5 free apps. If you verify your Heroku account with a credit card (you will not be charged, unless you use a paid service), you get 1000 free dyno hours, 100 free apps. Apps are running on instances with 0.5 GB RAM. Apps on the Free plan will sleep after 30 mins of inactivity.
Fly offers a Free tier that includes 2,340 hours per month that is enough to run 3 shared 1 CPU virtual machines with 256 MB RAM full time.
Multiple user accounts
In total, 5 + 100 + 3 = 108 apps. Memory per app and available app hours differ among the platforms. But this is a generous amount for a lot of use cases with smaller apps and not a huge demand from the users.
if you want to run more free apps, just make another organization and invite your friends
So in this sense, you can host as many apps for free as you like using different email addresses. But if you need larger instances, higher availability, custom domains, etc. you'll have to upgrade to a paid tier sooner or later.
Multiple apps in the same container
If this weren't enough, you can even host multiple Shiny apps in the same container using the Shiny Server-based parent image. The setup is quite simple, just copy multiple apps into the Shiny Server root folder (
/srv/shiny-server/), as explained in this repository:
Try pulling ad running the Docker image
docker pull analythium/correlation:v3 docker run -p 4000:3838 analythium/correlation:v3
You'll find two apps on the following two paths:
http://localhost:4000/app3d/. The Dockerfile looks like this:
FROM rocker/shiny:4.0.5 ## install dependencies RUN install2.r -r http://cran.rstudio.com/ rgl ## copy the apps COPY ./app-v1.R /srv/shiny-server/app2d/app.R COPY ./app-v2.R /srv/shiny-server/app3d/app.R USER shiny EXPOSE 3838 CMD ["/usr/bin/shiny-server"]
In theory, there is no limit to the number of apps you can host simultaneously using this setup.
It turns out that most respondents were right in their own ways because I left many details undefined. Shinyapps.io is the platform that R and Shiny users are most familiar with. This is due to the RStudio IDE integration and most tutorials pointing to this free option. So that is your 5 free apps.
If you need to host more Shiny apps, sign up with your other email address to get another 5 apps for free. Or learn how to dockerize Shiny apps and deploy to Heroku and Fly.io under the free tier. Fly.io is your best option if you want the apps running 24/7 and under a secured custom domain (none of this is offered for Shinyapp.io and Heroku).
If you run out of email addresses and exhausted all your free apps, you can consider including multiple apps in the same Docker image and deploy these to Heroku and Fly.io. Those who chose 'As many as you like' were probably thinking along these lines. 108 times many times unlimited is a lot!