Images not displaying in a published Shiny app

shinyapps.io
publishing
Published

January 29, 2026

Abstract

This article helps diagnose why images appear locally but do not display after publishing a Shiny app, and outlines the most common fixes related to asset paths, deployment structure, and HTTPS.

Introduction

Images might fail to display in a deployed Shiny application on shinyapps.io, even when image references appear to work correctly during local development.

Problem

Images do not display in a published Shiny application on shinyapps.io, despite appearing correctly when the app is run locally.

This issue typically occurs when image files are not included in the deployment bundle. On shinyapps.io, only files inside the application directory are uploaded during publishing. If you store image assets outside the app directory or do not place them in the www/ folder, they are not available at runtime.

Solution

To ensure images are included and displayed correctly in a deployed Shiny application:

  1. Create a folder named www in your Shiny app’s root directory if it does not already exist.
  2. Place all image files referenced by your app inside the www folder.
  3. Reference images in your UI code using only the filename (for example, "logo.png"). Do not include www/ in the path, as Shiny automatically serves files from this directory.

Example

ui <- fluidPage(
  img(src = "logo.png", height = "80px")
)