# Run targets

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/go/2026.3/llms.txt).

You can run Go Build and Go Test configurations on an SSH server, in WSL, or in a Docker container directly from GoLand.

Run targets let you test your code in a selected environment.

## Prerequisites

To run Go code on a target, configure the target with a Go runtime.

In a Go Build or Go Test configuration, select the target from the Run on list. Then launch the configuration as you would locally.

You can run several configurations on the same target. You can also set a default target for the project.

Procedure: Set a default target for a project

1. Click `Run | Manage Targets`.

2. From the Project default target list, select a target that you want to use for your project.

## Supported run/debug configuration types

The following [run/debug configurations](run-debug-configuration.html) can run on a remote target:

* Go Build

* Go Test

## Create a run/debug configuration

Procedure:

1. Go to `Run | Edit Configurations`. Alternatively, press `Alt+Shift+F10` (Windows), `⌃ ⌥ R` (macOS), `⌥ ⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌃ ⌥ R` (macOS System Shortcuts), `Alt+Shift+F10` (XWin), `Alt+Shift+F10` (GNOME), `Alt+Shift+F10` (KDE), `Alt+Shift+F10` (Emacs), `Alt+Shift+F10` (Sublime Text), `⌃ ⌥ R` (Sublime Text (macOS)), `Ctrl+;, A` (VSCode), `⌘ ;, A` (VSCode (macOS)), then `0` (Windows), `0` (macOS), `0` (IntelliJ IDEA Classic (macOS)), `0` (macOS System Shortcuts), `0` (XWin), `0` (GNOME), `0` (KDE), `0` (Emacs), `0` (Sublime Text), `0` (Sublime Text (macOS)), `0` (VSCode), `0` (VSCode (macOS)).

2. In the [Run/Debug Configuration](run-debug-configuration.html) dialog, click the Add button ![the Add button](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.add.svg) on the toolbar or press `Alt+Insert` (Windows), `⌘ N` (macOS), `⌃ N` (IntelliJ IDEA Classic (macOS)), `⌘ N` (macOS System Shortcuts), `Alt+Insert` (XWin), `Alt+Insert` (GNOME), `Alt+Insert` (KDE), `Alt+Insert` (Emacs), `Ctrl+N` (Sublime Text), `⌘ N` (Sublime Text (macOS)), `Alt+Insert` (VSCode), `⌃ ⏎` (VSCode (macOS)).

3. Select one of the [supported](#supported-rcs) run/debug configuration types.

4. If you have already defined the target, select it from the  Run on  menu. Otherwise, click  Manage targets…  to add a new target. For more information on configuring a particular target type, refer to the following procedures:

* [SSH](#ssh)

* [Docker](#docker)

* [WSL](#wsl)

You can also configure a run target in a run/debug configuration template, so the next time you create a new configuration of that type, its parameters already have the desired values. For more information, refer to [Configure the default values for a template](run-debug-configuration.html#change-template).

## Run

Procedure:

Procedure for running the app on a remote target is the same as for running it locally:

1. Select the run/debug configuration on the main toolbar.

2. Click ![The Run button](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.execute.svg) or press `Shift+F10` (Windows), `⌃ R` (macOS), `⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌥ ⇧ R` (macOS System Shortcuts), `Shift+F10` (XWin), `Shift+F10` (GNOME), `Shift+F10` (KDE), `Shift+F10` (Emacs), `Shift+F10` (Sublime Text), `Shift+F10` (Sublime Text (macOS)), `Ctrl+F5` (VSCode), `⌃ F5` (VSCode (macOS)).

When Build on remote target is selected, GoLand copies the required source files to the target and builds the application or tests there. GoLand also builds on the target when the selected Go SDK is located in WSL. Otherwise, it builds locally and copies the compiled executable to the target.

## Target types

A target describes the configuration of the environment in which the application will run.

You can create the following targets:

* [Docker](#docker)

* [WSL](#wsl)

* [SSH](#ssh)

* [Docker Compose](#docker_compose)

When you create a remote target, GoLand automatically detects the configuration available in the remote environment. If required, you can manually configure additional configuration.

### WSL

Procedure:

1. In the main menu, click `Run | Manage Targets` .

2. From the Add Target On window, select WSL.

![select wsl from run on list](https://resources.jetbrains.com/help/img/idea/2026.3/go_select_wsl_from_run_on_list.png)

3. In the New Target wizard, select your Linux distribution from the Linux distribution list. If the distribution was detected automatically and the introspection passed, click Next.

4. Check that the Go runtime configuration for WSL was detected correctly and click Finish.

Alternatively, type your own settings.

* Go Executable: the path to the Go executable (for example, `/usr/local/go/bin/go`)

* GOPATH: the target's GOPATH. GoLand detects this value automatically by running `go env GOPATH`.

* Version: the Go version. GoLand detects this information automatically by running `go version`.

* Additional settings: a group of settings that allow you to set directories for source code files and executables. To run on a target, GoLand uploads source files, files from the working directory, compiled executables, and Delve. If you do not specify paths in Additional Settings, GoLand creates directories for source files and executables. You can specify the following options: * Project sources directory: a directory on a target where source code files are uploaded. * Compiled executables directory: a directory on a target that is used to store executables that your code produces.

![check Go runtime configuration for WSL](https://resources.jetbrains.com/help/img/idea/2026.3/go_check_go_runtime_configuration_for_wsl.png)

5. In the Run Targets dialog, click the Project default target list and select the created configuration.

![Run tool window: WSL output](https://resources.jetbrains.com/help/img/idea/2026.3/go_wsl_change_target_to_wsl.png)

6. Run your application.

![Create a WSL configuration](https://resources.jetbrains.com/help/img/idea/2026.3/go_create_a_wsl_configuration.png)

### SSH

> **Note:**
> FTP/SFTP/WebDAV connectivity plugin is required.

Procedure:

1. Select if you want to use an existing SSH configuration or create a new one:

Existing:

Select an existing SSH configuration from the SSH list, then click Next. For more information about configuring SSH, refer to [Create SSH configurations](create-ssh-configurations.html).

New:

1.  Enter the IP of the SSH server, the port listening for SSH connections, and the name of the user on the server machine, on whose behalf you are going to run your application. Click Next.

2.

Wait for the connection to be established. If there is an agent that has the credentials, no additional configuration will be required. Otherwise, select the authentication method and provide the required values:

* Password: enter the password.

* Key pair (OpenSSH or PuTTY): To apply this authentication method, you must have a private key on the client machine and a public key on the remote server. GoLand supports private keys that are generated with the [OpenSSH](https://www.openssh.com/) utility. Specify the path to the file where your private key is stored and type the passphrase (if any) in the corresponding fields. To have GoLand remember the passphrase, select the Save passphrase checkbox.

Click Next.

> **Tip:**
> For more information about working with SSH keys, refer to the [Generating a new SSH key and adding it to the ssh-agent](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/) tutorial.

2. Wait for the SSH server introspection to complete. During this step, GoLand tries to identify the language configuration available in the environment. Click Next.

3. Configure the following properties:

* Use rsync: toggle this option to use [rsync](https://rsync.samba.org) for file transfer. This is recommended as it will generally speed up copying files.

* Project path on target: the path on the server that will be used for storing the project files.

4. Set the path to the Go executable and, if needed, GOPATH. GoLand detects the Go version automatically. The Version field is read-only.

The following Go configuration settings are available:

* Go Executable: the path to the Go executable (for example, `/usr/local/go/bin/go`)

* GOPATH: the target's GOPATH. GoLand detects this value automatically by running `go env GOPATH`.

* Version: the Go version. GoLand detects this information automatically by running `go version`.

* Additional settings: a group of settings that allow you to set directories for source code files and executables. To run on a target, GoLand uploads source files, files from the working directory, compiled executables, and Delve. If you do not specify paths in Additional Settings, GoLand creates directories for source files and executables. You can specify the following options: * Project sources directory: a directory on a target where source code files are uploaded. * Compiled executables directory: a directory on a target that is used to store executables that your code produces.

### Docker

> **Note:**
> Docker plugin is required.

Procedure:

1. Select or configure a Docker server as described in [Enable Docker support.](docker.html#connect_to_docker)

2. On Windows and macOS, allow Docker to access the project folder and any other local folders used by the container.  For more information, refer to [official Docker documentation](https://docs.docker.com/desktop/).

3. Select if you want to build an image locally or pull it from Docker registry.

Build:

* Dockerfile: the Dockerfile that will be used for building the image.

* Context folder: a folder whose contents will be accessible by the Docker daemon during the build to be later used in the image filesystem.

* Rebuild image automatically every time before running code: when this option is set, the image will be rebuilt every time the code is run. Otherwise, GoLand will use the already existing image (if any).

Additionally, you can specify the following:

* Image tag: specify the name and tag for the built image. Similar to using the `-t` option with `docker build`.

* Build options: specify arbitrary options for the `docker build` command.

* Build args: [override the default build-time variables](https://docs.docker.com/engine/reference/commandline/build/#set-build-time-variables-build-arg). Similar to using the `--build-arg` option with `docker build`.

* Run options: specify arbitrary options for the `docker run` command. > **Note:** > Not all `docker run` options are supported. If you would like to request support for some option, leave a comment in [IDEA-181088](https://youtrack.jetbrains.com/issue/IDEA-181088).

Pull:

* Image tag: specify the full coordinates for the image to be pulled from a registry. The default `:latest` tag will be used if only repository is specified.

* Run options: specify arbitrary options for the `docker run` command. > **Note:** > Not all `docker run` options are supported. If you would like to request support for some option, leave a comment in [IDEA-181088](https://youtrack.jetbrains.com/issue/IDEA-181088).

4. Wait for the container introspection to complete. During this step, GoLand tries to identify the language configuration available in the environment. Click Next.

5. Set the path to the Go executable and, if needed, GOPATH. GoLand detects the Go version automatically.

The following Go configuration settings are available:

* Project path on target: the path on the server that will be used for storing the project files.

* Go Executable: the path to the Go executable (for example, `/usr/local/go/bin/go`)

* GOPATH: the target's GOPATH. GoLand detects this value automatically by running `go env GOPATH`.

* Version: the Go version. GoLand detects this information automatically by running `go version`.

* Additional settings: a group of settings that allow you to set directories for source code files and executables. To run on a target, GoLand uploads source files, files from the working directory, compiled executables, and Delve. If you do not specify paths in Additional Settings, GoLand creates directories for source files and executables. You can specify the following options: * Project sources directory: a directory on a target where source code files are uploaded. * Compiled executables directory: a directory on a target that is used to store executables that your code produces.

### Docker Compose

You can use a single Docker Compose service as a run target.

> **Note:**
> Docker plugin is required.

Procedure:

1. Select or configure a Docker server as described in [Enable Docker support.](docker.html#connect_to_docker)

2. For Windows and macOS – make sure Docker has access to all the folders used in the workflow, for example, the project folder. For more information, refer to [official Docker documentation](https://docs.docker.com/desktop/).

3. Specify the Docker Compose configuration files, select the necessary service, and provide any additional environment variables. Click Next.

4. Wait for the Docker Compose service introspection to complete. During this step, GoLand tries to identify the language configuration available in the environment. Click Next.

5. Set the path to the Go executable and, if needed, GOPATH. GoLand detects the Go version automatically.

The following Go configuration settings are available:

* Project path on target: the path on the server that will be used for storing the project files.

* Go Executable: the path to the Go executable (for example, `/usr/local/go/bin/go`)

* GOPATH: the target's GOPATH. GoLand detects this value automatically by running `go env GOPATH`.

* Version: the Go version. GoLand detects this information automatically by running `go version`.

* Additional settings: a group of settings that allow you to set directories for source code files and executables. To run on a target, GoLand uploads source files, files from the working directory, compiled executables, and Delve. If you do not specify paths in Additional Settings, GoLand creates directories for source files and executables. You can specify the following options: * Project sources directory: a directory on a target where source code files are uploaded. * Compiled executables directory: a directory on a target that is used to store executables that your code produces.

