Skip to content

Your first day on the hub

This guide is for data scientists who are new to the hub. It takes you from your first login to an app that a colleague can open.

1. Log in and start RStudio

Open https://hub.<your domain> and log in with your company login. The page shows one tile per IDE. Click RStudio, leave the size at Standard, and wait a few seconds for the session to start. The first start also creates your home directory. Only you can access it, and from now on every IDE shows the same home directory. See The IDEs for details.

2. Create a project

Choose File > New Project > New Directory > Hub project, select the Shiny template and name the project sales. Alternatively, run this in the console:

hub::new_app("sales", template = "shiny")

This creates an renv project at ~/sales with the template's packages installed, which takes a minute or two. It contains an app.R that runs as it is, a hub.yaml with the app's settings on the hub, and a CLAUDE.md that tells the coding agent how the project is laid out. VS Code opens it with File > Open Folder (where projects live). The other templates, for an API, a Quarto report, a dashboard, a pipeline or an MCP server, are listed under New projects.

3. Work on the app

Open app.R and click Run App. Edit the code and run it again. To add a package, run renv::install("ggplot2"). Before you deploy, run renv::snapshot() to record the packages the project uses. Always install packages inside the project this way: a package installed outside a project is not recorded and will be missing on the hub.

The coding agents know how this hub works. To start Claude Code, run claude in the terminal. Posit Assistant is the pane in RStudio. The first time, Claude Code asks you to sign in with your Anthropic account, and Posit Assistant with a Posit AI login or an API key (see Accounts). You can ask either of them to add a feature, explain an error or deploy the app, and they run the commands below themselves.

4. Deploy

In the terminal, in the project directory, run:

$ hub deploy

The hub builds an image with your packages, pushes it and registers the app. The first build takes a few minutes. Later builds with the same packages take seconds. The last line of the output is the app's address on the apps host, https://apps.hub.<your domain>/app/sales. Open it. The apps page at https://apps.hub.<your domain> lists every app you are allowed to see.

If the build fails, the lines above hub: FAILED give the reason, and When a build fails has the fix for each message. You can also ask the agent to read the output.

5. Share the app

Edit hub.yaml. Set the title that the apps page shows, a description, and access-groups, the groups from your company login whose members may open the app. If access-groups is empty, everyone on the hub can open it.

name: sales
title: Sales dashboard
description: Monthly figures by region.
access-groups: [sales]

Run hub deploy again. The new settings take effect about a minute later. Colleagues in the group open the address with their own login, and the app can tell who they are through hub::user().

6. Next steps

  • Store a secret. Put a database password into .Renviron in the project. The deploy stores it as the app's secret and never puts it into the image. Alternatively, run hub env set sales DB_PASSWORD=… in the terminal. See Secrets and environment.
  • Undo a mistake in production. hub rollback sales restores the previous build for new visitors. hub history sales lists the last ten builds.
  • Deploy on every merge. hub git bind ties the app to a branch of your repository. See Deploying from a repository.
  • Refresh data every morning. Write a targets pipeline with a schedule, and an app that reads the pipeline's store. See Pipelines.
  • Work in Python. Use VS Code or JupyterLab, uv for the environment, and hub deploy for a Shiny for Python app or a FastAPI service. See What deploys.