Rstudio Server on AWS EC2


Hope you're fine. I am actually having a hard time using Rstudio server. I have it installed on an ubuntu server on AWS EC2 through SSH (putty). I got R 3.4.4 installed before that. I have set up all the necessary ports number (I think) 8787, 22, 443, 80.
I typed ubuntu as username and my root password to enter Rstudio. I entered. I tried to install some packages (like the tidyverse one), the process started and got suddenly interrupted at some point.
I closed the window and tried to type the IP again to restart Rstudio. It restarted and let me know that the previous R session was abnormally terminated due to an unexpected crash. I tried to install packages again, it crashed again. I closed, typed the IP again to restart it. This time, it kept loading, and nothing is displayed. I tried to reboot the ubuntu server. Nothing changed.
I can't find out where the problem resides exactly.
I thought I would always just have to type the IP (:8787) and smoothly access Rstudio without much hassle.
Thanks in advance to anybody willing to help.

It sounds like you did manage to get into your RStudio Server instance without an issue twice. The errors you had with installing the packages are most likely responsible for crashes.
Can you SSH into your machine now that you've restarted it? Can you check if rstudio-server service is running? There are some pointers at this page that you can try using to see if it helps -
Finally, 3.4.4 version is quite outdated. Current version is 3.6.1, so it might be a good idea to update and try again.

1 Like

I concur with the suggestion of upgrading the R installation.

Since we are on 3.6 now the oldrel is 3.5 and 3.4 is old-oldrel. On Linux environment (where everything is built from source) this is not such an issue as on Windows (where compiled binaries are maintained for current, future and old release, but not old-old release). But if you are starting afresh it is a good practice to start with current release.

1 Like

Thank you guys. I think it works now. I have "stopped" the server and started it again, and I've got into Rstudio, I think it was with a different IP. I've installed the packages, let it run for a while and everything was good.
About the R version, although I've added the repositories proposed on the CRAN's website, I still couldn't get the 3.6 version. Ubuntu told me there were unmet dependencies when trying to install a newer version. I think the 3.6 version is available on the newest version of ubuntu, 19.04.


I am glad you sorted out the issue!

As for the R 3.6 vs ubuntu 19.04 thing - having a current version of R in an AWS EC2 environment is not only possible, but highly recommended.

It will require some tweaking of your /etc/apt/sources.list file, possibly via sudo nano /etc/apt/sources.list command (I prefer nano to vim, as I know how to exit nano in a hurry, but that is a personal choice - both are available on AWS Linux).

You will need to add the appropriate line for your installation (I believe fresh EC2 instances start with bionic, but I am not 100% certain and don't have time to check) and then run sudo apt-get update && sudo apt-get install r-base. It is not absolutely required, but highly recommended, to install r-base-dev also.

Installing via the package manager has the nice side benefit that you get minor version upgrades automatically.

You will find the process described in a copy-paste friendly way on CRAN pages; you will find some troubleshooting tips there as well:

Thank you. This is exactly what I did, except that I didn't include r-dev. I don't remember exactly which of them was chosen, between bionic and disco. And ubuntu told me there were unmet dependencies. I will try again.

If it still can't be fixed up, I will let it as it is, since I am also running Rtudio on my personal computer with R 3.6.1 installed.

Thanks again.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.