# Web IDEs By default, Coder workspaces allow connections via: - Web terminal - SSH (plus any [SSH-compatible IDE](../ides.md)) It's common to also let developers to connect via web IDEs for uses cases like zero trust networks, data science, contractors, and infrequent code contributors. ![Row of IDEs](../images/ide-row.png) In Coder, web IDEs are defined as [coder_app](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/app) resources in the template. With our generic model, any web application can be used as a Coder application. For example: ```hcl # Add button to open Portainer in the workspace dashboard # Note: Portainer must be already running in the workspace resource "coder_app" "portainer" { agent_id = coder_agent.main.id slug = "portainer" display_name = "Portainer" icon = "https://simpleicons.org/icons/portainer.svg" url = "https://localhost:9443/api/status" healthcheck { url = "https://localhost:9443/api/status" interval = 6 threshold = 10 } } ``` ## External URLs Any URL external to the Coder deployment is accessible as a `coder_app`. e.g., Dropbox, Slack, Discord, GitHub ```hcl resource "coder_app" "pubslack" { agent_id = coder_agent.coder.id display_name = "Coder Public Slack" slug = "pubslack" url = "https://coder-com.slack.com/" icon = "/icon/slack.svg" external = true } resource "coder_app" "discord" { agent_id = coder_agent.coder.id display_name = "Coder Discord" slug = "discord" url = "https://discord.com/invite/coder" icon = "/icon/discord.svg" external = true } ``` ![External URLs](../images/external-apps.png) ## code-server [code-server](https://github.com/coder/coder) is our supported method of running VS Code in the web browser. A simple way to install code-server in Linux/macOS workspaces is via the Coder agent in your template: ```console # edit your template cd your-template/ vim main.tf ``` ```hcl resource "coder_agent" "main" { arch = "amd64" os = "linux" startup_script = </tmp/vscode-web.log 2>&1 & EOF } ``` > `code serve-web` was introduced in version 1.82.0 (August 2023). You also need to add a `coder_app` resource for this. ```hcl # VS Code Web resource "coder_app" "vscode-web" { agent_id = coder_agent.coder.id slug = "vscode-web" display_name = "VS Code Web" icon = "/icon/code.svg" url = "http://localhost:13338?folder=/home/coder" subdomain = true # VS Code Web does currently does not work with a subpath https://github.com/microsoft/vscode/issues/192947 share = "owner" } ``` ## JupyterLab Configure your agent and `coder_app` like so to use Jupyter. Notice the `subdomain=true` configuration: ```hcl data "coder_workspace" "me" {} resource "coder_agent" "coder" { os = "linux" arch = "amd64" dir = "/home/coder" startup_script = <<-EOF pip3 install jupyterlab $HOME/.local/bin/jupyter lab --ServerApp.token='' --ip='*' EOF } resource "coder_app" "jupyter" { agent_id = coder_agent.coder.id slug = "jupyter" display_name = "JupyterLab" url = "http://localhost:8888" icon = "/icon/jupyter.svg" share = "owner" subdomain = true healthcheck { url = "http://localhost:8888/healthz" interval = 5 threshold = 10 } } ``` If you cannot enable a [wildcard subdomain](https://coder.com/docs/v2/latest/admin/configure#wildcard-access-url), you can configure the template to run Jupyter on a path. There is however [security risk](https://coder.com/docs/v2/latest/cli/server#--dangerous-allow-path-app-sharing) running an app on a path and the template code is more complicated with coder value substitution to recreate the path structure. [This](https://github.com/sharkymark/v2-templates/tree/main/pod-with-jupyter-path) is a community template example. ![JupyterLab in Coder](../images/jupyter.png) ## RStudio Configure your agent and `coder_app` like so to use RStudio. Notice the `subdomain=true` configuration: ```hcl resource "coder_agent" "coder" { os = "linux" arch = "amd64" dir = "/home/coder" startup_script = </tmp/filebrowser.log 2>&1 & EOT } resource "coder_app" "filebrowser" { agent_id = coder_agent.coder.id display_name = "file browser" slug = "filebrowser" url = "http://localhost:13339" icon = "https://raw.githubusercontent.com/matifali/logos/main/database.svg" subdomain = true share = "owner" healthcheck { url = "http://localhost:13339/healthz" interval = 3 threshold = 10 } } ``` ![File Browser](../images/file-browser.png) ## SSH Fallback If you prefer to run web IDEs in localhost, you can port forward using [SSH](../ides.md#ssh) or the Coder CLI `port-forward` sub-command. Some web IDEs may not support URL base path adjustment so port forwarding is the only approach.