Hosting shiny app on Google Colab

The free plan of is pretty limited, but Google Colab provides quite decent machines for free. I tried to run the example shiny app created by RStudio in a Google Colab notebook, but it didn't work. Here's the app:


# Define UI for application that draws a histogram
ui <- fluidPage(

    # Application title
    titlePanel("Old Faithful Geyser Data"),

    # Sidebar with a slider input for number of bins 
                        "Number of bins:",
                        min = 1,
                        max = 50,
                        value = 30)

        # Show a plot of the generated distribution

# Define server logic required to draw a histogram
server <- function(input, output) {

    output$distPlot <- renderPlot({
        # generate bins based on input$bins from ui.R
        x    <- faithful[, 2]
        bins <- seq(min(x), max(x), length.out = input$bins + 1)

        # draw the histogram with the specified number of bins
        hist(x, breaks = bins, col = 'darkgray', border = 'white')

Then I ran

shinyApp(ui = ui, server = server, options = list(host = ""))

Which gives the output

Listening on

But then I can't open the webpage with I clicked on the Should the host be changed? Anyone also tried this?

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.