Skip to main content

Connect to a Workspace

Connect to a Workspace

After a workspace is successfully created, the workspace is reachable via the ssh host WORKSPACE_NAME.devspace. If you have selected an IDE to automatically open, DevSpace will automatically try to open the IDE after a successful workspace creation or devspace up command.

info

You can change the default IDE to open globally via: devspace use ide vscode or devspace up my-workspace --ide vscode for an individual workspace.

VS Code Browser

DevSpace is able to open VS Code in a browser in a workspace. It will use the open source project openvscode-server for installing a vscode server binary in the workspace and then tunnel a connection to that binary from the localhost. To open the workspace inside VS Code browser, you can run the following command:

devspace up my-workspace --ide openvscode

To select a different openvscode version, please run with:

devspace up my-workspace --ide openvscode --ide-option VERSION=v1.76.2

VS Code

Before connecting VS Code with DevSpace, make sure you have installed the remote ssh extension and the code CLI. Then you can start the workspace directly in VS Code with:

devspace up my-workspace --ide vscode
SSH Fallback

If for whatever reason this does not work you can also use the regular SSH connection with WORKSPACE_NAME.devspace to connect VS Code with a workspace

JetBrains Suite (Goland, PyCharm, Intellij etc.)

Make sure you have JetBrains Gateway installed and a valid jetbrains subscription for your local IDE. The following JetBrains IDEs are supported:

  • CLion (clion)
  • Goland (goland)
  • PyCharm (pycharm)
  • Intellij (intellij)
  • PhpStorm (phpstorm)
  • WebStorm (webstorm)
  • Rider (rider)
  • RubyMine (rubymine)

Then start your workspace via:

devspace up my-workspace --ide goland

Which will install the goland server binary into the workspace and then open JetBrains Gateway to open this workspace.

After successful installation the Gateway SSH dialog will popup prefilled with the correct information, please click Check Connection and Continue, which will start your desired IDE inside the workspace.

To select a different IDE version, please run with:

devspace up my-workspace --ide goland --ide-option VERSION=2022.3.3
SSH Fallback

If for whatever reason this does not work you can also use the regular SSH connection with WORKSPACE_NAME.devspace to connect your JetBrains IDE with a workspace

Fleet Support

Fleet currently only works by manually adding an SSH connection with WORKSPACE_NAME.devspace

SSH

Upon workspace creation, DevSpace will automatically modify the ~/.ssh/config to include an entry for WORKSPACE_NAME.devspace, which allows you to use the following command to connect to your workspace:

ssh WORKSPACE_NAME.devspace

This also allows you to connect any IDE that supports remote development through SSH via the given host WORKSPACE_NAME.devspace.

DevSpace CLI

If you don't have ssh installed or cannot connect through any other IDE, you can use the following DevSpace command to access a workspace:

devspace ssh my-workspace

Optionally you can also define a command to run:

devspace ssh my-workspace --command "echo Hello World"

IDE Commands

This section shows additional commands to configure DevSpace's behavior when opening a workspace.

Configure IDE Options

You can specify certain options such as IDE version and download path if needed. You can list the available options for an IDE via:

devspace ide options openvscode

You will see available options and default values for them. To change an option, you can run:

devspace ide set-options openvscode -o VERSION=v1.76.2

Change Default IDE

To change the default IDE DevSpace will use for connecting to a workspace, please run:

devspace ide use vscode

List supported IDEs

You can list all DevSpace supported IDEs via:

devspace ide list