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

A simpliest example of a template includes below properties. Each of the properties is case sensitive. This section will help you create your own template.

[
{
"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.
  • 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 this 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 be a 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.

Requirement of a custom template

  • Hosted publicly, be it git provider or elsewhere.
  • An array of objects that is accessible as raw content.
  • Each object needs to include the required properties (as seen here).
  • gitUrl field needs to be a public repository. This will be the core content of your template and how your workspace will be built.

Obtaining 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 (on line 17) and replace the value with your raw content link from step 1.

  • 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
  • You can see more about the arguments you can pass in here to help you with identity provider and domain set up.