Skip to content

Workspaces

Workspaces contain your project’s codebase, dependencies and packages, and configuration. Daytona allows you to create Workspaces on various Git Providers

Create a Workspace

You can create a Workspace.

Prerequisites

  • A working installation of Daytona.
  • At least 1 Target configured.

From a Configured Git Provider

Procedure

  1. Execute the following command to start the guided Workspace creation process:
    Terminal window
    daytona create
  2. Select the Git Provider and repository you want your Workspace to be configured with.
  3. Enter a name for your Workspace.
  4. Wait for Daytona to create the Workspace.

From an Arbitrary Git URL

Procedure

  1. Execute the following command to create a Workspace from a remote Git repository:

    Terminal window
    daytona create <REPO_URL>

    Example

    Terminal window
    daytona create https://github.com/daytonaio/daytona.git
  2. Wait for Daytona to create the Workspace.

List Workspaces

You can list all previously created Workspaces.

  1. Execute the following command to see a list of Workspaces:
    Terminal window
    daytona list

Open An Existing Workspace

You can open an existing Workspace in your IDE.

Prerequisites

  • A working installation of Daytona.
  • At least 1 existing Workspace.

Procedure

  1. Execute the following command to list existing Workspaces:
    Terminal window
    daytona code
  2. Select the Workspace you want to open.

Delete a Workspace

You can delete an existing Workspace.

Prerequisites

  • A working installation of Daytona.
  • At least 1 existing Workspace.

Procedure

  1. Run the following command:
    Terminal window
    $ daytona delete
  2. Select the desired Workspace for deletion in the list and hit Enter.
  3. Confirm the action.

IDEs

Daytona allows you to connect to your Workspace using your preferred IDE. Out of the box, Daytona can be configured to open your Workspace in the following IDEs:

  • Visual Studio Code (VSCode)
    • Desktop (Linux, macOS, Windows)
    • Browser
  • JetBrains IDEs
    • CLion
    • GoLand
    • IntelliJ IDEA Ultimate
    • PhpStorm
    • Rider
    • RubyMine
    • WebStorm
  • Terminal SSH

Set the Default IDE

You can set the default IDE used by Daytona. After setting the default IDE, it will be opened automatically and connected to your Workspace when using the daytona code command.

Prerequisites

  • A working installation of Daytona.

Procedure

  1. Execute the following command to enter the IDE selection terminal UI:
    Terminal window
    daytona ide
  2. Select your preferred IDE from the list presented.

Forward Ports from a Workspace

Daytona supports flexible port forwarding, allowing you to access services running in a Workspace locally or via a shareable public URL. With port forwarding, you can work on your project in a Workspace and test your code externally.

Access a Port Locally

You can access services running in a Workspace on your local machine.

Prerequisites

  • A working installation of Daytona.
  • A running Workspace with at least 1 service accessible via TCP/UDP.

Procedure

  1. Execute the following command to forward a port from a running Workspace to your local machine:

    Terminal window
    daytona forward <PORT> <WORKSPACE> <PROJECT>

    Example: allow local access to port 4321 of the example-dev-env Workspace

    Terminal window
    daytona forward 4321 example-dev-env

Access a Port via Public URL

You can access services running in a Workspace via a generated public URL. This allows you to share your work with others in real-time.

Prerequisites

  • A working installation of Daytona.
  • A running Workspace with at least 1 service accessible via TCP/UDP.

Procedure

  1. Execute the following command to generate a public URL for a port on a running Workspace:

    Terminal window
    daytona forward <PORT> <WORKSPACE> <PROJECT> --public

    Example: generate a URL to access port 4321 of the example-dev-env Workspace

    Terminal window
    daytona forward 4321 example-dev-env --public