Skip to main content

Using a Custom Landing Page

Overview

It is possible to specify a custom landing page that your anonymous/logged-out users see when they visit Posit Connect.

Configuration

Use the Server.LandingDir setting to specify a path to a directory containing a custom landing page. The directory cannot be inside Posit Connect’s installation directory (typically /opt/rstudio-connect).

Note

When both Server.RootRedirect and Server.LandingDir are configured, unauthenticated users will only be able to see the custom Server.LandingDir by visiting the Server.DashboardPath (default: /connect). Visiting the dashboard’s root URL (/) will redirect users to the path configured by Server.RootRedirect. If the path located at Server.RootRedirect requires authentication, then the user will be prompted to log in to Connect.

Custom landing page assets

Include all assets (JavaScript, CSS, images, etc.) for your custom landing page in the directory you specified in the Server.LandingDir setting. Be sure to include an index.html, which will be served by default.

Example

An example landing page is available in the extensions/landing-page directory of the posit-dev/connect-extensions repository.

To begin customizing your landing page, download the example and copy its index.html file and its css and images directories to a location of your choice outside of the Posit Connect installation directory. Do not copy the other files in the example directory, such as manifest.json and README.md. Connect serves all files in Server.LandingDir to logged-out users. For example:

Terminal
git clone --depth 1 https://github.com/posit-dev/connect-extensions.git
mkdir -p /usr/local/share/posit-connect-customizations/landing-page
cp -r connect-extensions/extensions/landing-page/index.html \
    connect-extensions/extensions/landing-page/css \
    connect-extensions/extensions/landing-page/images \
    /usr/local/share/posit-connect-customizations/landing-page/

For servers without internet access, download the example on a different computer and transfer the files to the server.

Then set Server.LandingDir to the location of your copy:

/etc/rstudio-connect/rstudio-connect.gcfg
[Server]
LandingDir = "/usr/local/share/posit-connect-customizations/landing-page"
Note

Your custom landing page directory must be located outside of Posit Connect’s installation directory (typically /opt/rstudio-connect). Posit Connect will not start if Server.LandingDir points to a location under this directory, because these files may be overwritten when Posit Connect is updated.