This repository provides a Terraform-based template for deploying an RStudio Server workspace inside Docker using Coder.
- RStudio Server in Docker
- Coder workspace integration
- Persistent home directory
- Optional renv support
- UI-configurable parameters
- Open Coder UI
- Go to Templates
- Click Create Template
- Select From Git Repository
- Enter this repository URL
- Create the template
- Select the template
- Configure parameters
- Launch workspace
- Open RStudio from the UI
rstudio_password– Password for RStudioenable_renv– Enable renv restoredocker_socket– Optional Docker socket
- RStudio runs internally on port 8787
- Access is handled via Coder proxy
- No direct port exposure required
coder-rstudio
├── coder_parameters.tf
├── main.tf
├── modules
│ └── rstudio
│ ├── main.tf
│ ├── run.sh
│ └── variables.tf
├── README.md
└── variables.tf- coder_parameters.tf → UI inputs for the Coder template
- main.tf → Entry point/orchestration (Coder agent + modules)
- modules/rstudio/ → isolated RStudio setup
- main.tf → resources (script and app)
- variables.tf → module variables
- run.sh → startup script for the RStudio container
- .gitignore → prevents Terraform state from being committed to the repo
- README.md → documentation
- variables.tf → Terraform variables (backend/defaults)