A workspace gets configured through a
.gitpod.yml file written in YAML syntax. Here’s an example:
# The Docker image to run your workspace in. Defaults to gitpod/workspace-full image: <your-workspace-image> # Command to start on workspace startup (optional) tasks: - init: yarn install command: yarn build # Ports to expose on workspace startup (optional) ports: - port: 8000 onOpen: open-preview
There are three ways you can provide this file:
Checked-in Gitpod Config File
The simplest and preferred option is to check in a
.gitpod.yml file into the root of your repository. This way you can
version your workspace configuration together with your code. If, for example, you need to go back to
an old branch that required a different Docker image, it will start with the correct image, since that
bit of configuration is part of your codebase.
Sometimes you can’t check in a
.gitpod.yml file, for instance because you do not have sufficient
access rights. However, you can still provide a
.gitpod.yml file through the central
Inferred Gitpod Config File
If the first two locations do not have a
.gitpod.yml file for your project, Gitpod will compute one by
analyzing your project and using good common defaults.
Generating Your Gitpod Config File
Gitpod comes with a CLI that walks you through the initial creation of a
Open a terminal and type
It will ask you about the different configuration options and generate and open an initial
.gitpod.yml file for you.
You can now edit directly in the file supported by validation, completion and hovers providing information about the various options.