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.
- Run the following command to create a Target:
daytona target create
-
Select the Target Configuration to use for the Target.
-
Select the Provider for the environment you want to deploy to.
-
Enter a name for your Target.
Target Name>
- 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
- Enter a name for your Target.
Target Name>
✓ Request submittedCreating target <target_name>
Start a Target
Daytona provides an option to start a Target.
- Run the following command to start a Target:
daytona target start
- 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.
- Run the following command to stop a Target:
daytona target stop
- 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.
- Run the following command to list all Targets:
daytona target list
Upon running the command, Daytona will display a list of all Targets along with their configurations.
Target Config Name # Workspaces Default Statuslocal (Docker) local 0 Yes /AWS aws 0 No Started
Restart a Target
Daytona provides an option to restart a Target.
- Run the following command to restart a Target:
daytona target restart
Delete a Target
Daytona provides an option to remove a Target.
- Run the following command to remove a Target:
daytona target delete
- 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.
- Run the following command to view detailed information about a Target:
daytona target info
- 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: localID: <target_id>Provider: DockerRunner: localDefault: YesState: Running# Workspaces: 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.
- Run the following command to set a Target as the default Target:
daytona target set-default
- 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.
- Run the following command to SSH into a Target:
daytona target ssh
- 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.
- Run the following command to view logs for a Target:
daytona target logs
- 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