Skip to main content

Setting up an RStudio Server

I'm taking a break from React Native (our group decided not to use it for the Tic Tac Toe project) and wanted to put some thoughts in here about setting up my RStudio server for my SOTU-db project.

I won't get into the details of why I want the RStudio server here - that will be covered on the SOTU-db dev blog. Here, I just want to record some quick thoughts and problems that arose as I set up the server. 

Gaining access to the server

The server itself is a VM provided by Loyola University Chicago's Computer Science Department - thanks to George Thiruvathukal and Miao Ye for setting me up with this and providing support. 

I initially ran into issues because I couldn't figure out how to connect to the server. I knew I had been assigned a static IP and a DNS entry in Loyola's nameservers at, and assumed I would use SSH to connect to the server (which I further assumed was running Ubuntu in accordance with CS departmental policy and my previous experience). But every time I tried to connect with SSH, I was refused. I could ping the server, but any other kind of connection was refused. I tried just navigating there through the browser (maybe they had set up a Guacamole instance?), even using RDP and VNC servers to try to connect with no luck. I did this from home, both over my regular internet connection AND while connected to Loyola's SecureAccess VPN, with no luck.

I waited to ask for help until I tried connecting from Loyola's campus - and was finally successful over SSH! This is something I need to follow up on - if I can't access the server remotely, even when connected to LUC's VPN, that seems like a problem to me.
**update: I sent a support request to the CS department and was given credentials that should allow me to remotely access the server. I'll test this when I get off campus later today!

Setting up RStudio

RStudio has some decent install documentation, and I'd done this before, so I didn't expect any real hiccups. But hiccups are what I got! 

Like so much Linux documentation I read, the Rstudio install instructions have this annoying habit of giving you very basic step-by-step instructions, then later on the page mentioning some prerequisites that you actually should have set up before completing the above steps. To me, adding the key that the files are signed with BEFORE instructing users to download and install the files would make more sense. To install R, I needed to add some repos to my sources.list file. 

I need to take a quick moment here to talk about how dumb the text editors in Ubuntu are. I used nano to open sources.list and add the repositories as instructed by the RStudio installation instructions. I thought it was a little weird that there were only 3 lines in sources.list... But hey, this was Ubuntu 18.04, which was new to me. Maybe they had found a way to shorten down sources.list into just a couple lines! I pasted in the lines I needed, then pressed (non-Linux users, I swear I am not making this up) CTRL-O to "write out" (Linux code for "save") then CTRL-X to exit nano. It is completely beyond me why CTRL-S cannot be used for save. Linux lovers, if any of you are seriously wondering why open source software isn't more popular, this is your answer. I guess this is slightly better than VIM where, if I remember correctly, saving and exiting and getting out of insert mode involved a ritual chant ceremony of some sort.

Annoyed by this, I tried downloading Atom which has gradually become my text editor of choice. But instead of installing (either right from apt install atom or downloading the .deb file) Ubuntu kept scolding me about how I held broken packages and had dependencies that couldn't be met. After banging my head against the wall for a while I realized that my sources.list file was missing a load of repositories. Ubuntu couldn't fix the broken dependencies because it couldn't check the right repos. I don't know why, or if this is standard practice for setting up a VM, or if Loyola's CS department did this intentionally for some reason. In any case, I pasted the "default" sources.list file provided by jackw1111 (a name you can trust) on Github into my sources.list, and things immediately started going much more smoothly after an apt update && apt upgrade.

Ultimately upon getting it installed I wasn't able to open it because it wouldn't display (the world of CLI without any GUI is still kind of hard for me to grasp sometimes... on my Chromebook running Linux I can call Atom from the CLI no problem, but I guess not on an actual Ubuntu server without a display installed. I am curious if I can "install" a display somehow. Using nano is no big deal, but it sure would be nice to be able to use Atom for everything. It seems very possible I'll be doing a lot of editing in Atom and copy-pasting into nano.


After fixing my sources.list file and my broken dependencies, the remainder of the installation went smoothly. I'm pleased to report that visiting at this very moment will bring visitors to the login page for my RStudio server. This was a really basic installation, but it's still very satisfying to have it up and running. For my upcoming workshop at the CTSDH, this might be the demo I choose to give - I think people will "get it" and I know from experience that RStudio will happily run from a laptop (slowly but happily), so people should be able to demo it live on their own devices.


Popular posts from this blog

New Position with Chicago Metro History Fair

I'm excited to have begun a new position at the Chicago History Museum a couple of weeks ago now. I am a "History Fair Program Specialist," meaning I help run the Chicago Metro History Fair.

The Chicago Metro History Fair (CMHF) is an annual, regional competition where middle and high school students in and around Chicago research a historical topic of their choice and create projects (exhibit boards, websites, documentaries...) that show off their hard work. Volunteer judges from around the community help provide feedback on the students' work, and winning entries can advance to state and national level competitions (administered by Illinois History Day and National History Day, respectively).

So far, my work has primarily been in preparing for weekend "Palooza" events, where volunteer coaches (often history teachers, faculty, graduate students, etc) and librarians assist students with their History Fair projects. The regional competition will take place i…

Setting up a Tomcat server

This post covers the process of setting up Apache Tomcat 9 as a server for static .html pages.
Environment & Background I have access to a VM running Ubuntu 18.04 on which I've already set up an instance of RStudio server. I have SSH access but not a graphical interface, so it's been a good opportunity to work on my Linux skills. My goal here was just to serve static HTML pages to site visitors for now. It's really satisfying to have full control over the HTML and CSS, instead of being in an environment like Wordpress (or Blogger!) where it's never quite clear what markup it will accept and what it will totally ignore. I've been mocking up a frontend for SOTU-db using W3-CSS, which feels like kind of a cross between traditional HTML/CSS/JS and React Native. 
I had played around with Ubuntu servers before, so I was familiar with Nginx and Tomcat. As I've said many times, my favorite part about Ubuntu is the documentation that is completely incomprehensible, …