2 Getting Started

This chapter helps you install RStudio Connect, manage the server, and perform some initial configuration. We built this checklist to guide you through that process.

  1. Install R - Red Hat/CentOS 2.2.2.1, SLES 2.2.3.1, Ubuntu 2.2.4.1
  2. Install RStudio Connect - Red Hat/CentOS 2.2.2.2, SLES 2.2.3.2, Ubuntu 2.2.4.2
  3. Configure Server.Address - 2.3.1
  4. Configure Authentication - 2.3.2, 11
  5. Restart RStudio Connect - 5.1
  6. Sign into RStudio Connect - 2.3.3
  7. Configure email sending - 2.3.4
  8. (optional) Install TensorFlow Dependencies - 2.3.5
  9. (optional) Install Python - 17

2.1 Need Help?

RStudio is happy to provide support for anyone using the product.

To focus on building the best products, RStudio does not provide installation or professional services. If you require such assistance, please refer to our certified partners.

RStudio support is limited to our professional products. If your question is related to R, R code, or specific R packages, please visit https://community.rstudio.com.

If your question is related to RStudio Connect, you can open a support ticket by:

  1. Running the diagnostics script:

    /opt/rstudio-connect/scripts/run-diagnostics.sh
    Note: if you have not been able to download the software, skip this step.
  2. Email with:
  • Your name and company
  • What you are trying to do
  • What you have tried
  • Any errors you have received
  • The diagnostics file produced from step 1

Our Support Agreement contains important details about the support we provide.

2.2 Installation

2.2.1 Prerequisites

RStudio Connect requires an installation of R version 3.1.0 or higher. We recommend installing R from source and making multiple versions available.

Installing R from source lets you have more than one R installation. It also gives you a more stable, reproducible environment by avoiding changes to the R installation caused by Linux distribution updates.

Ask your R developers what R versions they use. Install their exact versions on the RStudio Connect server. The latest patch release for each R version is usually also fine – patch releases contain small bug fixes that do not normally alter how deployed R code runs.

We recommend installing R from source rather than with a package manager like apt, yum, or zypper. Installing R with a package manager means that R will be updated when the package manager update command is run and a new version is released. Any content that was uploaded and built with the old R version will need to be rebuilt for the new R version. This is not guaranteed to succeed.

User content is executed in an environment as close as possible to the development environment. RStudio Connect can better mirror your development environments when multiple versions of R are available. Chapter 16 explains how R installations are discovered and assigned to deployed content.

The following sections describe how to install R from source for your Linux distribution.

2.2.2 Red Hat / CentOS (6+)

2.2.2.1 Installing R

These instructions describe how to install R 3.4.3 onto a Red Hat / CentOS server. Install other R versions by changing 3.4.3 in each step.

Install the build dependencies for R.

# Install build dependencies
yum-builddep R

Download and unpack the source for the version of R that you want to install. This is a .tar.gz archive file.

# Download and extract source code
wget https://cran.r-project.org/src/base/R-3/R-3.4.3.tar.gz
tar -xzvf R-3.4.3.tar.gz
cd R-3.4.3

Configure, build, and install R into /opt/R/3.4.3.

Change the --prefix= argument to use a different location. Section 16.3.1 explains how RStudio Connect looks for R installations.

# Build R from source
./configure \
    --prefix=/opt/R/$(cat VERSION) \
    --enable-memory-profiling \
    --enable-R-shlib \
    --with-blas \
    --with-lapack

make
sudo make install

Do not move the R installation directory once it is installed. Libraries are statically linked; moving the folder will break the installation of R.

Test that R was successfully installed.

/opt/R/3.4.3/bin/R --version

2.2.2.2 Installation Commands

These instructions describe how to install RStudio Connect onto a Red Hat/CentOS server.

RStudio Connect has several dependencies on packages found in the Extra Packages for Enterprise Linux (EPEL) repository. If you don’t already have this repository available, add it to your system using the instructions found here: https://fedoraproject.org/wiki/EPEL. On some distributions of Red Hat Enterprise Linux/CentOS Linux, the R package references dependencies that are not available by default. In this case, you may need to edit the /etc/yum.repos.d/redhat.repo file to enable the rhel-6-server-optional-rpms (by setting enabled = 1) before you can install the R package.

You should have an .rpm file containing RStudio Connect and all of its dependencies (other than R). If you do not have an installer, download it into the current directory with wget.

wget https://rstudio-connect.s3.amazonaws.com/rstudio-connect-1.7.6-6.el.x86_64.rpm
sudo yum install rstudio-connect-1.7.6-6.el.x86_64.rpm

RStudio Connect is installed into /opt/rstudio-connect/ and creates an rstudio-connect user.

See Section 2.3.1 to start configuring your RStudio Connect server.

2.2.2.3 Package Validation

The RStudio Connect installer is signed with a key belonging to RStudio, Inc. If you wish to verify this signature, you can obtain the public key from our website; save it into a file (e.g. rstudio-code-signing.key). You can also obtain it from a GnuPG keyserver using the following command:

gpg --keyserver keys.gnupg.net --recv-keys 3F32EE77E331692F
gpg --armor --export 3F32EE77E331692F > rstudio-code-signing.key

Once you have obtained the key, you need to import it into the set of keys RPM uses to validate package signatures, after which you can validate the package signature using the rpm command:

rpm --import rstudio-code-signing.key
rpm -K rstudio-connect-1.7.6-6.el.x86_64.rpm

2.2.2.4 Package Dependencies

We recommend some additional Red Hat/CentOS system dependencies required by R packages. Without these dependencies, your users may not be able to deploy content into RStudio Connect.

2.2.3 SLES (12 SP3+)

2.2.3.1 Installing R

These instructions describe how to install R 3.4.3 onto a SUSE Linux Enterprise server. Install other R versions by changing 3.4.3 in each step.

Install the build dependencies for R.

zypper install \
    gcc \
    gcc-c++ \
    gcc-fortran \
    readline-devel \
    xorg-x11-devel \
    liblzma5 \
    xz-devel \
    pcre-devel \
    libcurl-devel \
    make

Download and unpack the source for the version of R that you want to install. This is a .tar.gz archive file.

# Download and extract source code
wget https://cran.r-project.org/src/base/R-3/R-3.4.3.tar.gz
tar -xzvf R-3.4.3.tar.gz
cd R-3.4.3

Configure, build, and install R into /opt/R/3.4.3.

Change the --prefix= argument to use a different location. Section 16.3.1 explains how RStudio Connect looks for R installations.

# Build R from source
./configure \
    --prefix=/opt/R/$(cat VERSION) \
    --enable-memory-profiling \
    --enable-R-shlib \
    --with-blas \
    --with-lapack

make
sudo make install

Do not move the R installation directory once it is installed. Libraries are statically linked; moving the folder will break the installation of R.

Test that R was successfully installed.

/opt/R/3.4.3/bin/R --version

2.2.3.2 Installation Commands

These instructions describe how to install RStudio Connect onto an SUSE Linux Enterprise server.

You should have an .rpm file containing RStudio Connect and all of its dependencies (other than R). If you do not have an installer, download it into the current directory with wget.

For SUSE 12:

wget https://rstudio-connect.s3.amazonaws.com/rstudio-connect-1.7.6-6.sles12.x86_64.rpm
sudo zypper install rstudio-connect-1.7.6-6.sles12.x86_64.rpm

For SUSE 15:

wget https://rstudio-connect.s3.amazonaws.com/rstudio-connect-1.7.6-6.sles15.x86_64.rpm
sudo zypper install rstudio-connect-1.7.6-6.sles15.x86_64.rpm

RStudio Connect is installed into /opt/rstudio-connect/ and creates an rstudio-connect user.

See Section 2.3.1 to start configuring your RStudio Connect server.

2.2.3.3 Package Validation

The RStudio Connect installer is signed with a key belonging to RStudio, Inc. If you wish to verify this signature, you can obtain the public key from our website; save it into a file (e.g. rstudio-code-signing.key). You can also obtain it from a GnuPG keyserver using the following command:

gpg --keyserver keys.gnupg.net --recv-keys 3F32EE77E331692F
gpg --armor --export 3F32EE77E331692F > rstudio-code-signing.key

Once you have obtained the key, you need to import it into the set of keys RPM uses to validate package signatures, after which you can validate the package signature using the rpm command:

rpm --import rstudio-code-signing.key
# Validate SLES 12 installer
rpm -K rstudio-connect-1.7.6-6.sles12.x86_64.rpm
# Validate SLES 15 installer
rpm -K rstudio-connect-1.7.6-6.sles15.x86_64.rpm

2.2.3.4 Package Dependencies

We recommend some additional SLES system dependencies required by R packages. Without these dependencies, your users may not be able to deploy content into RStudio Connect.

2.2.4 Ubuntu (14.04+)

2.2.4.1 Installing R

These instructions describe how to install R 3.4.3 onto an Ubuntu server. Install other R versions by changing 3.4.3 in each step.

Install the build dependencies for R.

apt-get build-dep r-base

You can use apt-rdepends to enumerate the build dependencies for R without installing them.

apt-rdepends --build-depends r-base

Download and unpack the source for the version of R that you want to install. This is a .tar.gz archive file.

# Download and extract source code
wget https://cran.r-project.org/src/base/R-3/R-3.4.3.tar.gz
tar -xzvf R-3.4.3.tar.gz
cd R-3.4.3

Configure, build, and install R into /opt/R/3.4.3.

Change the --prefix= argument to use a different location. Section 16.3.1 explains how RStudio Connect looks for R installations.

# Build R from source
./configure \
    --prefix=/opt/R/$(cat VERSION) \
    --enable-memory-profiling \
    --enable-R-shlib \
    --with-blas \
    --with-lapack

make
sudo make install

Do not move the R installation directory once it is installed. Libraries are statically linked; moving the folder will break the installation of R.

Test that R was successfully installed.

/opt/R/3.4.3/bin/R --version

2.2.4.2 Installation Commands

These instructions describe how to install RStudio Connect onto an Ubuntu server. You will use gdebi from the gdebi-core package to install Connect and its dependencies.

sudo apt-get install gdebi-core

You should have a .deb file containing RStudio Connect and all of its dependencies (other than R). If you do not have an installer, download it into the current directory with wget.

wget https://rstudio-connect.s3.amazonaws.com/rstudio-connect_1.7.6-6_amd64.deb
sudo gdebi rstudio-connect_1.7.6-6_amd64.deb

RStudio Connect is installed into /opt/rstudio-connect/ and creates an rstudio-connect user.

See Section 2.3.1 to start configuring your RStudio Connect server.

2.2.4.3 Package Validation

The RStudio Connect installer is signed with a key belonging to RStudio, Inc. If you wish to verify this signature, you can obtain the public key from our website. You can also obtain it from a GnuPG keyserver using the following command:

gpg --keyserver keys.gnupg.net --recv-keys 3F32EE77E331692F

Once you have obtained the key, you can validate the .deb file as follows:

dpkg-sig --verify rstudio-connect_1.7.6-6_amd64.deb

2.2.4.4 Package Dependencies

We recommend some additional Ubuntu system dependencies required by R packages. Without these dependencies, your users may not be able to deploy content into RStudio Connect.

2.2.4.4.2 Supplemental Packages

Here are additional system dependencies used by R packages. Their necessity depends on the type of content your users create and the R packages they use. You could provide these packages now or wait until they are requested.

libgmp10-dev
libgsl0-dev
libnetcdf6
libnetcdf-dev
netcdf-bin
libdigest-hmac-perl
libgmp-dev
libgmp3-dev
libgl1-mesa-dev
libglu1-mesa-dev
libglpk-dev
tdsodbc
freetds-bin
freetds-common
freetds-dev
odbc-postgresql
libtiff-dev
libsndfile1
libsndfile1-dev
libtiff-dev
tk8.5
tk8.5-dev
tcl8.5
tcl8.5-dev
libgsl0-dev
libv8-dev

2.3 Initial Configuration

RStudio Connect is installed, but requires additional configuration before it is ready for use. This section will help you specify the public URL of your server, configure authentication, and validate that RStudio Connect is able to send email.

2.3.1 Editing the Configuration File

RStudio Connect is controlled primarily by the /etc/rstudio-connect/rstudio-connect.gcfg configuration file. You will edit this file to make server-wide configuration changes to the system. Learn about its file format and available options in the Configuration Appendix.

Let’s start by configuring the Server.Address server property.

The Server.Address property is the public URL used to access the server. This setting lets email include links pointing back to your server.

Whenever RStudio Connect is deployed behind a proxy, you must configure Server.Address with the proxied location and not the local hostname of the Connect server.

Server.Address must contain hostname and port when your installation uses a non-standard port. You do not need to include port for an https:// URL on the standard HTTPS port 443 or an http:// URL on the standard HTTP port 80.

Here is a sample configuration with Server.Address:

; /etc/rstudio-connect/rstudio-connect.gcfg
[Server]
Address = https://rstudio-connect.company.com/

Here is a sample configuration with RStudio Connect using a non-standard port:

; /etc/rstudio-connect/rstudio-connect.gcfg
[Server]
Address = http://rstudio-connect.company.com:3939/

This example has RStudio Connect available underneath a specific URL path. You may have this situation when Connect is accessed through a proxy.

; /etc/rstudio-connect/rstudio-connect.gcfg
[Server]
SenderEmail = rstudio-connect@company.com
Address = https://proxy.company.com/connect/

Important Note

Please use a publicly available URL (like the one you set in Server.Address) when connecting rsconnect or the RStudio IDE to your RStudio Connect server. If a non- public address (e.g., localhost) is used for publishing content, rsconnect will not be able to automatically open the published content in the user’s browser.

Restart RStudio Connect after altering the rstudio-connect.gcfg configuration file.

sudo systemctl restart rstudio-connect

Your platform may use alternate commands to restart RStudio Connect. Please see Section 5.1 for instructions specific to your operating system version.

2.3.2 Authentication

It is important that you specify the correct style of authentication for your organization. RStudio Connect includes a built-in authentication mechanism and supports a number of external authentication integrations, which are detailed in Section 11.

It’s strongly recommended that the definitive form of authentication be established before using a permanent RStudio Connect installation. Migrating from one style of authentication to another can be done but it is a challenging process that will cause some temporary disruption.

The means to migrate between authentication providers are described in the section 11.1.

2.3.3 Sign In!

Use a web browser to visit the RStudio Connect dashboard. This has a default location of http://your-connect-server:3939/. Click the “Sign In” link. If you are using an external authentication provider, specify your login credentials. If you are using password authentication, follow the “Create a new account” link and configure your account.

The first account will be marked as an RStudio Connect administrator. Please use this account to configure mail sending. These settings are necessary in order for Connect to be able to distribute reports and notify users of errors running their content. Connect also sends confirmation messages when using the default password auth provider.

2.3.4 Email Sending

Note: The email features in RStudio Connect are disabled unless email sending is properly configured. In this state notifications that would be sent via email will only be visible in the logs. Also, the built-in authentication will not be able to rely on emails for account confirmation or password reset. These operations will instead require an administrator to act as an intermediary.

RStudio Connect supports two options for sending emails:

  • Sendmail - The sendmail command is used to send messages locally on your server. This relies on a working sendmail configuration or some equivalent replacement.
  • SMTP - Mail is sent using an SMTP endpoint and supports SSL and authentication.

The setting Server.EmailProvider determines which option will be used. For smtp, there are number of additional values to be configured, see Appendix A.4 about SMTP configuration for details.

Please contact your systems administrator if you have questions about which of these options are appropriate and add the proper values to your configuration file.

The Server.SenderEmail property is the email address from which Connect sends emails. Your email configuration must accept email with this Server.SenderEmail address as sender.

Here is a sample configuration that uses sendmail and an rstudio-connect sending account.

; /etc/rstudio-connect/rstudio-connect.gcfg
[Server]
SenderEmail = rstudio-connect@company.com
EmailProvider = sendmail

This configuration uses SMTP. See Appendix A.4 for all the SMTP configuration options.

; /etc/rstudio-connect/rstudio-connect.gcfg
[Server]
SenderEmail = rstudio-connect@company.com
EmailProvider = smtp

[SMTP]
Host = "smtp.company.com"
Port = 25
StartTLS = "always"

Restart RStudio Connect after adjusting your email configuration (see Section 5.1) then send yourself a test message.

Sign into the RStudio Connect dashboard as an administrator and visit the Admin>Mail Settings page. Use the “Send Test Email” button to send yourself a message. Once that message arrives, you know that RStudio Connect is ready to send email.

2.3.5 Install TensorFlow Dependencies (Optional)

Note: libtensorflow.so is required for TensorFlow Model API deployment support, and an up-to-date libtensorflow.so is required to run TensorFlow Model APIs at the latest version. If users are experiencing difficulty deploying TensorFlow Models to RStudio Connect, try updating libtensorflow.so to the latest version following the instructions below.

To install the TensorFlow dependencies, first verify that your license supports TensorFlow Model API deployment. If you do not have a Standard or Enterprise license, please contact RStudio Sales for information on upgrading your license.

Second, verify that your platform is supported by TensorFlow. TensorFlow requires libraries that are unavailable on CentOS 6, Red Hat Enterprise Linux 6, and SUSE Linux Enterprise Server 12. Accordingly, RStudio Connect does not provide support for running TensorFlow Model APIs on these platforms.

Next, determine what version of TensorFlow your users will be deploying their models with. RStudio Connect supports TensorFlow versions 1.13.1 and earlier. Later releases and development TensorFlow builds are not supported.

Finally, there are two options for installing the required libraries:

  • You could obtain a libtensorflow binary package. This binary package would not be optimized for your platform, but would provide a working runtime for TensorFlow Model APIs on connect. See 2.3.5.1
  • You could compile libtensorflow from source. This would allow you to make various compile-time optimizations for your hardware. See 2.3.5.2

2.3.5.1 TensorFlow Binary Packages

The guide Installing TensorFlow For C should contain a section reading “Download and extract the TensorFlow C library”. Follow the instructions up to that point, download and extract the binary, and then:

  • On Ubuntu, the libraries may need to be installed to /usr/lib rather than /usr/local/lib as specified in the instructions.
  • On CentOS7/RHEL7, the libraries need to be installed to /usr/lib64 rather than /usr/local/lib as specified in the instructions.
  • On ALL PLATFORMS: Ensure that both libtensorflow.so and libtensorflow_framework.so are in your shared library search path.

2.3.5.2 Compiling TensorFlow Libraries From Source

NOTE: These instructions have been tested as of TensorFlow 1.13.1, please refer to the TensorFlow Project for up-to-date information on building TensorFlow Libraries.

NOTE: Compiling TensorFlow from source may be difficult and is highly dependent on your host environment. If you encounter issues compiling libtensorflow.so from source, you should raise an issue at the TensorFlow project’s Github Issues Page

  1. Install Bazel per the Bazel Installation Instructions
  2. Download the TensorFlow Source either using git clone or by downloading a source tarball.
  3. Check out version 1.13.1 with git.

    git checkout v1.13.1
  4. Python, Swig, and NumPy may be required on the build platform. - On Ubuntu, they can be installed with sudo apt-get install python swig python-numpy - On CentOS, they can be installed with sudo yum install python swig numpy
  5. Enter the source directory and run ./configure. Answer the questions about your hardware to the best of your knowledge. Application logs will contain a warning if the platform’s tensorflow libraries lack usable optimizations.
  6. Execute bazel build --config opt //tensorflow:libtensorflow.so. This will compile tensorflow for your platform
  7. Copy libtensorflow.so and libtensorflow_framework.so from bazel-bin/tensorflow into your platform’s shared library path