Skip to content

Latest commit

 

History

History
127 lines (82 loc) · 7.93 KB

using-github-codespaces-in-your-jetbrains-ide.md

File metadata and controls

127 lines (82 loc) · 7.93 KB
title shortTitle intro versions type topics redirect_from
Using GitHub Codespaces in your JetBrains IDE
JetBrains IDEs
You can use the JetBrains Gateway to connect to your codespace and work in your favorite JetBrains IDE.
fpt ghec
*
*
how_to
Codespaces
Developer
/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide

{% data reusables.codespaces.codespaces-jetbrains-beta-note %}

About {% data variables.product.prodname_codespaces %} in JetBrains IDEs

If you use a JetBrains IDE to work on your code, you can take advantage of working in a codespace. You do this by using the JetBrains Gateway application.

After installing the JetBrains Gateway, you can set JetBrains as your default editor for {% data variables.product.prodname_codespaces %}. If you do, then whenever you open a codespace from {% data variables.product.github %}, the JetBrains Gateway will launch to allow you to choose your JetBrains IDE and connect to the codespace.

When you work in a codespace, you use the JetBrains thin client application on your local computer. This provides the graphical interface for the full JetBrains IDE of your choice, which runs on the remote virtual machine that hosts your codespace. The thin client is always used, even if the full JetBrains IDE is installed locally. Any local JetBrains IDE settings are imported and used by the thin client.

{% note %}

Note: Only existing codespaces are available in the JetBrains Gateway. You can create codespaces in {% data variables.product.github %}, or by using {% data variables.product.prodname_cli %}. For more information, see "AUTOTITLE."

{% endnote %}

The JetBrains remote development connection process

The basic process behind using a codespace in your JetBrains IDE is as follows.

  1. In the JetBrains Gateway application you select one of your active or stopped codespaces.
  2. You then choose which JetBrains IDE you want to use.
  3. The selected JetBrains IDE is then downloaded to the remote virtual machine that hosts your codespace and source code.
  4. The JetBrains thin client application is then downloaded to your local machine and started.
  5. The client application connects to the full backend IDE.
  6. You can work on your code in the client application in just the same way you would in a local environment.

Prerequisites

To work in a codespace in a JetBrains IDE you need:

  • A valid JetBrains license
  • The JetBrains Gateway application, versions 2023.3.* or 2024.1.*
  • An existing codespace running on a virtual machine that has at least 4 cores. The codespace must also be running an SSH server. For more information, see "Codespace running an SSH server."

JetBrains license

You must have a JetBrains license that supports the IDE you choose in the JetBrains Gateway.

JetBrains Gateway

You can install and update the JetBrains Gateway from the JetBrains Toolbox application.

  1. Download and install the JetBrains Toolbox.

  2. Open the JetBrains Toolbox.

  3. Find Gateway in the list of available tools.

    Screenshot of the JetBrains Toolbox with "Gateway" at the bottom of the list of applications. Each application has an "Install" button next to it.

  4. To the right of Gateway, click the ellipsis (...), then click Available versions.

  5. In the list of versions, beside a supported version (see "Prerequisites"), click Install.

Codespace running an SSH server

You must have an existing codespace to connect to, and the virtual machine that hosts the codespace must have at least 4 cores. {% data reusables.codespaces.ways-to-create-a-codespace %} For more information, see "AUTOTITLE."

{% data reusables.codespaces.ssh-server-installed %}

For more information about the devcontainer.json file and the default container image, see "AUTOTITLE."

{% note %}

Note: For help with connecting to your codespace over SSH, see "AUTOTITLE."

{% endnote %}

Setting up the JetBrains Gateway

The first time you use JetBrains Gateway for {% data variables.product.prodname_github_codespaces %}, you must install the {% data variables.product.prodname_codespaces %} plugin. You must also allow the JetBrains Gateway to access {% data variables.product.github %} using your {% data variables.product.prodname_dotcom %} account.

  1. Open the JetBrains Toolbox application.

  2. In the list of installed tools, click Gateway.

  3. Under Install More Providers click the Install link for {% data variables.product.prodname_github_codespaces %}.

    Screenshot of the "Welcome to JetBrains Gateway" page, with  "{% data variables.product.prodname_github_codespaces %}" listed under "Install More Providers."

  4. Click Connect to Codespace.

    Screenshot of the Gateway with the "Connect to {% data variables.product.prodname_codespaces %}" button.

  5. The first time you connect, you're prompted to choose whether you want to allow {% data variables.product.prodname_dotcom %} to collect anonymized usage data, to improve functionality and user experience. Click Allow or Deny.

    You can change your choice later, if required, in the settings for the {% data variables.product.prodname_github_codespaces %} plugin, which you can access within the JetBrains Gateway settings.

  6. In the "Welcome to JetBrains Gateway" dialog, click Sign In with {% data variables.product.prodname_dotcom %}.

  7. Click the icon beside the one-time code to copy it.

    Screenshot of a one-time login code. The copy icon beside the code is highlighted with a dark orange outline.

  8. Click the login link, below the login code.

  9. If you are not currently signed in to {% data variables.product.prodname_dotcom %}, the sign-in page is displayed.

    • Enter your details and click Sign in.
    • Verify your authentication, for example by entering a two-factor authentication code.
  10. On the "Device activation" page, paste the copied code and click Continue.

  11. If you belong to organizations, the "Single sign-on to your organizations" page is displayed. Click Authorize beside the organizations you want to authorize the JetBrains Gateway to access, then click Continue.

  12. On the "Authorize {% data variables.product.prodname_github_codespaces %} for JetBrains" page, click Authorize {% data variables.product.prodname_dotcom %}.

  13. Return to the JetBrains Gateway application and open a codespace from the list of your currently active or stopped codespaces, see step 3 of the following procedure.

Opening a codespace in your JetBrains IDE

{% data reusables.codespaces.opening-codespace-in-jetbrains %}

The first time you connect to a codespace, the backend IDE will be downloaded to the remote machine. This may take a few minutes. The next time you connect to the same codespace this step won't be necessary, making the connection process quicker.

The backend IDE is then started. Again, this step will not be required in future if you are reconnecting to a backend IDE that you have left running.

The client application is then launched.

Further reading