3 License Management

3.1 Capabilities

An RStudio Connect product key limits usage in the following ways:

  • Number of user accounts that have signed into RStudio Connect. Once this limit is reached, additional users will not be permitted to sign into RStudio Connect. This limit is enforced the first time each user logs in. Locked users are not counted against this quota. Additionally, users that have not recently been active on the server are not counted against this quota. Users are deemed “inactive” after 365 days without visiting RStudio Connect, though this value may vary for certain licenses.
  • Number of users that can access Shiny applications at one moment in time. If this number is exceeded, new anonymous users will be unable to view the Shiny application requested. This limitation does not affect logged in users.
  • Whether or not API hosting is supported.

The settings of each metric depends on the license purchased from RStudio.

3.2 Notification of Expiration

RStudio Connect will attempt to send email to administrators when the license key is sixty days from expiration. You can disable this behavior with the Licensing.ExpirationEmail setting.

3.3 Product Activation

3.3.1 Activation Basics

When RStudio Connect is first installed on a system it operates in evaluation mode for a period of time and then subsequently requires activation for continued use.

To determine the current license status of your system you can use the following command:

$ sudo /opt/rstudio-connect/bin/license-manager status

After purchasing a license to RStudio Connect you’ll receive a license key that can be used to activate the license on a given system.

You can activate your license key with the command:

$ sudo /opt/rstudio-connect/bin/license-manager activate <product-key>
$ sudo systemctl restart rstudio-connect

Note that you need to restart RStudio Connect after activation for licensing changes to take effect.

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

If you want to move your license of RStudio Connect to another system you should first deactivate it on the old system with the command:

$ sudo /opt/rstudio-connect/bin/license-manager deactivate

3.4 Connectivity Requirements

In order to activate or deactivate RStudio Connect, internet connectivity is required for communication with the licensing server. If your server is behind an internet proxy or not connected to the Internet at all this section describes what’s required to successfully activate.

Additionally, your server should have a synchronized system clock, using ntp or some other clock syncing service. If the server’s clock is sufficiently incorrect, licensing verification will fail.

3.4.1 Proxy Servers

If your server is behind an internet proxy, you may need to add an additional command line flag indicating the address and credentials required to communicate through the proxy. This may not be necessary if either the http_proxy or all_proxy environment variable is defined (these are read and used by the license manager when available).

If you do need to specify a proxy server explicitly you can do so using the --proxy command line parameter. For example:

$ sudo /opt/rstudio-connect/bin/license-manager \
    --proxy=http://127.0.0.1/ activate <product-key>

Proxy settings can include a host-name, port, and username/password if necessary. The following are all valid proxy configurations:

http://127.0.0.1/
http://127.0.0.1:8080/
http://user:pass@127.0.0.1:8080/

If the port is not specified, the license manager will default to using port 1080.

3.4.2 Offline Activation

If your system has no connection to the Internet it’s also possible to perform an offline activation. To do this, we recommend using our offline activation application which will walk you through the process: RStudio Offline Activation

To activate your license offline, you first generate an offline activation request as follows:

$ sudo /opt/rstudio-connect/bin/license-manager \
    activate-offline-request <product-key>

Executing this command will print an offline activation request to the terminal which you should copy and paste and enter into our offline activation application or send to RStudio customer support (support@rstudio.com). You will receive a reply with a file attachment that can be used to activate offline as follows:

$ sudo /opt/rstudio-connect/bin/license-manager \
    activate-offline <activation-file>
$ sudo systemctl restart rstudio-connect

Note that you need to restart RStudio Connect after activation for licensing changes to take effect.

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

If you are renewing your license or want to move your license of RStudio Connect to another system you can also perform license deactivation offline. You can do this as follows:

$ sudo /opt/rstudio-connect/bin/license-manager deactivate-offline

Executing this command will print an offline deactivation request to the terminal which you should copy and paste and enter into the offline activation application then send to RStudio customer support (support@rstudio.com).

You can also perform an offline check of your current license status using the following command:

$ sudo /opt/rstudio-connect/bin/license-manager status-offline

3.5 Evaluations

3.5.1 Extending Evaluations

If you are unable to evaluate RStudio Connect during the initial evaluation period, you can obtain a key for extending the evaluation period from RStudio customer support (support@rstudio.com). Once you have the key, supply it to the RStudio Connect license manager using the extend-evaluation command.

$ sudo /opt/rstudio-connect/bin/license-manager extend-evaluation <key>

If you are performing the evaluation on a physical machine (not on virtualized hardware or containers) without a network connection, you may also request an offline evaluation extension key, which does not require an internet connection. This key may be supplied to the license manager as follows:

$ sudo /opt/rstudio-connect/bin/license-manager extend-evaluation-offline <key>

Note that offline evaluation extension keys are valid only on machines which do not have Internet access and are not virtualized. For most offline evaluation extensions, you will need to generate an offline evaluation request (see below for details).

3.5.2 Connectivity Requirements

3.5.2.1 Beginning Evaluations

Generally speaking, there are no network requirements during the evaluation period. Inside virtual machines or sandboxes (such as Docker), however, Internet access is required to begin the evaluation period.

If you have a proxy, you can supply it using the --proxy argument as described above. If however you have no means of connecting to the Internet from inside the virtual environment, you can begin the evaluation as follows:

$ sudo /opt/rstudio-connect/bin/license-manager begin-evaluation-request

Executing this command will print an offline activation request to the terminal which you should copy and paste and then send to RStudio customer support (support@rstudio.com). You will receive a reply with a file attachment that can be used to begin the evaluation offline as follows:

$ sudo /opt/rstudio-connect/bin/license-manager \
    begin-evaluation-offline <evaluation-file>
$ sudo systemctl restart rstudio-connect

Note that you need to restart RStudio Connect after starting your offline evaluation for licensing changes to take effect.

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

3.5.2.2 Extending Evaluations

You may extend evaluations offline using the same pattern described above (just use extend-evaluation-request and extend-evaluation-offline):

$ sudo /opt/rstudio-connect/bin/license-manager extend-evaluation-request

Then, when you’ve received the evaluation file:

$ sudo /opt/rstudio-connect/bin/license-manager 
    extend-evaluation-offline <evaluation-file>
$ sudo systemctl restart rstudio-connect

Note that you need to restart RStudio Connect after extending your evaluation for licensing changes to take effect.

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

3.6 Licensing Errors

RStudio Connect uses the license-manager to determine if a valid license is available. Should an error occur when interacting with the license manager, Connect indicates that problem in the /var/log/rstudio-connect.log log. The license manager sends details about the error to the system messages (syslog). You should consult both locations if Connect cannot obtain a license.

3.7 Floating Licensing

If you stop and start RStudio Connect instances frequently, for instance because you’re running them inside virtual machines or containers, you may wish to use floating licensing instead of traditional licensing.

To use floating licensing, you run a small, lightweight server, which holds a license that grants you the right to run a certain number of concurrent RStudio Connect instances.

When RStudio Connect starts, it will connect to the license server and obtain a temporary lease, releasing it when RStudio Connect is stopped. Using this method, you can have any number of RStudio Connect instances, so long as you do not run more instances at once than specified in your license.

3.7.1 The RStudio Connect License Server

The RStudio License Server site contains license server downloads for all RStudio products. Download and install the license server for RStudio Connect. You then activate your license key with the command:

$ sudo dpkg -i connect-license-server-1.0.3-x86_64.deb
$ sudo connect-license-server activate <product-key>
$ sudo connect-license-server start

A license key which distributes floating license leases is not the same as a traditional license key, and the two cannot be used interchangeably. If you have purchased traditional license keys and wish to exchange them for a floating license key, or vice versa, please get in touch with RStudio customer support (support@rstudio.com).

The file /etc/connect-license-server.conf contains configuration settings for the RStudio Connect License server, including the network port to listen on and any proxy settings required for connecting to the Internet.

3.7.2 License Server Offline Activation

The connect-license-server activate command requires an internet connection. If your license server has no connection to the Internet it’s also possible to perform an offline activation. The process for doing this on the license server is identical to the process used to activate RStudio Connect offline. Generate an offline activation request as follows:

$ sudo connect-license-server activate-offline-request <product-key>

Executing this command will print an offline activation request to the terminal which you should copy and paste and then send to RStudio customer support (support@rstudio.com). You will receive a reply with a file attachment that can be used to activate offline as follows:

$ sudo connect-license-server activate-offline <activation-file>
$ sudo connect-license-server restart

3.7.3 Using Floating Licensing

Once your license server is up and running, you need to tell RStudio Connect to use floating licensing instead of traditional licensing.

/etc/rstudio-connect/rstudio-connect.gcfg

[Licensing]
LicenseType = remote

The value remote indicates that RStudio Connect should connect to a remote licensing server to obtain a license; the value local can be used to explicitly specify traditional (local) activation.

Then, tell RStudio Connect which licensing server to connect to:

$ sudo /opt/rstudio-connect/bin/license-manager license-server <server-hostname-or-ip>
$ sudo systemctl restart rstudio-connect

Note that you need to restart RStudio Connect after configuring a remote license server for licensing changes to take effect.

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

You only need to run the license-server command once; RStudio Connect saves the server name and will use it on each subsequent startup.

By default, the RStudio Connect License Server listens on port 8999. If you wish to use a different port, you will need to specify the port in /etc/connect-license-server.conf, and specify license-server to the license manager as <server-hostname-or-ip:port>.

Depending on your system configuration, it is possible that the RStudio Connect service will be started before the service which allows hostname resolution (this is known to be the case for example on some Amazon EC2 systems). If this is the case, you’ll want to specify the license server using a private IP address rather than a hostname, so that RStudio Connect can acquire a license immediately when starting up.

3.7.4 Configuring License Leases

When using floating licenses, you can optionally determine how long the license leases last by setting the lease length value on the licensing server. This value is in seconds, so for instance to make license leases last 30 minutes you would use the following syntax:

/etc/connect-license-server.conf

<lease length="1800"/>

The lease length controls how frequently the RStudio Connect instances need to contact the licensing server to renew their license leases in order for the lease to remain valid.

A shorter lease length will increase tolerance to failures on RStudio Connect instances by making leases available for reuse more quickly. RStudio Connect will release its lease immediately if shut down normally, but if abnormally terminated, the lease will not be released until it expires.

A longer lease length will increase tolerance to transient failures on the network and the RStudio Connect License Server. Any such issues that can be resolved before the lease is due for renewal won’t interrupt use of RStudio Connect.

We generally recommend using a longer lease length. Use a short lease length only if your environment routinely encounters abnormal terminations of the server or the container/instance on which it runs.

3.7.5 Lease Expiration and Renewal

Under normal conditions RStudio Connect will automatically renew its license lease in a configurable interval as described above. However, there are situations in which it will be unable to do so, such as a network problem, or an issue on the host running the license server.

When RStudio Connect cannot obtain a license lease, either because there are no leases currently available or because it can’t reach the licensing server, it will begin automatically attempting to acquire a lease every 10 seconds. This interval is configurable; for instance, to retry every 30 seconds instead you would set the following value:

/etc/rstudio-connect/rstudio-connect.gcfg

[Licensing]
RemoteRetryFrequency = 30s

If you don’t want RStudio Connect to attempt to reestablish a license lease automatically, set the value to 0 to disable retries. In this case you will need to manually restart RStudio Connect in order to reestablish the lease. This can be useful if you often run more instances than you have keys for, and wish to have more control over which RStudio Connect instances receive license leases from the limited pool on the license server.

3.7.6 Troubleshooting Floating Licensing

To validate that the license server has been successfully activated, run the activation-status command. This will report the version of the server as well as the license key and the number of available slots.

$ sudo connect-license-server activation-status

If your server is activated but you’re still having trouble with floating licensing, you can tell the RStudio Connect License Server to emit more detailed logs. Change the log level to notification:

/etc/connect-license-server.conf

<log file="/var/log/rstudio-licensing.log" level="notification"/>

Then, restart the license server, tail the licensing log, and start your RStudio Connect instances.

$ sudo connect-license-server restart
$ tail -f /var/log/rstudio-licensing.log

At the notification level, the licensing log will tell you the total number of licenses associated with your key, and how many are currently in use. It will also notify you when RStudio Connect instances acquire leases, and when those leases are released, renewed, or expired. No rotation is done for this log, so it’s recommended to use the warning level in production.