index.md 2.88 KB
Newer Older
Marcia Ramos's avatar
Marcia Ramos committed
1 2 3 4
---
type: reference
---

5
# Interactive Web Terminals
6

7
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/50144) in GitLab 11.3.
8

9
Interactive web terminals give the user access to a terminal in GitLab for
10 11 12 13
running one-off commands for their CI pipeline. Since this is giving the user
shell access to the environment where [GitLab Runner](https://docs.gitlab.com/runner/) 
is deployed, some [security precautions](../../administration/integration/terminal.md#security) were
taken to protect the users.
14 15

NOTE: **Note:**
16 17 18 19 20
[Shared runners on GitLab.com](../quick_start/README.md#shared-runners) do not
provide an interactive web terminal. Follow [this
issue](https://gitlab.com/gitlab-org/gitlab-ce/issues/52611) for progress on
adding support. For groups and projects hosted on GitLab.com, interactive web
terminals are available when using your own group or project runner.
21 22 23 24 25 26

## Configuration

Two things need to be configured for the interactive web terminal to work:

- The Runner needs to have [`[session_server]` configured
Marcia Ramos's avatar
Marcia Ramos committed
27
  properly](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-session_server-section)
28
- If you are using a reverse proxy with your GitLab instance, web terminals need to be
29 30 31 32 33 34 35
  [enabled](../../administration/integration/terminal.md#enabling-and-disabling-terminal-support)

## Debugging a running job

NOTE: **Note:** Not all executors are
[supported](https://docs.gitlab.com/runner/executors/#compatibility-chart).

36 37 38 39 40 41
NOTE: **Note:** The `docker` executor does not keep running
after the build script is finished. At that point, the terminal will automatically
disconnect and will not wait for the user to finish. Please follow [this
issue](https://gitlab.com/gitlab-org/gitlab-runner/issues/3605) for updates on
improving this behavior.

42 43
Sometimes, when a job is running, things don't go as you would expect, and it
would be helpful if one can have a shell to aid debugging. When a job is
44
running, on the right panel you can see a button `debug` that will open the terminal
45 46 47 48 49
for the current job.

![Example of job running with terminal
available](img/interactive_web_terminal_running_job.png)

50 51
When clicked, a new tab will open to the terminal page where you can access
the terminal and type commands like a normal shell.
52 53 54 55 56

![terminal of the job](img/interactive_web_terminal_page.png)

If you have the terminal open and the job has finished with its tasks, the
terminal will block the job from finishing for the duration configured in
Marcia Ramos's avatar
Marcia Ramos committed
57
[`[session_server].terminal_max_retention_time`](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-session_server-section) until you
58 59 60
close the terminal window.

![finished job with terminal open](img/finished_job_with_terminal_open.png)
61

62
## Interactive Web Terminals for the Web IDE **(ULTIMATE ONLY)**
63 64 65

Read the Web IDE docs to learn how to run [Interactive Terminals through the Web IDE](../../user/project/web_ide/index.md).