Skip to content

Templates

Templates are displayed on the right side of your Daytona dashboard when you try to create a Workspace. You can use them to customize your Daytona dashboard in combination with devcontainer during deployment to create Workspaces faster based on your requirements.

We will walk through our default templates, the content of each template, how to customise your own templates and how to deploy them a custom template to your Daytona dashboard.

We assume you have a successful Daytona deployment and gained access to a Daytona dashboard URL.

Default Templates Index

The default template index is a JSON file that contains an array of 13 objects. Each object represents a template. The template is located in this repository.

If you accidentally removed all the default templates and want to add it back, you might want to take the default templates.

Construct of a Template

The simplest example of a template includes the listed properties. Each of the properties is case sensitive.

[
{
"name": "C# (.NET)",
"description": "Develop C# and .NET based applications. Includes all needed SDKs, extensions, and dependencies.",
"gitUrl": "https://github.com/daytonaio-templates/dotnet",
"imageUrl": "https://raw.githubusercontent.com/daytonaio-templates/index/main/img/dotnet.png",
"rawReadmeUrl": "https://raw.githubusercontent.com/daytonaio-templates/dotnet/main/README.md"
}
]
  • name

    Required.

    The name of the template being displayed on the Daytona dashboard.

  • description

    Required.

    The description of the template. This property won’t be displayed it’d be helpful to take notes when you are creating them.

  • gitUrl

    Required.

    The content of the template.

  • imageUrl

    Required.

    An image display on the template when it is deployed to the dashboard. It supports JPG, JPEG, SVG and PNG formats. It can link to any public image.

  • rawReadmeUrl

    Required.

    Textual content is displayed on the pop-up dialog after you click on the selected template button on the dashboard. It is used to help users understand the content of the template. It has to be the raw content of a markdown file.

Customizing Templates

If you wish to customize your own template, you can create a copy of our default template and edit it to suit your needs.

To create a custom template, start by making a copy of the default template and modify it according to your requirements.

Requirement of a Custom Template

  • The template must be hosted publicly, on a Git Provider or another platform.
  • An array of objects accessible as raw content.
  • Each object needs to include the required properties.
  • gitUrl field needs to be a public repository. This repository will serve as the core content of your template and will be used to build your Workspace.

Obtain Raw Content from a Public Repository

You can obtain raw content easily if the images and content of templates are available publicly with your Git provider.

We will be using README.me file as an example. You can do the same for other content.

  1. Obtain raw content link from GitHub
  • Open a public repository on GitHub in browser. In your repository’s list of files, select the README.md file.

  • In the upper right corner of the file view, click Raw to see the raw content.

  • Copy the URL in the browser. This link is a raw content link suitable for the value of rawReadmeUrl field.

  1. Obtain raw content link from Gitlab
  • Open a public repository on GitLab in the browser. In your repository’s list of files, select the README.md file.

  • In the upper right corner of the file view, click on Open Raw to see the raw content (hover to see Open Raw, the button is in between the Download button and Copy file content button).

  • Copy the URL in the browser. This link is a raw content link suitable for the value of rawReadmeUrl field.

  1. Obtain raw content link from BitBucket
  • Open a public repository on BitBucket in the browser. In your repository’s list of files, select the README.md file.

  • In the upper right corner of the file view, click on the 𓈓 button next to Edit and select Open raw.

  • Copy the URL in the browser. This link is a raw content link suitable for the value of the rawReadmeUrl field.


Deploy Custom Templates

You can build your own template within your organization to suit your development needs. While the Daytona installer script lives in your virtual machine, you can edit the file content to customize your template.

  1. Copy the raw content of your template
  1. Open the shell of your virtual machine
  • You can SSH into your virtual machine within your terminal.
  • You can also open the shell of your virtual machine within the browser if your cloud provider supports so.
  1. Edit variable TEMPLATE_INDEX_URL in installer script
  • Entering the installer folder and edit it via nano. You can use any text editor you prefer.
Terminal window
cd installer
nano setup.sh
  • On the top of the file, find the variable TEMPLATE_INDEX_URL (line 17) and replace the value with your raw content link from the first step.

  • After finishing editing, press Ctrl + O to save and press Enter to confirm.

  • Press Ctrl + X to exit nano.


  1. Redeploy the script. Run the script again to deploy your custom template. Optionally you can pass in any arguments you need.
Terminal window
./setup.sh