Skip to content

Targets

A Target is an isolated processing unit where Workspaces are executed. It can operate on various infrastructures, including cloud-based and on-premises environments. Targets provide the necessary compute resources and meet security requirements within the defined infrastructure.

Create a Target

Daytona provides an option to create a Target. Creating a Target requires creating a Target Configuration and specifying the Provider to use.

  1. Run the following command to create a Target:
Terminal window
daytona target create
  1. Select the Target Configuration to use for the Target.

  2. Select the Provider for the environment you want to deploy to.

  3. Enter a name for your Target.

Target Name
>
  1. Enter the appropriate configuration options when prompted. The configuration options vary based on the selected Provider. The following example shows adding a local Docker Target Configuration.
Sock Path
> /var/run/docker.sock
  1. Enter a name for your Target.
Target Name
>
✓ Request submitted
Creating target <target_name>

Start a Target

Daytona provides an option to start a Target.

  1. Run the following command to start a Target:
Terminal window
daytona target start
  1. Select the Target you want to start.
Select Targets to Start
===
local (default)
<target_id>
Docker (local)

Stop a Target

Daytona provides an option to stop a Target.

  1. Run the following command to stop a Target:
Terminal window
daytona target stop
  1. Select the Target you want to stop.
Select Targets to Stop
===
local (default)
<target_id>
Docker (local)

List Targets

Daytona provides an option to list all Targets.

  1. Run the following command to list all Targets:
Terminal window
daytona target list

Upon running the command, Daytona will display a list of all Targets along with their configurations.

Target Config Name # Workspaces Default Status
local (Docker) local 0 Yes /
AWS aws 0 No Started

Restart a Target

Daytona provides an option to restart a Target.

  1. Run the following command to restart a Target:
Terminal window
daytona target restart

Delete a Target

Daytona provides an option to remove a Target.

  1. Run the following command to remove a Target:
Terminal window
daytona target delete
  1. Select the Target you want to delete.
Select Targets to Delete
===
local (default)
<target_id>
Docker (local)

Targets Information

Daytona provides an option to view detailed information about a Target.

  1. Run the following command to view detailed information about a Target:
Terminal window
daytona target info
  1. Select the Target you want to view information about.
Select Target to View
===
local (default)
<target_id>
Docker (local)

Upon running the command, Daytona will display detailed information about the selected Target.

Name: local
ID: <target_id>
Provider: Docker
Runner: local
Default: Yes
State: Running
# Workspaces: 1
  1. Select the Target you want to restart.
Select Targets to Restart
===
local (default)
<target_id>
Docker (local)

Upon running the command, Daytona will restart the selected Target.

Set Default Target

Daytona provides an option to set a Target as the default Target.

  1. Run the following command to set a Target as the default Target:
Terminal window
daytona target set-default
  1. Select the Target you want to set as the default Target.
Select a Target To Set As Default
===
local (default)
<target_id>
Docker (local)

Upon running the command, Daytona will set the selected Target as the default Target.

Target 'local' set as default

SSH into a Target

Daytona provides an option to SSH into a Target.

  1. Run the following command to SSH into a Target:
Terminal window
daytona target ssh
  1. Select the Target you want to SSH into.
Select a Target To SSH Into
===
local (default)
<target_id>
Docker (local)

Upon running the command, Daytona will SSH into the selected Target.

Target Logs

Daytona provides an option to view logs for a Target.

  1. Run the following command to view logs for a Target:
Terminal window
daytona target logs
  1. Select the Target you want to view logs for.
Select a Target To View Logs
===
local (default)
<target_id>
Docker (local)

Upon running the command, Daytona will display logs for the selected Target.

local | Creating target local (<target_id>)
local | ✓ Target creation complete