rlinuxubuntugoogle-compute-enginerstudio-server

Rstudio server not running on Google Cloud Compute Engine


Why does "rstudio-server start" not work??

At this point, I could not find any helpful answer even on stackoverflow. I cross-checked that the below steps 1-5 are sufficient for installing Rstudio Server on Ubuntu from the following blog-posts: https://www.r-bloggers.com/installing-rstudio-server-on-ubuntu-server/ http://www.joeroe.eu/blog/2015/08/rstudio-server-on-a-google-compute-engine-instance/ https://gist.github.com/rweald/4321052

Here's what I did:

1. Create Google Cloud VM

Google Cloud Compute Engine > Create VM Instance (on Ubuntu 16.04 LTS)

2. Installing R

sudo nano /etc/sources.list

enter:

deb http://cran.rstudio.com/bin/linux/ubuntu xenial/

get public key for ubuntu:

sudo apt-key adv —keyserver keys.gnupg.net —recv-key 381BA480
sudo apt-get update
sudo apt-get install r-base libapparmor1
sudo apt-get install r-base

3. Installing Rstudio Server

sudo apt-get install gdebi-core
wget https://download2.rstudio.org/rstudio-server-1.0.143-amd64.deb
sudo gdebi rstudio-server-1.0.143-amd64.deb

4. Open port 8787 in Google Cloud firewall

gcloud compute firewall-rules create allow-rstudio --allow tcp:8787

Remark: I did verify that the port 8787 is open: gcloud compute firewall-rules list NAME NETWORK SRC_RANGES RULES  SRC_TAGS TARGET_TAGS allow-rstudio  default 0.0.0.0/0  tcp:8787 allow-rstudio

5. Verify Rstudio Server

No response: http://:8787 >> browser is hanging

No response: sudo rstudio-server verify-installation >> command executes, no message

No response: sudo rstudio-server restart >> no running process to restart ("rsession: no process found")

No response: sudo rstudio-server start >> command executes, no message

Thanks for any thoughtful help why RStudio Server is not running.


Solution

  • You created a firewall rule, but you didn't apply it to any VM, so the port is still not open on that VM, and thus, you cannot reach your server.

    When you create a firewall rule, add a tag to it as per the docs:

    gcloud compute firewall-rules create allow-rstudio-server \
        --allow tcp:8787 \
        --target-tags rstudio-server
    

    Then, add the rstudio-server tag to the VM(s):

    gcloud compute instances add-tags [INSTANCE_NAME] --tags rstudio-server
    

    Then try accessing the UI on your server again.


    That said, you should really consider using an encrypted SSH tunnel to connect to your GCE VM securely instead, to avoid eavesdropping on your data while it is in transit from your computer to your GCE VM and back, or risk MITM attack which can intercept your password and take over your server, since you're using plain-text HTTP to access your server.