Blog Product Create a workspace quickly with the GitLab default devfile
Published on: February 27, 2025
2 min read

Create a workspace quickly with the GitLab default devfile

The GitLab default devfile makes it easier than ever to try out workspaces for new projects. Learn how to share developer environment configurations effortlessly with this tutorial.

scanning - cover

Software development environments can be complex to set up and maintain. Developers often spend a significant amount of time configuring their local environments with the right dependencies, tools, and settings. GitLab aims to solve this by providing a default devfile that enables you to create workspaces and to start developing quickly.

GitLab Workspaces

GitLab Workspaces provide isolated development environments for making changes to your GitLab projects without the complexity of setting up local dependencies. Workspaces ensure reproducible development setups, allowing developers to share their environment configurations effortlessly.

By default, GitLab Workspaces are configured to use the GitLab VS Code fork and include the GitLab Workflow extension. To learn more, visit the GitLab Workspaces documentation.

Understand devfiles

A devfile is a YAML-based declarative configuration file that defines a project's development environment. It specifies the necessary tools, languages, runtimes, and other components required for development.

Previously, setting up a workspace required a custom devfile at the root of the repository. For example, a .devfile.yaml file. A typical devfile looked like this:

typical default devfile

GitLab default devfile

Starting in GitLab 17.9, a GitLab default devfile is available for all projects when creating a workspace. This eliminates the need to manually create a devfile before starting a workspace. Here is the content of the default devfile:

GitLab default devfile content

When creating a workspace with the GitLab UI, the option Use GitLab default devfile is always available – regardless of whether custom devfiles exist in the repository. Simply select this option to start exploring GitLab Workspaces with one less setup step.

Use GitLab default devfile screenshot

Create your own custom devfiles

While the GitLab default devfile provides a quick way to start a workspace, you may want to customize your development environment to better fit your project's needs. By creating a custom devfile, you can tailor your development environment with the exact tools, dependencies, and configurations needed for your workflow.

Consider creating a custom devfile if you need to:

  • Add project-specific dependencies beyond the base development image.
  • Adjust CPU and memory resource limits.
  • Configure multiple containers for additional services like databases.
  • Define custom, project-specific, environment variables.
  • Set up specific port mappings.
  • Integrate specialized development tools like debuggers or language servers.

For more details, see the Workspaces devfile documentation.

Read more

We want to hear from you

Enjoyed reading this blog post or have questions or feedback? Share your thoughts by creating a new topic in the GitLab community forum. Share your feedback

Ready to get started?

See what your team could do with a unified DevSecOps Platform.

Get free trial

Find out which plan works best for your team

Learn about pricing

Learn about what GitLab can do for your team

Talk to an expert