> ## Documentation Index
> Fetch the complete documentation index at: https://docs.domino.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish a Shiny App

This topic shows you how to publish an R App with [Shiny](https://shiny.rstudio.com/) in Domino,

In this tutorial, you:

* Create a project and set it up for App publishing

* Publish a simple two file Shiny App to make it globally discoverable

* Observe how other users in Domino can use the App

You’ll be working with the [Telephones by region](https://shiny.rstudio.com/gallery/telephones-by-region.html) example from the [Shiny gallery](https://shiny.rstudio.com/gallery/). In this example, the application serves an interactive bar chart of consumer telephones by region from 1951 to 1961.

It takes approximately 10 minutes to get this example running in Domino.

## Set up the Project

The first step is creating a project with the settings and content you need to publish your App.

1. From the home page, click **Develop > Projects**.

2. Click **New Project**.

3. Give your project an informative name, choose the **Private** visibility setting, then click **Create Project**.

4. Click **Settings** in the project sidebar, then set the Compute environment to **Domino Standard Environment Py3.8 R4.1**. Read [Domino standard environments](/6.3/platform-capabilities/core-concepts/compute-environments/manage-compute-environments/2-domino-standard-environments) to learn more about the contents of this base image.

5. Click **Code** in the project sidebar, then click **Add File**.

6. Name the file `server.R` in the title field above the editor. It’s important that the file be named exactly this, as launching Shiny application with two files, requires a directory to contain files named `server.R` and `ui.R.`

7. In the body of the file, paste the following example Shiny server code.

   ```r theme={null}
   # Rely on the 'WorldPhones' dataset in the datasets
   # package (which generally comes preloaded).
   library(datasets)

   # Define a server for the Shiny app
   function(input, output) {

     # Fill in the spot we created for a plot
     output$phonePlot <- renderPlot({

     # Render a barplot
     barplot(WorldPhones[,input$region]*1000,
     main=input$region,
     ylab="Number of Telephones",
     xlab="Year")
     })
   }
   ```

8. Click **Save** when finished.

9. Click **Add File** again, and name the new file `ui.R`.

10. Paste in the following content, then click **Save** when finished.

    ```r theme={null}
    # Rely on the 'WorldPhones' dataset in the datasets
    # package (which generally comes preloaded).
    library(datasets)

    # Use a fluid Bootstrap layout
    fluidPage(

      # Give the page a title
      titlePanel("Telephones by region"),

      # Generate a row with a sidebar
      sidebarLayout(

        # Define the sidebar with one input
        sidebarPanel(
          selectInput("region", "Region:",
                      choices=colnames(WorldPhones)),
          hr(),
          helpText("Data from AT&T (1961) The World's Telephones.")
        ),

        # Create a spot for the barplot
        mainPanel(
          plotOutput("phonePlot")
        )

      )
    )
    ```

11. The last thing to do before publishing your App is to create an `app.R` file. This is a script that Domino runs after initializing the host that serves your App. It should contain all commands required to launch your App. In this example, the only command you need is:

    ```r theme={null}
    shiny::runApp("./", port = 8888, host = "0.0.0.0")
    ```

    Take note of the `host` and `port` parameters in this command - this is where Domino directs users to your application. Apps in Domino must run with a host of `0.0.0.0`. However, port selection is flexible and port `8888` is no longer required. Create the `app.R` file the same way you did for `server.R` and `ui.R`, then save it.

## Publish an App

1. Click **Deployments > \*Apps & Agents** from the project sidebar.

2. Give your App an informative title and description, and set Permissions to **Anyone can access**. This allows anyone with a network connection to your Domino deployment to access the App if they have the URL.

3. Select `app.R` as your app file.

4. Click **Publish**.

5. After the App status says "Running", click **View App** to load your App.

You should see the interactive bar chart with a Domino toolbar above it showing the project it’s published from, plus buttons to email the App owner and open the description panel.

## Share and consume

Now, you can set the permissions on your app to **Anyone can access** to share it with colleagues who have access to your Domino instance. You can try this out yourself by opening a private or incognito browser, or logging out of Domino, and navigating to the **Deployments > App > Copy App Link**.

To browse more apps, click **Deploy > Apps** in the top navigation menu.


## Related topics

- [Publish Apps](/6.3/platform-capabilities/features/apps/index.md)
- [Publish and share an App](/6.3/platform-capabilities/features/apps/publish-an-app.md)
- [Publish a Flask App](/6.3/platform-capabilities/features/apps/common-app-frameworks/flask-app.md)
- [Publish a Dash App in Domino](/6.3/platform-capabilities/features/apps/common-app-frameworks/dash-app.md)
