Deploy RStudio Server with SSL Support

Deploy RStudio Server with SSL Support

(Source Image: RStudio Server logo

RStudio Server is integrated development environment for R language. It includes everything from terminal, syntax-highlighting editor or I should say everything that R has but its running in the web. In this article I’ll show you how to deploy RStudio Server with SSL support on GNU/Linux Lubuntu 16.04.

1. RStudio Server

You must have r-base package before installing RStudio Server. Use this command to install r-base and RStudio Server Open Source License.

sudo apt install r-base
sudo apt-get install gdebi-core
sudo gdebi rstudio-server-1.0.143-amd64.deb

This should install RStudio Server and default installation running on port 8787. After installation you can browse your browser in this address http://localhost:8787 or in different environment localhost will be your local private IPv4 (http://your-ip-address:8787).

2. Nginx and Let’s Encrypt

RStudio Server Open Source License default installation doesn’t have any SSL support. We can use Nginx web server as proxy and use let’s encrypt for SSL support to make our deployment more secure.

sudo apt install nginx
sudo add-apt-repository ppa:certbot/certbot
sudo apt update
sudo apt install certbot

3. Nginx Configuration

Nginx configuration on GNU/Linux Lubuntu 16.04 at /etc/nginx. Put our configuration in /etc/nginx/sites-available. Remember to configure your DNS properly so it can answer your subdomain / domain. I’m not cover this article with DNS configuration.

sudo touch /etc/nginx/sites-available/

Fill the rstudio file using configuration

server {
listen 443 ssl;
listen [::]:443 ssl;

root /var/www/html/;


location ~ /.well-known {
allow all;

location / {
try_files $uri @proxy;

location @proxy {
proxy_read_timeout 90;

Don’t forget to link file into sites-enabled in /etc/nginx.

cd /etc/nginx/sites-enabled
sudo ln -s /etc/nginx/sites-available/

Activate let’s encrypt ssl support.

sudo certbot certonly –webroot –webroot-path=/var/www/html/ -d

4. RStudio Server Configuration

Stop the RStudio Server

sudo rstudio-server stop

and configure the ip address so it listen only in Configuration file in /etc/rstudio/rserver.conf


Now start RStudio Server again

sudo rstudio-server start

Now test your RStudio Server and voila.

Leave a Reply

Your email address will not be published. Required fields are marked *