Installing and Setting Up Shinylive (R)

Guide to Install the {shinylive} R Package and Configure Asset Management

Learn how to install the {shinylive} R package (from CRAN or GitHub) and set up asset management to run Shiny apps in the browser using WebAssembly.

Tools
Author
Affiliation
Published

March 17, 2025

Keywords

shinylive installation R, serverless Shiny setup, R shinylive

Introduction

The {shinylive} package enables you to run Shiny applications entirely in the browser by converting them into static files powered by WebAssembly. In this tutorial, we’ll walk through the installation process and explain how to configure asset management so that your Shiny apps can run serverlessly.



1. Installing the {shinylive} Package

You have two main options for installing {shinylive}:

Option 1: Install from CRAN

Run the following command in R:

install.packages("shinylive")

This installs the latest stable release from CRAN.

Option 2: Install the Development Version from GitHub

For the latest features and updates, use the pak package:

# If pak is not installed, install it first
install.packages("pak")
pak::pak("posit-dev/r-shinylive")
Note

Choose the option that best fits your needs.

2. Configuring Asset Management

The {shinylive} package downloads essential web assets (HTML, JavaScript, CSS, WASM files) required to run Shiny apps in the browser. These assets are cached locally for faster loading.

Check Installed Asset Information

After installation, verify that assets are installed and see version details:

shinylive::assets_info()

This function displays the package version, asset version, and the local cache directory.

Here is an example output:

shinylive R package version: 0.3.0.9000
shinylive web assets version: 0.9.1

Local cached shinylive asset dir:
→ /root/.cache/shinylive

Installed assets:
• /root/.cache/shinylive/shinylive-0.9.1

Manually Download Specific Assets (Optional)

If you need to force a download of a specific asset version, run:

shinylive::assets_download("0.1.5")

Replace "0.1.5" with your desired version.

Clean Up Old Assets

To remove outdated assets and free up space, use:

shinylive::assets_cleanup()

Or to remove a specific version:

shinylive::assets_remove("0.1.5")

3. Confirming Your Setup

Once installed, confirm that everything is working properly by running:

shinylive::assets_info()

This should print the current version details and the cache path where the assets are stored. If everything is set up correctly, you’re ready to export and run your Shiny apps using {shinylive}.

Further Reading

Conclusion

Installing and setting up {shinylive} in R is the first step toward creating serverless Shiny applications that run directly in your web browser. By following this guide, you’ve learned how to install the package, configure asset management, and verify your installation. With these tools in place, you’re ready to convert and deploy Shiny apps for interactive, static web pages.

Back to top

Reuse

Citation

BibTeX citation:
@online{kassambara2025,
  author = {Kassambara, Alboukadel},
  title = {Installing and {Setting} {Up} {Shinylive} {(R)}},
  date = {2025-03-17},
  url = {https://www.datanovia.com/learn/interactive/r/shinylive/installation.html},
  langid = {en}
}
For attribution, please cite this work as:
Kassambara, Alboukadel. 2025. “Installing and Setting Up Shinylive (R).” March 17, 2025. https://www.datanovia.com/learn/interactive/r/shinylive/installation.html.

Enjoyed this page?

We'd appreciate it if you could share it with your friends or colleagues. Spread the knowledge!

Stay connected with us to never miss out on future posts by following us: