|
| 1 | +--- |
| 2 | +title: "Applications" |
| 3 | +description: Learn how to access web apps running in your workspace. |
| 4 | +state: beta |
| 5 | +--- |
| 6 | + |
| 7 | +You can connect to web applications installed on your workspace using the |
| 8 | +applications specification file located at `/coder/apps/config.yaml` of the |
| 9 | +workspace filesystem. |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | +## Enabling custom apps |
| 14 | + |
| 15 | +If you'd like to use custom apps in Coder, you can enable this feature in the |
| 16 | +UI: |
| 17 | + |
| 18 | +1. In the top-right, click on your avatar and select **Feature Preview** |
| 19 | +1. Click **Generic applications** and select **Enable**. |
| 20 | + |
| 21 | +## Application specification file |
| 22 | + |
| 23 | +The application specification file allows you to define what Coder needs to |
| 24 | +launch the application. Within the file, you can specify the following for each |
| 25 | +application: |
| 26 | + |
| 27 | +```yaml |
| 28 | +# /coder/apps/config.yaml |
| 29 | + |
| 30 | +apps: |
| 31 | + # Name of application in launcher |
| 32 | + - name: projector |
| 33 | + # Application scheme - must be http or https |
| 34 | + scheme: http |
| 35 | + # Application port |
| 36 | + port: 9999 |
| 37 | + # Working directory |
| 38 | + dir: /home/coder |
| 39 | + # File path to icon used in application launcher |
| 40 | + icon_path: /home/coder/goland.svg |
| 41 | + # Command to start the application |
| 42 | + command: /home/coder/.local/bin/projector |
| 43 | + # Array of arguments for command |
| 44 | + args: ["run"] |
| 45 | + # Health checks to get running application status |
| 46 | + # Can use exec or http health checks to localhost |
| 47 | + health_check: |
| 48 | + exec: |
| 49 | + command: "pgrep" |
| 50 | + args: ["projector"] |
| 51 | + http: |
| 52 | + scheme: "http" |
| 53 | + path: "/" |
| 54 | + port: 9999 |
| 55 | +``` |
| 56 | +
|
| 57 | +**Notes**: |
| 58 | +
|
| 59 | +- All top-level fields in the `config.yaml` file are required |
| 60 | +- You must include at least one health check. The |
| 61 | + `exec` health check looks for an exit code of `0`, while the `http` health |
| 62 | + check looks for the return of `HTTP 200`. |
| 63 | + |
| 64 | +You can include the applications specification file in your |
| 65 | +[workspace image](../images/writing.md). You an also modify the file via |
| 66 | +[personalization](./personalization.md) scripts. |
0 commit comments