For some research work I had to set up R (>3.6), RStudio Server (free version), and Python running on Ubuntu EC2 machines. I found some blogs, but was not satisfied with the procedure. I also found a few available community images for RStudio Server, but they were unmaintained and insecure.
After some trial and error and some help I figured it out. If you are using sensitive data and trying to set up the free version of RStudio-Server you might find this useful.