# Account
Source: https://www.gitpod.io/docs/gitpod/account/overview
Gitpod provides secure authentication through trusted identity providers while maintaining your organization's security requirements. With an Account, you can create multiple organizations and switch between these easily.
## Supported Sign-in Methods
We support authentication using the following providers:
* Google
* GitHub
* Custom Single-Sign-on (configurable once you sign-up with the above)
## Account Creation
When signing in for the first time:
* Select either GitHub or Google as your authentication provider, and complete authentication through your selected provider.
* You'll be prompted to create a new organization or join an existing one
* If your email domain matches an organization's allowed domains, you'll see available organizations to join
## Account Deletion
If you no longer want to keep your Gitpod Account, you can delete it, together with all of your data at any time. Navigate to Settings > Profile and confirm your want to delete your account.
# Use Gitpod docs with AI
Source: https://www.gitpod.io/docs/gitpod/ai/use-docs-with-ai
Learn how to use Gitpod documentation with AI tools and language models for better development workflows.
You can use Gitpod documentation with your AI tool of choice, making it easy to search and get answers from our docs right from your editor or other AI tools.
## How it works
Large language models (LLMs) are great at reading markdown because, unlike HTML, there's a lot less noise for them to parse. To make our documentation more accessible to AI, we've provided markdown-accessible versions of our documentation so you can reference it with your own AI tools.
You can access plain-text markdown versions of our docs in a few ways:
* **[Our llms.txt file](#use-our-llm-sitemap)**: This is an emerging standard and acts as a sort of LLM-friendly sitemap. It provides links to our markdown files so your LLM can access markdown versions of our pages without having to download them.
* **[Download individual markdown pages](#download-plain-text-documentation)**: You can download or reference individual pages to add to your own knowledge base or use them as a reference for your LLM.
## Use our LLM sitemap
You can access or download our LLM-friendly documentation files to help your LLM access, and provide answers based on, markdown versions of our documentation.
We provide two versions of our documentation sitemap based on the emerging llms.txt standard:
* **[llms.txt](https://www.gitpod.io/docs/llms.txt)**: A concise version with links to all our documentation pages
* **[llms-full.txt](https://www.gitpod.io/docs/llms-full.txt)**: A comprehensive version with full content of all documentation pages included inline
The llms.txt files are flattened versions of our documentation sitemap based on an emerging standard for LLM-friendly documentation. While it's still an early standard, it can be a handy way to get answers from our docs without having to open a new browser tab or download individual pages.
* [Access our concise llms.txt file](https://www.gitpod.io/docs/llms.txt)
* [Access our comprehensive llms-full.txt file](https://www.gitpod.io/docs/llms-full.txt)
* [Learn more about the proposed llms.txt standard](https://llmstxt.org)
## Download plain text documentation
You can download or copy our documentation as plain text markdown files for use with your LLM of choice—you can even create your own GPTs and tools!
All of our documentation is written in MDX (Markdown with JSX), which is easily parseable by LLMs. You can access the source markdown for any page by adding `.md` to the end of most URLs to get the raw markdown version.
For example, you can check out the markdown for this page at `https://www.gitpod.io/docs/gitpod/ai/use-docs-with-ai.md`.
# Audit Logs
Source: https://www.gitpod.io/docs/gitpod/audit-logs/overview
Audit logs provide a record of all actions taken in a Gitpod organization. Using the audit logs, you can track who performed an operation, on which resource, and when. Gitpod produces audit logs for all operations within an organization.
## Accessing Audit Logs
Audit logs are accessible to users with the **Organization Owner** role. You can retrieve audit logs using the **Gitpod CLI** or the **Gitpod API**.
### Using the CLI
You can view audit logs using the `gitpod` CLI, which is pre-installed on all Gitpod environments.
```bash
gitpod audit-logs [--limit=number_of_entries]
```
For additional options, including filtering and output formatting (JSON or YAML), run:
```bash
gitpod audit-logs --help
```
#### Example Output
```bash
➜ gitpod audit-logs
SUBJECT ID SUBJECT TYPE ACTOR ID ACTOR PRINCIPAL ACTION CREATED AT
01951d94-d6ac-7edf-9021-a044cfd1908f RESOURCE_TYPE_ENVIRONMENT 0193e2f2-d0b5-7d52-87eb-235deadaf625 PRINCIPAL_RUNNER changed update_time, status, phase, last_running_session 2025-02-21T12:10:05Z
0194f5dd-01ca-75f4-a200-74381ed43f86 RESOURCE_TYPE_ENVIRONMENT 0193e2f2-d0b5-7d52-87eb-235deadaf625 PRINCIPAL_RUNNER changed update_time, status, phase, last_running_session 2025-02-21T12:10:03Z
...
```
### Using the API
You can retrieve audit logs programmatically via the Gitpod API. For detailed documentation, refer to the [API Reference](https://www.gitpod.io/docs/api-reference/resources/events/methods/list/).
#### Example Request
```bash
curl https://app.gitpod.io/api/gitpod.v1.EventService/ListAuditLogs \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $GITPOD_API_KEY" \
-d '{}'
```
# Configuring Automations
Source: https://www.gitpod.io/docs/gitpod/configuration/automations/basic-configuration
Explore Gitpod's automation features: Services and Tasks. Learn how to configure long-running services and execute specific tasks to streamline your development workflow. Understand execution options, dependencies, and best practices for efficient environment management.
# Basic configuration
When an environment is created the system loads Automations from the default file: `.gitpod/automations.yaml` relative to your repository root. You can change this location using [Projects](/flex/projects). An `automations.yaml` consists of services and tasks defined at the root level, for example:
```yaml
services: ...
tasks: ...
```
Services and tasks are a map where the key serves as reference for the corresponding item. When looking at task dependencies their use becomes clear.
See [reference](/flex/configuration/automations#reference) for a full example.
## Services in the automations.yaml
Example workflow:
```yaml
services:
database:
name: PostgreSQL
description: The backend database
triggeredBy:
- postEnvironmentStart
commands:
start: 'docker run --rm -t --name database postgres:latest'
redis:
name: Redis
description: Our message bus
triggeredBy:
- postEnvironmentStart
commands:
start: >-
docker run --rm -t --name redis -p 6379:6379
redis/redis-stack-server:latest
backend:
name: Application Backend
description: The application backend
triggeredBy:
- postEnvironmentStart
commands:
start: cd backend && go run main.go
```
## Tasks in the automations.yaml
Example workflow:
```yaml
tasks:
buildAll:
name: Build All
description: builds all code
command: go build .
runUnitTests:
name: Runs unit tests
command: go test -v ./...
validate:
name: Validate
description: Builds and tests the code
triggeredBy:
- postEnvironmentStart
dependsOn:
- buildAll
- runUnitTests
```
## Iterating on Automations
You can iterate on Automations using the [CLI](/flex/cli) which is available by default in every Gitpod environment. The CLI can
* reload the Automations file using:
```sh
gitpod automations update [optional-path-to-automations.yaml]
```
* start a task or service:
```sh
gitpod automations service start ...
gitpod automations task start ...
```
## Using Automations outside of an environment
The CLI commands to interact with an environment’s Automations are also available outside of an environment. The following snippet brings up an environment, adds a task, runs it, waits for the task to complete and brings the environment back down again:
```sh
# gitpod env create will set the environment context to the newly created env
gitpod env create https://github.com/some/repo
# add the task to the environment
cat < When generating tasks and services, keep in mind that their IDs can only contain alphanumeric characters, underscores, and hyphens, and must be between 1 and 128 characters long.
Basic example:
```bash
echo '{"tasks": {"update_deps": {"name": "Update dependencies", "command": "npm update"}}}' | gitpod automations update -
```
## Example uses
* **Exposing Package Scripts**: Create tasks from scripts in a `package.json` file:
```bash
jq -r '.scripts | to_entries[] | {(.key | gsub("[^a-zA-Z0-9_-]"; "_")): {"name": .key, "command": .value}}' package.json |
jq -s 'add | {"tasks": .}' |
gitpod automations update
```
This example uses `gsub` to ensure all task IDs comply with the required format.
* **Dynamic Service Creation**: Create services for components in a specific directory:
Suppose you have a `components` directory which contains a set of Go components. The following command creates services
for each of those components.
```bash
find ./components -type d -maxdepth 1 -mindepth 1 |
jq -R '{(. | gsub("[^a-zA-Z0-9_-]"; "_")): {"name": "Start " + ., "command": "cd " + . + " && go run ."}}' |
jq -s 'add | {"services": .}' |
gitpod automations update -
```
* **Remote Automation Configuration**: Download and apply Automations from a remote source:
```bash
curl https://example.com/gitpod-automations.json | gitpod automations update -
```
> Only ever download Automations from sources you trust; better yet, verify the integrity of the Automations file before applying it.
Make sure that the remote configuration file uses compliant task and service IDs.
## Interacting with Dynamic Automations from Outside an Environment
One of Gitpod's most powerful features is the ability to interact with and control Automations from outside the environment itself. This capability, combined with Gitpod's environment management features, transforms Gitpod into a flexible automation and execution platform. You can orchestrate complex workflows and tasks without needing to be actively connected to an environment.
When interacting with Automations from outside an environment, you can perform the same operations as from within an environment:
* **Execute Tasks**: Start, monitor, and manage automation tasks in remote environments.
* **Control Services**: Start, stop, and manage long-running automation services.
* **Access Logs**: Retrieve and monitor logs from tasks and services running in the environment.
* **Update Automations**: Modify automation configurations for environments on the fly.
These operations can all be performed using the Gitpod CLI from your local machine or integrated into your CI/CD pipelines for even greater automation potential.
### Example Workflow: Create, Execute Automation, and Clean Up
Here's a concrete example of how you might use these capabilities along with Gitpod's environment management to create an environment, run an automation task, and then clean up:
```bash
# 1. Create a new environment (find an environment class using \"gitpod environment list-classes\")
ENV_ID=$(gitpod environment create https://github.com/your-repo/your-project --dont-wait --class-id some-env-class-id)
# 2. Start a specific automation task in the environment
TASK_ID=$(gitpod automations task start build-and-test --environment-id $ENV_ID)
# 3. Wait for the automation task to complete
gitpod automations task logs $TASK_ID --environment-id $ENV_ID
# 4. Check the automation task status
TASK_STATUS=$(gitpod automations task get $TASK_ID --environment-id $ENV_ID -o json | jq -r .status)
# 5. Clean up the environment
if [ "$TASK_STATUS" = "succeeded" ]; then
echo "Automation task completed successfully. Cleaning up environment."
gitpod environment delete $ENV_ID
else
echo "Automation task failed. Environment left running for inspection."
fi
```
This script demonstrates how you can:
1. Create a new environment based on a Git repository.
2. Start a specific automation task (in this case, 'build-and-test') in that environment.
3. Stream the logs of the automation task to monitor its progress.
4. Check the final status of the automation task.
5. Based on the task's outcome, either clean up the environment or leave it running for further investigation.
### Benefits of External Automation Control
1. **CI/CD Integration**: Easily integrate Gitpod Automations into your existing CI/CD pipelines.
2. **Batch Processing**: Set up and run multiple automation tasks across different environments in parallel for large-scale operations.
3. **Automated Testing**: Create ephemeral environments for running automated test suites without manual intervention.
4. **Resource Optimization**: Run Automations in environments only when needed and automatically clean them up after use.
By leveraging these external automation capabilities alongside Gitpod's environment management features, you can create powerful, flexible workflows. This enables you to automate complex development and testing processes with ease, all while maintaining full control from outside the environment.
# Overview
Source: https://www.gitpod.io/docs/gitpod/configuration/automations/overview
Explore Gitpod's automation features: Services and Tasks. Learn how to configure long-running services and execute specific tasks to streamline your development workflow. Understand execution options, dependencies, and best practices for efficient environment management.
Through [Dev Container](/flex/configuration/devcontainer) you specify your environment basics like base image and editor plugins. Automations go beyond Dev Container to provide **a powerful way to define, automate and share common tasks** you perform with your development environment, such as seeding databases or provisioning external infrastructure.
Using Automations you can automate:
* **Setup** - Seed a database, provision infra or authenticate with a cloud account
* **Operations** - Turn your runbooks into one-click self-service actions
* **Editor interfaces** - Start up a server such as Jupyter notebook
* **Enforce policies** - Run security or scanning tools
* **AI workflows** - Configure AI agents or code assistants
See [examples](/flex/configuration/automations/examples) for more.
Automations are defined in configuration YAML files that can live alongside your source code, in another repo, or any location accessible from the development environment.
* [Automations](#automations)
* [The two modes of Automations](#the-two-modes-of-automations)
* [Services](#services)
* [Service Configuration](#service-configuration)
* [Tasks](#tasks)
* [Triggers](#triggers)
* [Available Triggers](#available-triggers)
* [Runners vs. Gitpod Desktop behaviors](#runners-vs-gitpod-desktop-behaviors)
* [Dependencies](#dependencies)
* [Best Practices for Using Triggers](#best-practices-for-using-triggers)
* [Reference](#reference)
## The two modes of Automations
Gitpod supports two primary types of Automations:
1. **[services](#services)** - for long-running processes like starting a server
2. **[tasks](#tasks)** - for performing one-off actions like executing unit tests
```yaml
services:
database:
name: PostgreSQL
commands:
start: docker run postgres
tasks:
run-unit-tests:
name: Runs unit tests
command: go test -v ./...
```
**Caption:** A minimal automation definition.
## Services
Services are **designed for long-running processes**. These are typically components that need to be continuously available throughout your development session.
Common examples include:
* Databases like PostgreSQL
* Caching systems such as Redis
* Your project's backend and frontend servers.
The key characteristic of a service is its persistent nature – it's not expected to terminate on its own but to remain active and ready for interaction as long as your development environment is running.
See [reference](#reference) for a full example.
### Service Configuration
Configuring a service involves defining up to three key commands:
* `start` (required) - The service itself. The process is expected to continue running until stopped. If this command fails (i.e. exits with a non-zero exit code), the service is considered failed.
* `ready` (optional) - Acts as a health check, determining when the service is fully operational and available for use. Gitpod executes this command periodically (once per second) until it exits with a status code of 0, indicating the service is ready. If you don't specify a `ready` command, Gitpod assumes the service is immediately available after the `start` command completes.
* `stop` (optional) - Defines a graceful shutdown procedure for your service. If omitted, Gitpod will send a `SIGTERM` signal to terminate the service when needed.
## Tasks
In contrast to services, **tasks are individual commands designed to perform specific, often one-off actions within your environment**.
Common examples include:
* Compiling code
* Executing test suites
* Populating a database with test data
* Authenticating with cloud services
* Resetting your local environment to a known state.
Tasks are typically short-lived, executing a defined set of operations and then terminating once complete. Tasks consist of a single command to be executed, however their power lies in their ability to be chained and dependent on other components of your environment.
Tasks will exit immediately if a command exits with a non-zero status code, and the task will be marked as failed. This behavior allows for proper error handling in automation pipelines and dependency chains. For example, if a task depends on another task that fails (exits with non-zero status), the dependent task will not be executed.
See [reference](#reference) for a full example.
### Stop a Task
A started task can be stopped prematurely, which will send a `SIGTERM` signal to the task's command (or any chained commands). Once the command has exited, the task will be marked as stopped.
If the command does not exit within 10 seconds, it will be forcefully terminated and the task run will be marked as failed.
## Triggers
Triggers are **the events that initiate the execution of Automations in your Gitpod environment**. This section covers the available triggers and explains their behavior.
### Available Triggers
Gitpod supports three main types of triggers for Automations:
* The `postEnvironmentStart` trigger activates every time the environment is started. This includes both the initial start of the environment and any subsequent restarts. It's particularly useful for operations that need to be performed consistently on every environment start, regardless of the underlying container state. For example, you might use this trigger to set up environment variables or check for updates to critical tools.
* The `postDevcontainerStart` trigger, on the other hand, is activated every time the devcontainer is started. This occurs during the first start of the environment and any subsequent devcontainer restarts, such as after a rebuild. This trigger is ideal for setup tasks that are specific to the devcontainer configuration, like initializing databases or compiling project-specific dependencies.
* The `manual` trigger provides a unique affordance in the user interface, allowing developers to start an action on demand. This trigger is particularly valuable for curating a set of actions that developers frequently perform. By using manual triggers, you can shape and refine the experience others will have in your Gitpod environment. For instance, you might create manual triggers for running tests, generating documentation, or deploying to a staging environment. This approach not only streamlines common tasks but also helps standardize processes across your team.
See [reference](#reference) for a full example.
### Runners vs. Gitpod Desktop behaviors
It's important to note that the behavior of these triggers can vary depending on the Gitpod runner being used. The AWS runner typically uses a suspend/resume model for environment management. When an environment is restarted on EC2, it usually resumes from a suspended state. In this scenario, `postDevcontainerStart` is not called on restart, but `postEnvironmentStart` is still triggered.
Gitpod Desktop takes a different approach. Instead of using suspend/resume, it reboots the entire environment on restart. This causes both `postDevcontainerStart` and `postEnvironmentStart` to run on every environment restart.
This intentional difference in behavior is designed to help recreate state that might be lost due to the lifecycle of individual elements in different environments. For AWS runners, the suspended state preserves most of the environment, so fewer reinitializations are needed. For Gitpod Desktop, the full reboot ensures a clean state each time, which may require more extensive reinitialization.
### Dependencies
Tasks can specify dependencies, allowing you to create sophisticated automation workflows. A task can depend on other tasks, ensuring that these dependencies are executed beforehand. This feature is particularly useful for setting up complex environments where certain operations must occur in a specific order.
It's important to note that task dependencies are re-evaluated and re-executed each time the main task runs. This ensures that your environment is always in the expected state before a task begins, even if it's run multiple times during a development session.
Each task execution is treated as an isolated event. This means that if you modify a task's definition while it's running, those changes won't affect the current execution. This isolation ensures consistency and predictability in your automation workflows.
### Best Practices for Using Triggers
When working with triggers, it's advisable to use `postEnvironmentStart` for tasks that should run on every start, regardless of the runner or whether it's a fresh start or a resume.
Use `postDevcontainerStart` for tasks specifically related to devcontainer setup or for operations that need to run after a full environment reboot. This could involve compiling dependencies or initializing databases.
The `manual` trigger is best used for discretionary tasks that developers might need to perform multiple times during a session, or for complex operations that don't need to run automatically. By thoughtfully implementing manual triggers, you can significantly improve the usability of your Gitpod environment for all team members.
## Reference
Automations are defined as YAML, in a [file](/flex/configuration/automations/basic-configuration) or [directly uploaded to the system](/flex/configuration/automations/generating-automations).
```yaml
# defines automation services (optional)
services:
# serviceReference is an identifier for the service within the environment.
# It is used when referencing the service, e.g. from the CLI.
# It needs to only contain alphanumeric characters, underscores, and hyphens, and must be between 1 and 128 characters long.
serviceReference:
# Name is a required, human readable string.
name: Human readable name
description: Optional description providing more detail
# triggeredBy lists all trigger that start the service. If none are provided the service isn't started automatically.
# See below for a complete list of trigger.
triggeredBy:
- ...
commands:
# start is a mandatory command constitutes the service itself and is expected to continue running until stopped.
# If this command fails (i.e. exits with a non-zero exit code), the service is considered failed.
start: your-service-command
# ready acts as a readiness check, determining when the service is fully operational and available for use.
# Gitpod executes this command periodically (once per second) until it exits with a status code of 0, indicating the service is ready. # If you don't specify a ready command, Gitpod assumes the service is immediately available after the start command completes.
ready: your-service-command --is-running
# This optional command allows you to define a graceful shutdown procedure for your service.
# If omitted, Gitpod will send a SIGTERM signal to terminate the service when needed.
stop: killall your-service-command
# defines automation tasks (optional)
tasks:
taskReference:
# Name is a required, human readable string.
name: Human readable name
description: Optional description providing more detail
# triggeredBy lists all trigger that start the service. If none are provided the service isn't started automatically.
# See below for a complete list of trigger.
triggeredBy:
# postEnvironmentStart activates every time the environment is started, e.g. on first start
- postEnvironmentStart
# postDevcontainerStart activates every time the devcontainer is started, e.g. on first start or devcontainer rebuild
- postDevcontainerStart
# manual trigger provides a unique affordance in the user interface, allowing developers to start an action on demand.
- manual
# dependsOn expresses a dependency on another task which ensures that this other task runs before this one.
dependsOn:
- someOtherTask
# command is the actual task command that gets executed. Gitpod will run this as a shell script, i.e. multiline input is possible
command: |
echo We are in the workspace directory: $PWD
echo Let's go
```
# Getting started
Source: https://www.gitpod.io/docs/gitpod/configuration/devcontainer/getting-started
Explore Gitpod's Dev Container features. Learn about the benefits of using Dev Containers, how to create a devcontainer.json file, and how to use Gitpod's Dev Container support.
{' '}
If you're configuring your Dev Container in **VS Code** also check out the [VS
Code documentation](/flex/editors/vscode). Particularly for extra information
on rebuilding your container, recovery mode and accessing logs.
When you first create a development environment in Gitpod, it looks for a [devcontainer.json](https://containers.dev/implementors/spec/#devcontainerjson) file in your repository. This file acts as a blueprint for setting up a consistent, standardized environment for your project.
If you haven't created a devcontainer.json file yet and start an environment in Gitpod, your environment will automatically have a Dev Container created in the environment. This initial configuration should form a good basis for iterating further.
When refining your environment, you'll need to choose between two main scenarios for your Dev Container:
* **Single Container Setup**: This simplest scenario runs everything you need inside a single container. It's ideal for most projects where one environment can handle your entire development stack—for instance, a Node.js application with all dependencies and tools in one container.
* **Multi-Container Setup with Docker Compose**: For more complex projects involving multiple services—such as a web application with a separate database—Docker Compose allows you to define and orchestrate multiple containers. Each service operates in its own container, yet they function together as a unified environment.
## Starting with a custom Dockerfile
If you’re using a single container and already have a Dockerfile, you can base your Dev Container configuration on it. Here’s how you might set it up:
```json
{
"name": "Node.js Dev Container",
"build": {
"context": "..",
"dockerfile": "../Dockerfile"
},
"customizations": {
"vscode": {
"settings": {},
"extensions": ["dbaeumer.vscode-eslint"]
}
},
"remoteUser": "node"
}
```
* **build:** Builds the container from the Dockerfile in the parent directory.
* **vscode:** Installs the ESLint extension for JavaScript linting in VS Code.
* **remoteUser:** Specifies the user inside the container (set to **node**).
**.gitpod/automations.yaml:** For installing dependencies, use [automations](../automations):
```yaml
tasks:
install-dependencies:
name: Install dependencies
command: npm install
triggeredBy:
- postDevcontainerStart
- manual
```
## Starting with a Docker Compose
In this example, we set up a multi-container environment using Docker Compose. This setup includes two containers: one for the application (service container) and another for the PostgreSQL database.
> Beware that devcontainer's interaction with docker compose can quickly lead to broken environments, due to unforeseen interactions between your devcontainer and Docker services.
**devcontainer.json:** This file defines the development container configuration and ties it to the Docker Compose setup.
```json
{
"name": "Node.js + PostgreSQL Dev Container",
"dockerComposeFile": "../docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"ms-azuretools.vscode-docker"
]
}
},
"remoteUser": "node"
}
```
* **dockerComposeFile:** Points to the Docker Compose file that defines the services.
* **service:** Specifies the main development container (**app**).
* **workspaceFolder:** Defines the working directory inside the container.
* **vscode:** Installs the necessary VS Code extensions.
* **remoteUser:** Specifies the user inside the container (set to node).
**.gitpod/automations.yaml:** For installing dependencies, use [automations](../automations):
```yaml
tasks:
install-dependencies:
name: Install dependencies
command: npm install
triggeredBy:
- postDevcontainerStart
- manual
```
**docker-compose.yml:** This file configures the multi-container setup, defining both the **app** and **db** services.
```yml
version: '3.8'
name: node-postgres-app
services:
app:
build:
context: .
dockerfile: Dockerfile
volumes:
- '..:/workspaces:cached'
command: sleep infinity
network_mode: 'service:db'
db:
image: 'postgres:latest'
restart: unless-stopped
volumes:
- 'postgres-data:/var/lib/postgresql/data'
environment:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
volumes:
postgres-data: null
```
* **name:** Sets the name to ensure containers are properly identified under a specific project name.
* **app service:** This container is used for development. It builds from a Dockerfile and mounts the project directory as a volume. The command is overridden to keep the container alive (**sleep infinity**), and it shares the network stack with the **db** service (**network\_mode: service:db**), which simplifies access to the database.
* **db service:** This container runs PostgreSQL and is configured with environment variables for the user, password, and database name. The database data is persisted using a Docker named volume (**postgres-data**).
## Iterating and Rebuilding
After modifying the devcontainer.json file, you must rebuild your container to apply the changes. You can initiate a rebuild from VS Code using the **Gitpod Flex: Rebuild Container** command. During this process, Gitpod will disconnect your session, then automatically reconnect you once the rebuild is complete.
You can also rebuild your environment from the terminal using the Gitpod CLI. For instance, to trigger a rebuild from your environment, use:
```sh
gitpod environment devcontainer rebuild
```
### Recovery mode
If an errors occur when the devcontainer is started during a rebuild, Gitpod enters **recovery mode**. This allows you to examine environment logs (use the **Gitpod Flex: Show Environment Logs** command in VS Code), adjust the devcontainer.json file to resolve issues, and attempt the rebuild again.
## Environment Isolation Considerations
The Dev Container runs in an isolated Linux VM. Although the VM is part of the environment, the content and structure of the host is not customizable and may change at any time. Relying on the structure or contents of the underlying host impacts the portability and stability of your devcontainer configuration. It's crucial to respect this isolation to maintain portable and reliable Dev Container configurations:
* Use **initializeCommand** by avoiding adding dependencies to the VM.
* Opt for named volumes instead of bind mounts, as Docker controls them.
* Consider that "**localEnv**" in parameter expansion refers to the host VM, not your local machine, even when you are running locally.
### Host Network Stack
By default, the dev container network is isolated from the VM. However, you can configure the devcontainer to use the host's network stack, which is necessary for [port sharing](/flex/integrations/ports).
* For a single container, add `--network=host` in the `.devcontainer.json` file:
```json
"runArgs": ["--network=host"]
```
* For multiple containers, use `network_mode: host` in the `docker-compose.yml` file:
```yml
network_mode: host
```
## Using Private Container Images
{' '}
Currently, basic authentication (username/password) is supported for most registry types. AWS ECR is also supported only when using AWS EC2 runners.
If your Dev Container configuration uses private container images with basic authentication, you'll need to configure authentication credentials in your project's secrets:
1. Go to your Project Settings > Secrets
2. Create a new Container Registry secret with the appropriate registry URL and credentials. For detailed instructions, see the [Secrets documentation](/flex/secrets#types-of-secrets).
3. The environment will automatically authenticate with the registry using the credentials you provided.
{' '}
If your workflow requires pulling additional private images from within your environment, your Dev Container image should include Docker CLI for most private registries, or Docker CLI. Without these tools, you may see a warning in your environment creation dashboard and won't be able to access the private registry from inside your environment.
For AWS ECR registries, we don't automatically log you into the registry from the environment. You'll need to authenticate as part of your workflows using either [AWS native authentication](https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html) setup or [Gitpod OIDC](/gitpod/configuration/oidc).
## References
* Refer to [containers.dev/implementors/json\_reference/](https://containers.dev/implementors/json_reference/) for the reference documentation of devcontainer.json format. This resource provides detailed information about attributes, lifecycle hooks, and other essential aspects of Dev Containers.
* For a comprehensive list of pre-built development container images that can be used as a starting point for your projects, visit [github.com/devcontainers/images](https://github.com/devcontainers/images). These images are maintained by the Dev Containers project and are designed to work well with VS Code and other Dev Container-compatible tools.
* While Gitpod doesn't allow opening a Dev Container using [the Dev Containers](marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension in VS Code, it leverages its editing experience and customizations. You can find more information about this, as well as generally applicable advice, at [code.visualstudio.com/devcontainers/containers](https://code.visualstudio.com/devcontainers/containers). Be aware that not everything is applicable given the isolated nature of Gitpod environments. For general best practices on working with Dev Containers, visit [containers.dev/guides](https://containers.dev/guides).
# Optimizing your Environment
Source: https://www.gitpod.io/docs/gitpod/configuration/devcontainer/optimizing-startup-times
Learn how to optimize your development environment for Gitpod. Discover tips and best practices for improving the startup time of your environment.
There are several ways to optimize the startup of your environment:
* **Place stable dependencies in the Dockerfile**: For tools that rarely change (e.g., build tools, system dependencies), include them directly in the custom Dockerfile.
* **Use prebuilt Docker images**: Build your image, and push it to a container registry. Reference this image in your devcontainer.json file to avoid rebuilding from scratch each time.
* **Enable dev container image cache**: For AWS runners, the [dev container image cache](/gitpod/runners/aws/devcontainer-image-cache) automatically caches built devcontainer images, significantly reducing startup times for environments with identical configurations.
* **Use [automations](../automations) for dynamic dependencies**: For frequently changing tools and dependencies, such as npm modules, use Automations to handle installations during the environment's startup process.
Gitpod environments may take some time to start initially, but they're quick to stop and restart after setup, and they automatically stop when disconnected. Here's how you can leverage these to speed up your workflows:
* **Reuse environments:** Accelerate recurring tasks by reusing environments. For instance, eliminate the need to repeatedly repopulate databases or download dependencies.
* **Use multiple environments:** Organize your work by maintaining separate environments for different tasks, such as code reviews and feature development for. This enables faster context switching within the same repository.
# Overview
Source: https://www.gitpod.io/docs/gitpod/configuration/devcontainer/overview
Gitpod fully supports [Development Containers](https://containers.dev/), allowing you to standardize development environments across your team. Define your setup in a `devcontainer.json` file to ensure consistent tools, dependencies, and configurations for all developers.
## Benefits
Using Dev Containers with Gitpod provides several advantages:
* **Standardized environments** across all team members
* **Consistent tooling** with precisely defined dependency versions
* **Isolated Linux VM environments**, even when running locally
* **Support for both single and multi-container** development setups
* **Version-controlled configuration** that lives with your codebase
* **Integration with VS Code** and other supported editors
* **Separation** of development environment from local machine configuration
## Configuration
### File Location
Place your `devcontainer.json` file in one of these standard locations:
* `.devcontainer/devcontainer.json`
* `.devcontainer.json`
### Basic Configuration Example
```json
{
"name": "My Project",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "lts"
}
},
"customizations": {
"vscode": {
"extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"],
"settings": {
"editor.formatOnSave": true
}
}
},
"forwardPorts": [3000, 8080]
}
```
This configuration:
* Uses a base Ubuntu image
* Adds Node.js LTS
* Includes ESLint and Prettier VS Code extensions
* Configures auto-formatting on save
* Forwards ports 3000 and 8080
## Multiple Dev Container Configurations
You can manage multiple Dev Container configurations using Gitpod's project feature. This allows you to define different environments for:
* Different branches or repositories
* Various development scenarios
* Specialized tasks requiring specific tools
## Migration from .gitpod.yml
If you're already using a `.gitpod.yml` file, Gitpod provides tools to convert your existing configuration to the Dev Container format. See our [migration guide](/flex/configuration/migrate-from-classic) for step-by-step instructions. Dev Containers offer a more standardized approach that works across multiple platforms and tools.
## Known Limitations
When using Dev Containers with Gitpod, be aware of these limitations:
* Platform-specific features may not work with Gitpod Desktop
* Conflicting features can cause build failures (Gitpod will display an error message)
* Some Dev Container commands might behave differently in Gitpod's environment
* When build errors occur, recovery mode is engaged, requiring manual intervention
## Recommended Images
Microsoft provides well-maintained Dev Container base images for popular development stacks:
* `mcr.microsoft.com/devcontainers/base:ubuntu` - Ubuntu base image
* `mcr.microsoft.com/devcontainers/javascript-node` - Node.js development
* `mcr.microsoft.com/devcontainers/python` - Python development
* `mcr.microsoft.com/devcontainers/dotnet` - .NET development
* `mcr.microsoft.com/devcontainers/java` - Java development
* `mcr.microsoft.com/devcontainers/go` - Go development
## Advanced Configuration
### Multi-Container Development
For more complex setups, you can define multiple containers using Docker Compose:
```json
{
"name": "Multi-container App",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",
"customizations": {
"vscode": {
"extensions": ["ms-azuretools.vscode-docker"]
}
}
}
```
### Adding Custom Features
[Dev Container Features](https://containers.dev/features) are self-contained, shareable units of installation code and configuration that let you quickly add tooling, runtimes, or libraries to your development container.
You can add features to your Dev Container by adding them to the `features` section of your `devcontainer.json` file:
```json
{
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {}
}
}
```
Gitpod works well with many Dev Container Features, especially official ones that are designed with remote development environments in mind. Linux-based runners generally provide best compatibility with most Dev Container Features. Here's what you should know:
* Community-supported features might require additional testing, as they may have been developed without specific consideration for compatibility.
* When using the Gitpod Desktop's Mac runner, some features might not work right away with the Rosetta virtualization layer. [See troubleshooting section](#troubleshooting)
* Feature behavior can vary depending on base images, other installed features, and specific configurations in your setup.
## Troubleshooting
If your Dev Container fails to build:
1. Check the Gitpod console for specific error messages
2. Verify that all specified features are compatible
* ghcr.io/devcontainers/features/docker-in-docker:2
Disabling `moby` can be required to build this features. Alternatively, you can provide Docker CE through the image of your dev container. [Learn more](https://github.com/devcontainers/features/tree/main/src/docker-in-docker#limitations)
* ghcr.io/devcontainers/features/docker-outside-of-docker:1
Disabling `moby` can be required to build this features. Alternatively, you can provide Docker CE through the image of your dev container. [Learn more](https://github.com/devcontainers/features/tree/main/src/docker-outside-of-docker#limitations)
* ghcr.io/devcontainers/features/kubectl-helm-minikube:1
* ghcr.io/devcontainers/features/nix:1
* ghcr.io/devcontainers/features/oryx:1
* ghcr.io/devcontainers/features/terraform:1
* ghcr.io/devcontainers-contrib/features/yamllint:2
The installation fails due to platform mismatch. It's possible to set `platform=linux/arm64` to build this feature, but the recommendation would be to install `yamllint` in you custom container image.
3. Ensure image versions are correctly specified
4. Try rebuilding in recovery mode to debug the issue
## Next Steps
* Explore the full [Dev Container specification](https://containers.dev/implementors/spec/) for advanced configurations
* Check out the [Dev Container Feature catalog](https://containers.dev/features) for additional tools and utilities
* Learn about [Gitpod projects](/flex/projects) to manage multiple environments
# Dotfiles
Source: https://www.gitpod.io/docs/gitpod/configuration/dotfiles/overview
Dotfiles are a way to customize your developer environment according to your personal needs.
Dotfiles are a way to customize your developer environment according to your personal needs. This guide explains how to configure and troubleshoot dotfiles in Gitpod.
## What are dotfiles?
Dotfiles are configuration files that customize your shell, editor, and other applications. They're called "dotfiles" because they typically begin with a dot (`.`) in Unix-like systems. Common examples include `.zshrc`, `.vimrc`, and `.gitconfig`.
## Why use dotfiles with Gitpod?
Gitpod standardizes developer environments to ensure consistency across your team - every colleague gets the same environment configuration when they start a new environment. This is great as it means you have everything you need to start coding on a project. However, because it's shared by all colleagues you might be missing some of the customizations you're used to when working locally on your own machine.
This is where dotfiles come in. They allow you to customize your standardized Gitpod environment according to your personal needs and preferences, making you feel right at home while still maintaining the benefits of a consistent base environment. When you configure dotfiles with Gitpod, your personal customizations are automatically applied every time you start a new environment, regardless of the repository you're working on.
## Setting up your dotfiles repository
To configure Gitpod to use your dotfiles for all your environments:
1. Create a Git repository with your dotfiles. If you're unfamiliar with dotfiles, check out [GitHub's dotfiles guide](https://dotfiles.github.io) or [awesome-dotfiles](https://github.com/webpro/awesome-dotfiles) for inspiration and examples.
2. Navigate to [Settings > Preferences][dotfiles-preferences]
3. Enter the URL of your dotfiles repository
When you start a new environment, Gitpod will:
1. Clone your dotfiles repository to `~/dotfiles`
2. Execute the first of the following files:
* `install.sh` or `install`
* `bootstrap.sh` or `bootstrap`
* `setup.sh` or `setup`
## Best practices for dotfiles in Gitpod
For the best experience with dotfiles in Gitpod:
* Keep your install script lightweight to minimize environment startup time. Smaller repositories and simpler scripts lead to faster environment creation.
* Ensure your install script runs without requiring user interaction, otherwise the environment creation will hang (see troubleshooting section for more details).
* Don't store secrets in your dotfiles repository. Use Gitpod's [secret feature](https://app.gitpod.io/settings/secrets) instead for sensitive information.
* Remember that you're limited to one dotfiles repository per user.
## Managing changes to your dotfiles
When you make changes to your dotfiles repository:
* Changes will be automatically applied when creating new environments
* Existing running environments won't automatically pick up the changes
* To apply changes to an existing environment, you'll need to manually `git pull` and re-run your installation script, e.g. `(cd ~/dotfiles && git pull && ./bootstrap.sh)`
If you're actively iterating on your dotfiles, then the following workflow can be helpful:
* Create a new environment from your dotfiles repository
* Make changes to your files and run your install script to validate the changes
* If you need to reset the environment, e.g. if you're iterating on something that changes the state of the environment such as installing tools, then you can run `gitpod environment devcontainer rebuild` to remove any manual modifications you've made.
## Troubleshooting
### My dotfiles failed to install
Dotfiles are installed during dev container creation. If your dotfiles failed to apply, check the environment logs section "Creating dev container" for any errors or messages that can help you debug the issue.
### Failed to clone
If it failed to clone your dotfiles, you should see an error message like the one below:
```
fatal: repository 'https://github.com/mads-hartmann/gitpod-dotfiles-does-not-exist/' not found
```
Please validate that the repository URL you have configured points to an existing repository.
### Failed to install
If it manged to clone your dotfiles, but failed while running your install script, then you likely won't see much information in the logs. Instead you can try to reproduce the error by manually running the install script
```sh
cd ~/dotfiles
# Replace install.sh with the install script you have in your dotfiles repository
./install.sh
```
If you're seeing failures in some repositories but not other it could be because your dotfiles have system dependencies that are not covered in the dev container configuration of the repository. In that case, you can make your dotfiles self-contained by having them check for the existence of the dependencies and install them if they're missing.
Here's an example where [fzf](https://github.com/junegunn/fzf) is installed only if it doesn't exist already:
```sh
FZF_VERSION="0.60.3"
if ! command -v fzf >/dev/null 2>&1; then
echo "Installing fzf..."
curl -L https://github.com/junegunn/fzf/releases/download/v${FZF_VERSION}/fzf-${FZF_VERSION}-linux_amd64.tar.gz | tar xzvf -
sudo mv fzf /usr/local/bin
echo "fzf installation completed"
else
echo "fzf is already installed"
fi
echo "Configuring fzf..."
echo "source <(fzf --zsh)" >> $HOME/.zshrc
```
### My dotfiles cause the environment to hang during startup
Your install script is executed in a non-interactive shell without a TTY. This means that commands which require user interaction or expect an interactive terminal can cause the dev container creation to hang.
Make sure your install script can run non-interactively without requiring terminal input. You may need to modify commands that assume an interactive terminal is available, like `read` prompts or interactive installers.
The easiest way to resolve this is to:
1. Remove your Dotfiles repository from [Settings > Preferences](https://app.gitpod.io/settings/preferences)
2. Start a fresh environment
3. Manually clone your Dotfiles repository and run your install script to see where it's getting stuck
4. Resolve the issues, commit and push your changes to your Dotfiles repository
5. Re-add your Dotfiles repository URL in [Settings > Preferences](https://app.gitpod.io/settings/preferences)
6. Start a new environment to see if the issue is resolved
## FAQs
### How do I configure the default shell?
You can use the `chsh` command to change the login shell for your user by adding the following to your dotfiles install script. The example below sets the default shell to `zsh` for the active user.
```sh
sudo chsh "$(id -un)" --shell "/usr/bin/zsh"
```
The `chsh` command modifies the user's login shell in `/etc/passwd` which persists across sessions since `/etc/passwd` defines the default shell.
[dotfiles-preferences]: https://app.gitpod.io/settings/preferences
# Migrate from Gitpod Classic to Gitpod
Source: https://www.gitpod.io/docs/gitpod/configuration/migrate-from-classic
Gitpod uses [Dev Containers](/flex/configuration/devcontainer) and [Automations](/flex/configuration/automations) as its core configuration elements. Migration involves converting your `.gitpod.yml` into a `devcontainer.json` and `automations.yml` setup.
## Migrate the configuration
Create a new Gitpod environment for your existing repository and run the migration command:
```sh
gitpod env migrate
```
This command generates two key files:
* `.devcontainer/devcontainer.json`: Defines your development environment by setting the workspace folder, image, user, and other settings, aligned with Gitpod Classic experience.
* `.gitpod/automations.yml`: Contains tasks extracted from `.gitpod.yml`, maintaining their dependency order.
## Test the configuration
1. Deploy the `automations.yml` file using the following command:
```sh
gitpod automations update .gitpod/automations.yml
```
2. Use the following command to rebuild your workspace with the new devcontainer.json:
```sh
gitpod environment devcontainer rebuild
```
3. The default workspace folder in Dev Container differs from Gitpod Classic (`/workspaces` vs `/workspace`). VS Code may not open the correct folder automatically after rebuilding. To fix this:
* Use the "Open File" option in VS Code to select the `/workspace/` folder.
## Customize the configuration
While `gitpod env migrate` creates these baseline files, you need to make manual adjustments to match your requirements.
Note, for instance, that the default Dev Container image differs from the Gitpod Classic workspace image. You'll need to create a custom image for a more optimized environment.
Refer to the following resources to learn more about the configuration options:
* [Dev Containers](/flex/configuration/devcontainer)
* [Automations](/flex/configuration/automations)
# Multi-Repository Environments
Source: https://www.gitpod.io/docs/gitpod/configuration/multi-repository
Learn how to work with multiple repositories in a single Gitpod environment
Gitpod supports working with multiple repositories in a single environment, enabling you to work on projects that span across different repositories. This guide explains how to set up multi-repository environments using either Dev Container configuration or Gitpod Automations.
## Using Dev Container Configuration
The Dev Container `onCreateCommand` allows you to clone additional repositories when your environment starts. This method is particularly useful when you want to maintain the repository setup as part of your Dev Container configuration.
Add an `onCreateCommand` entry to your `.devcontainer/devcontainer.json` file:
```json
{
"name": "One extra repository",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"onCreateCommand": "git clone https://github.com/organization/second-repo.git"
}
```
For multiple repositories:
```json
{
"name": "Multiple repositories",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"onCreateCommand": "git clone https://github.com/organization/second-repo.git && git clone https://github.com/organization/third-repo.git"
}
```
## Using Gitpod Automations
Alternatively, you can use Gitpod's [Automations](/flex/configuration/automations/overview) to clone additional repositories. This approach offers more flexibility and can be combined with other automation tasks.
Add a task to your `automations.yaml` file:
```yaml
tasks:
build:
name: Clone additional repositories
command: |
git clone https://github.com/organization/second-repo.git
git clone https://github.com/organization/third-repo.git
triggeredBy: ['postDevcontainerStart']
```
## Best Practices
When working with multiple repositories, consider the following best practices:
* Use SSH keys or personal access tokens for authentication with private repositories
* Organize repositories in a consistent directory structure
* Configure Git identity globally to ensure consistent commits across repositories
## Troubleshooting
Common issues you might encounter:
* **Authentication failures**: Ensure you have the correct permissions and authentication method
* **Path issues**: Use absolute paths when necessary
* **Repository not found**: Verify repository URLs and access permissions
## Working with Multiple Repositories
Once your environment is set up:
1. Navigate between repositories using the file explorer or terminal
2. Make changes in each repository independently
3. Commit and push changes to each repository separately
Example workflow:
```bash
cd ~/workspace/second-repo
# Make changes
git add .
git commit -m "Update feature X"
git push
cd ~/workspace/third-repo
# Make changes
git add .
git commit -m "Fix bug Y"
git push
```
# OpenID Connect (OIDC)
Source: https://www.gitpod.io/docs/gitpod/configuration/oidc
Guide to using OpenID Connect (OIDC) in Gitpod
You can use OIDC authentication to connect Gitpod environments to cloud providers or third parties such as AWS, Azure, GCP, or secret management services like Vault. OIDC integration eliminates the need to manually distribute access credentials, secrets, and other key material via environment variables or other methods.
## What is OIDC?
OpenID Connect (OIDC) is a simple identity layer on top of the OAuth 2.0 protocol, which allows clients to verify identity.
OIDC leverages a JWT (JSON Web Token) that contains claims about the caller. Claims are statements that can include information such as name, email address, or repository metadata.
OIDC provides a reliable way to establish a user's identity, including authentication and basic profile information. It gives third-party applications a standardized, secure, and scalable method to authenticate and authorize users. When used with Gitpod, it helps automate secure access to third-party services that your environments might need to interact with.
## Setting up OIDC Authentication with a third party
Setting up OIDC Authentication generally involves three main steps:
1. **Establish Trust**: Register Gitpod with your OIDC-supported third party (like AWS, Google, etc.). This third party becomes the audience in your JWT token generated in Gitpod.
2. **Setup Trust Rules**: Configure what the JWT claims must contain to be exchanged for a valid auth token. Here you can implement fine-grained access controls.
3. **Exchange the JWT token**: Once trust and trust rules are established, use the JWT tokens generated by the `gitpod idp token` command to authenticate with the third party.
## Provider specific guides
* [AWS](/flex/integrations/aws)
**Read more:**
* [\[Auth0 docs\] OpenID Connect Protocol](https://auth0.com/authenticate/protocols/openid-connect-protocol)
## Gitpod CLI integration
You can retrieve a JWT token for OIDC using `gitpod idp`. To retrieve the OIDC token for the current environment, run `gitpod idp token`.
For example, to request a new OIDC JWT for example.org, execute:
```bash
$ gitpod idp token --audience example.org
eyJhbGciOiJSUzI1NiIsImtpZCI6ImlkLTE2ODQ3NTc4MDY...
```
To decode the output, use the `--decode` flag:
```bash
$ gitpod idp token --audience example.org --decode
```
Once decoded, the result will resemble this JSON object:
```json
{
"Claims": {
"aud": "example.org",
"exp": 1740517845,
"iat": 1740514245,
"iss": "https://app.gitpod.io",
"org": "0191e223-1c3c-7607-badf-303c98b52d2f",
"sub": "org:0191e223-1c3c-7607-badf-303c98b52d2f/prj:019527e4-75d5-704d-a5a4-a2b52cf56198/env:019527e4-75d5-704d-a5a4-a2b52cf56196"
},
"Header": [
{
"KeyID": "k0",
"JSONWebKey": null,
"Algorithm": "RS256",
"Nonce": "",
"ExtraHeaders": null
}
]
}
```
## Access Control Examples
### Granting access to anyone in the organization
Depending on the Principal using the system, the `sub` claim will have the following format:
* Users: `sub: "org:/user:"`
* Runners: `sub: "org:/rnr:"`
* Environments without a Project: `sub: "org:/env:"`
* Environments from a Project: `sub: "org:/prj:/env:"`
### Granting access to anyone in the organization
You can configure your third-party service to grant access based on the `org:` prefix.
### Granting access to an Environment created from a specific project
You can grant your third-party service access to an environment created from a specific project by matching the `org:/prj:` prefix.
### Grant access to a specific Environment
You can grant your third-party service access to a specific environment by matching the `org:/prj:/env:` prefix.
# Overview
Source: https://www.gitpod.io/docs/gitpod/configuration/overview
Gitpod empowers you to fully automate your development environment, ensuring consistency and efficiency across your team. Through the use of Dev Containers and Automations, you can define, customize, and version-control your entire development setup, giving you reproducible one-click development environments.
* [Dev Container](/gitpod/configuration/devcontainer/overview)
* [Automations](/gitpod/configuration/automations/overview)
* [Dotfiles](/gitpod/configuration/dotfiles/overview)
# Container Registry Secret
Source: https://www.gitpod.io/docs/gitpod/configuration/secrets/container-registry-secret
Container Registry Secrets allow you to use private Docker images as Dev Containers in your environment by providing authentication credentials for private container registries.
These container registry credentials will also be automatically available inside your environment when you include the `docker` CLI in your Dev Container image, allowing you to interact with private registries directly from your environment. If your Dev Container image does not include the `docker` CLI, you will see a warning in your environment creation page.
## When to use Container Registry Secrets
Use Container Registry Secrets when you need to:
* Pull Dev Container images from private registries
* Authenticate with container registries during your development workflow
* Work with private container images in your environment
> Currently, basic authentication (username/password) is supported for most registry types. AWS ECR is also supported through runner-native authentication when using AWS EC2 runners.
## Creating a Container Registry Secret
To create a Container Registry Secret:
1. Navigate to secret managent in your Gitpod dashboard
* **Project > Secrets > New Secret** for Project secrets
* **Settings > Secrets > New Secret** for User secrets
2. Select **Container Registry Basic Auth** from the type dropdown
3. Configure the following fields:
* **Type of secret**: Select **Container Registry Basic Auth** from the dropdown. Once created, the type cannot be changed.
* **Name**: A unique identifier (3-127 characters, only alphanumeric characters, underscores, and hyphens)
* **Registry hostname**: The hostname of your container registry (cannot be changed after creation)
* **Registry username**: Your username for the container registry
* **Registry password**: Your password or access token for the container registry
#### Common Registry Hostnames
* Docker Hub: `https://index.docker.io/v1/` (note the https\:// prefix)
* GitHub Container Registry: `ghcr.io`
* GitLab Container Registry: `registry.gitlab.com`
* Azure Container Registry: `[registry-name].azurecr.io`
* Google Container Registry: `gcr.io`
* AWS ECR: \[account-id].dkr.ecr.\[region].amazonaws.com (with runner-native support on EC2 runners)
## Using AWS ECR with IAM authentication
Gitpod now supports AWS ECR registries with IAM based authentication when using AWS EC2 runners. This means you can access private ECR repositories without manually managing credentials.
### Prerequisites
* You must be using AWS EC2 runners for your Gitpod environments
* Your ECR registry and EC2 runners must be in the same AWS account or have appropriate cross-account access configured
### Setting up ECR Registry Access
* Navigate to Project > Secrets > New Secret in your Gitpod dashboard
* Select Container Registry Basic Auth from the type dropdown
* For the Registry hostname, enter your ECR registry hostname in the format: \[account-id].dkr.ecr.\[region].amazonaws.com
* When you enter an ECR registry hostname, the username and password fields will automatically be filled with runner-native to indicate that native runner authentication will be used
* Click Add
### Configuring IAM Permissions
To enable your EC2 runners to access your ECR repositories, you need to configure the appropriate IAM permissions:
* Locate your runner environment's IAM role from your CloudFormation stack outputs
* Attach appropriate ECR permissions to this role to allow it to pull images from your ECR repositories
* Update the repository policy of your ECR repository to allow access from the runner's IAM role
* Ensure the IAM role's permission boundaries (if configured) include the required ECR permissions
Here's an example policy you can attach to your runner's IAM role:
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ecr:GetAuthorizationToken"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage",
"ecr:BatchCheckLayerAvailability"
],
"Resource": "arn:aws:ecr:[region]:[account-id]:repository/[repository-name]"
}
]
}
```
You'll also need to update the repository policy of your ECR repository to allow the runner's IAM role to access it. Here's an example ECR repository policy:
```
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowGitpodRunnerPull",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::[account-id]:role/[runner-role-name]"
},
"Action": [
"ecr:BatchGetImage",
"ecr:GetDownloadUrlForLayer",
"ecr:BatchCheckLayerAvailability"
]
}
]
}
```
### Limitations
* ECR runner-native registry support is only available for AWS EC2 runners
* Your EC2 runners and ECR registry must have properly configured IAM permissions
* Existing environments must be recreated to apply changes to ECR permissions
## Accessing Container Registry Secrets
Once created, container registry secrets serve two purposes:
1. They authenticate with private registries to pull images for your Dev Container during environment creation.
2. If your Dev Container image includes the `docker` CLI, Gitpod automatically runs `docker login` inside your environment to enable continued access to the registry.
For AWS ECR registries, we don't automatically log you into the registry from the environment. You'll need to authenticate as part of your workflows using either [AWS native authentication](https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html) setup or [Gitpod OIDC](/gitpod/configuration/oidc).
If authentication fails inside your environment, you'll see a warning in your environment creation dashboard. This won't prevent your environment from starting but will limit your ability to pull additional private images from within your environment.
## Updating a Container Registry Secret
You can update the username and password of a Container Registry Secret at any time:
1. Navigate to secret managent in your Gitpod dashboard
* **Project > Secrets** for Project secrets
* **Settings > Secrets** for User secrets
2. Find your Container Registry Secret and click the `Edit` button
3. Update the username and/or password
4. Click `Save`
When you update a Container Registry Secret:
* **New environments** will use the updated credentials
* **Existing running environments** will continue to use the old credentials until they are restarted
* **Registry hostname** cannot be modified after creation
* To apply updates to running environments, you must restart them
## Deleting a Container Registry Secret
To delete a Container Registry Secret:
1. Navigate to secret managent in your Gitpod dashboard
* **Project > Secrets** for Project secrets
* **Settings > Secrets** for User secrets
2. Find your Container Registry Secret and click the `Delete` button
3. Confirm the deletion
After deletion:
* New environments launched from the project will no longer have access to the secret
* Existing environments that already have the secret will retain it until those environments themselves are deleted
* This may cause image pull failures if your environment depends on images from that registry
**Note:** When a project is deleted, all its secrets are automatically deleted as well.
# Environment Variables
Source: https://www.gitpod.io/docs/gitpod/configuration/secrets/environment-variables
Environment variables allow you to store and manage configuration settings that your application needs at runtime. These variables are accessible to your application's processes as standard environment variables, enabling you to:
* Configure your application for different environments (development, staging, production)
* Store configuration settings separate from your code
* Manage API keys and other configuration values
Environment Variable secrets you create in the Gitpod dashboard become accessible as system environment variables in your environment. The name you provide for the secret becomes the environment variable name.
## When to use Environment Variables
**Security Consideration**: For sensitive data (passwords, API tokens, private keys), we strongly recommend using [**files**](/flex/secrets/files) instead of environment variables.
### Comparison: Files vs Environment Variables
| Files | Environment Variables |
| ----------------------------------------------- | ------------------------------------------ |
| Support complex structures (JSON, certificates) | Limited to simple string values |
| Not visible in process listings | Visible via `ps auxe` commands |
| Not included in crash reports or logs | Often dumped in logs and error reports |
| Explicitly used by processes | Automatically inherited by child processes |
Use environment variables for non-sensitive configuration like feature flags, API endpoints, or application modes.
## Creating an Environment Variable Secret
To create an Environment Variable Secret:
1. Navigate to secret managent in your Gitpod dashboard
* **Project > Secrets > New Secret** for Project secrets
* **Settings > Secrets > New Secret** for User secrets
2. Select **Environment Variable** from the type dropdown
3. Configure the following fields:
* **Type of secret**: "Environment Variable" (cannot be changed after creation)
* **Name**: A unique identifier (3-127 characters, only alphanumeric characters, underscores, and hyphens)
* **Value**: The value to be stored (maximum size: 4KB)
## Accessing Environment Variables
Once created, environment variables are automatically available in your Gitpod environment as system environment variables by the name you provided. No special code is required to access them.
## Updating an Environment Variable Secret
You can update the value of an environment variable at any time:
1. Navigate to secret managent in your Gitpod dashboard
* **Project > Secrets** for Project secrets
* **Settings > Secrets** for User secrets
2. Click the `Edit` button
3. Update the value
4. Click `Save`
When you update a secret value:
* **New environments** will receive the updated value
* **Existing running environments** will continue to use the old value until they are restarted
* To apply updates to running environments, you must restart them
## Deleting an Environment Variable Secret
To delete an environment variable:
1. Navigate to secret managent in your Gitpod dashboard
* **Project > Secrets** for Project secrets
* **Settings > Secrets** for User secrets
2. Click the `Delete` button
3. Confirm the deletion
After deletion:
* New environments launched from the project will no longer have access to the secret
* Existing environments that already have the secret will retain it until those environments themselves are deleted
**Note:** When a project is deleted, all its secrets are automatically deleted as well.
# Files
Source: https://www.gitpod.io/docs/gitpod/configuration/secrets/files
File secrets mount sensitive data as actual files in your Gitpod environment at a specified location. These files are automatically created when your environment starts, allowing your applications to read them like any other file on the filesystem.
## When to use File Secrets
File secrets are the recommended choice for:
* **Complex data structures** - JSON configurations, certificates, or other multi-line content
* **Sensitive credentials** - API keys, authentication tokens, and passwords
* **Binary data** - Certificates, keystore files, or other non-text content
* **Configuration that applications expect in file format** - Many applications look for specific configuration files
## Creating a File Secret
To create a File Secret:
1. Navigate to secret managent in your Gitpod dashboard
* **Project > Secrets > New Secret** for Project secrets
* **Settings > Secrets > New Secret** for User secrets
2. Select **File** from the type dropdown
3. Configure the following fields:
* **Type of secret**: "File" (cannot be changed after creation)
* **Name**: A unique identifier (3-127 characters, only alphanumeric characters, underscores, and hyphens)
* **Value**: The content to be stored in the file (maximum size: 4KB)
* **Mount Path**: The filepath where the secret will be mounted in your environment (cannot be changed after creation)
## Accessing File Secrets
Once created, the file secret is automatically mounted at the specified path in your Gitpod environment. Your application can read it like any other file on the filesystem. No special code is required to access the file beyond normal file system operations.
## Updating a File Secret
You can update the content of a file secret at any time, although the mount path cannot be changed once the secret is created.
1. Navigate to the **Project > Secrets** page in your Gitpod dashboard
2. Click the `Edit` button
3. Update the value
4. Click `Save`
When you update a secret value:
* **New environments** will receive the updated file content
* **Existing running environments** will continue to use the old file content until they are restarted
* To apply updates to running environments, you must restart them
* The mount path cannot be changed after creation
## Deleting a File Secret
To delete a file secret:
1. Navigate to the **Project > Secrets** page in your Gitpod dashboard
2. Click the `Delete` button
3. Confirm the deletion
After deletion:
* New environments launched from the project will no longer have access to the secret
* Existing environments that already have the secret will retain it until those environments themselves are deleted
**Note:** When a project is deleted, all its secrets are automatically deleted as well.
# Overview
Source: https://www.gitpod.io/docs/gitpod/configuration/secrets/overview
Learn how to configure secrets in Gitpod
Secrets allow you to securely store and inject sensitive data into your environments. These include API keys, access tokens, credentials, and certificates that your applications need but shouldn't be exposed in your source code.
Secrets are configured at three levels: organization, project, or user. They are automatically made available to any environment launched from that project. This ensures consistent and secure access to sensitive data across your development workflow.
## Secret Precedence
When secrets with the same name exist at different levels, they follow a strict precedence order:
1. **User Secrets** - Highest precedence
2. **Project Secrets** - Middle precedence
3. **Organization Secrets** - Lowest precedence
This means:
* User secrets override both project and organization secrets with the same name and mount
* Project secrets override organization secrets with the same name
* Organization secrets have the lowest priority
Learn more about managing [organization secrets](/flex/organizations/organization-secrets), [project secrets](/flex/projects/project-secrets), or [user secrets](/flex/configuration/secrets/user-secrets).
## Encryption of Secrets
All secrets you create are protected with industry-standard encryption. Secrets can only be retrieved by environments created from your projects (for Project secrets) or your user (for User secrets).
We use `AES256-GCM` to encrypt all secrets at rest in the database, with an additional layer of protection through AWS RDS encryption. This dual-layer approach ensures your sensitive data remains secure both at the application level and infrastructure level. In transit, all secrets are encrypted using TLS.
**Gitpod employees do not have access to the encryption keys and cannot decrypt your secrets.**
## Types of Secrets
Gitpod supports multiple types of secrets to accommodate different needs:
* [Files](/flex/configuration/secrets/files): Securely store and inject entire files into your environment
* [Environment Variables](/flex/configuration/secrets/environment-variables): Key-value pairs injected into your environment's process space
* [Container Registry Secrets](/flex/configuration/secrets/container-registry-secret): Authentication credentials for private container registries
Each type of secret serves a specific purpose in your development workflow. Click the links above to learn more about how to use each type effectively.
# User Secrets
Source: https://www.gitpod.io/docs/gitpod/configuration/secrets/user-secrets
Learn how to configure user secrets in your Gitpod Project
User secrets are a type of secret that are specific to a user. They are used to store sensitive data that is specific to a user, such as API keys, access tokens, and credentials which are shared across all projects and environments of a user.
**User secrets have the highest precedence** in the secrets hierarchy. This means they will override any project or organization secrets with the same name, allowing you to customize your environment without affecting other team members.
To manage your user secrets, navigate to the **Settings > My account > Secrets** page in your Gitpod dashboard.
## Secret Types
User secrets support the following types:
* [Environment Variables](/flex/configuration/secrets/environment-variables)
* [Files](/flex/configuration/secrets/files)
* [Container Registry Secrets](/flex/configuration/secrets/container-registry-secret)
## Creating a User Secret
To create a user secret, navigate to the **Settings > My account > Secrets** page in your Gitpod dashboard and click the **New Secret** button.
## Updating a User Secret
To update a user secret, navigate to the **Settings > My account > Secrets** page in your Gitpod dashboard and click the **Edit** button.
## Deleting a User Secret
To delete a user secret, navigate to the **Settings > My account > Secrets** page in your Gitpod dashboard and click the **Delete** button.
# Cursor
Source: https://www.gitpod.io/docs/gitpod/editors/cursor
[Cursor](https://www.cursor.com/) uses the same extension as VS Code. Most of [VS Code documentation](/flex/editors/vscode) is applicable to Cursor. When reaching out to support, please specify that you are using Cursor as your editor.
## Opening an Environment
You can select Cursor from the editor selector dropdown by clicking on the dropdown arrow next to the editor button on the action bar.
# JetBrains
Source: https://www.gitpod.io/docs/gitpod/editors/jetbrains
Integrate JetBrains IDEs with Gitpod
Gitpod seamlessly integrates with JetBrains IDEs including IntelliJ IDEA Ultimate, GoLand, PhpStorm, PyCharm, RubyMine, WebStorm, Rider, CLion, and RustRover.
This guide will walk you through the setup process and provide tips for managing your development environments.
## Prerequisites
Before starting, ensure that you have:
1. [JetBrains Toolbox](https://www.jetbrains.com/toolbox-app/) installed on your system
> **Tip**: Keep JetBrains Toolbox for the best experience.
## Opening an Environment
1. Start an environment in Gitpod
2. Select your preferred JetBrains IDE (e.g., "Open IntelliJ IDEA Ultimate") from the action bar
### First-time Setup
On your first environment open, the setup process will:
1. Launch JetBrains Toolbox
2. Install the Gitpod plugin when prompted
3. Request authentication with your Gitpod account
### Connection Process
After authentication, Toolbox will:
1. Download and provision the IDE backend
2. Start your local IDE client
3. Connect to your environment automatically
## Limitations
* The version of JetBrains IDEs cannot be changed.
* JetBrains IDE settings and plugins cannot be customized.
## Managing Authentication
To change your Gitpod account or sign out from JetBrains Toolbox:
1. Open JetBrains Toolbox
2. Go to Settings → Providers → Gitpod
3. Click "Sign Out"
4. Click "Sign In" to authenticate with a different account
## Managing Environments
Toolbox list shows only recent environments you've previously opened. Open new environments from Gitpod directly.
## Rebuilding Dev Containers
When rebuilding a devcontainer:
1. Close your current IDE window
2. Wait for rebuild to complete
3. Return to Gitpod
4. Select the IDE in the action bar to reconnect
## Troubleshooting
### Connection Issues
If your IDE doesn't connect:
1. Verify JetBrains Toolbox is running
2. Ensure your environment is running in Gitpod
3. Try closing the IDE and reopening from Gitpod
### Collecting Toolbox Logs
For persistent issues:
1. Open JetBrains Toolbox
2. Navigate to Settings → About
3. Click "Show log files"
4. Locate `toolbox.log`
5. Send to [support@gitpod.io](mailto:support@gitpod.io)
Do **NOT** share logs publicly as they may contain sensitive information
### Collecting IDE Logs
For persistent issues:
1. Open JetBrains Toolbox
2. Navigate to your environment
3. Click on the three dots next to the IDE entry in the installed IDE list
4. Click "Show log files"
5. Send to [support@gitpod.io](mailto:support@gitpod.io)
Do **NOT** share logs publicly as they may contain sensitive information
# Overview
Source: https://www.gitpod.io/docs/gitpod/editors/overview
Learn how to integrate Gitpod with other tools and services. Gitpod works with any editor that uses SSH to connect to a remote backend.
* [VS Code](/flex/editors/vscode)
* [VS Code Browser](/flex/editors/vscode-browser)
* [Cursor](/flex/editors/cursor)
* [JetBrains](/flex/editors/jetbrains)
* [Zed](/flex/editors/zed)
# Visual Studio Code
Source: https://www.gitpod.io/docs/gitpod/editors/vscode
Gitpod seamlessly integrates with VS Code, allowing you to connect to your environments.
This guide will walk you through the setup process and provide tips for managing, troubleshooting, and recovering environments within VS Code.
## Prerequisites
Before starting, ensure that you have the following:
1. [VS Code](https://code.visualstudio.com/download) installed.
2. The [Gitpod Flex](https://marketplace.visualstudio.com/items?itemName=gitpod.gitpod-flex) extension for VS Code installed and enabled.
3. The [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) extension installed and enabled in VS Code.
> **Tip**: Keep your VS Code and extensions updated for the best experience.
## Opening an Environment
### VS Code
1. Start an environment in Gitpod
2. Open in **VS Code**
* While the environment is starting, you can click the **Open in VS Code** button on the action bar. This button is available at any stage—even when the environment is not fully running yet.
* Alternatively, use the **VS Code** icon from the sidebar to launch the environment.
3. VS Code should open or you should see a dialog asking you to open. See **Prerequisites** if you cannot open VS Code.
### VS Code Insiders
You can select **VS Code Insiders** from the editor selector dropdown by clicking on the dropdown arrow next to the editor button on the action bar.
## Install and Sign In
#### 1. Install the Gitpod Flex Extension
After opening, VS Code will prompt you to install the **Gitpod Flex** extension if it's not already installed.
* Click **Allow** when prompted.
> **Note**: The extension will make changes to your local SSH configuration to enable a smooth experience. This allows for seamless connectivity between VS Code and your environments.
#### 2. Install Remote Development Extensions
The integration requires both the **Remote - SSH** extension to function. If this is not already installed, VS Code will notify you to add it.
* Click **Install** to add this dependency.
#### 3. Authenticate with Gitpod
VS Code will then ask you to authenticate with your Gitpod account:
1. Click **Open** when prompted to navigate to the Gitpod authentication page.
2. Follow the authentication process to complete the sign-in.
3. After signing in, you will be redirected back to VS Code and the page can be closed.
> **Note**: If you encounter any issues during the sign-in process, it may be helpful to sign out and try again.
## Workspace Trust
When connecting to a new environment, VS Code may prompt you to trust the workspace. This is a standard security measure for potentially untrusted code. For more information, refer to the [VS Code documentation](https://code.visualstudio.com/editor/workspace-trust).
Gitpod environments always run in isolated VMs, ensuring that code doesn't access secrets outside the environment. The environment remains secure regardless of how you access it. If you're familiar with the repository, you can safely click **Trust Folder & Continue**.
## Managing Your Environment
Once connected, you can manage your environment directly from VS Code:
### Viewing Environment Details
* Check the status, active branch, and logs using the **Environment Details** panel.
* If you closed the panel, re-open it using the `Gitpod Flex: Show Environment Details` command from the Command Palette.
> **Note**: Clicking on **details** while opening the environment will also open the **Environment Details** panel.
### Accessing Commands
* Open the Command Palette (`Cmd+Shift+P` or `Ctrl+Shift+P`) and type `Gitpod Flex` to view commands such as:
* Clicking on the **remote indicator** in the bottom-left corner of the remote window also shows a quick menu of Gitpod commands.
### Rebuild
Rebuilding is necessary to apply changes made to `.devcontainer.json`, `Dockerfile`, or `docker-compose.yml` files to the container. This process ensures that your development environment reflects the latest configuration updates.
To rebuild the container, you have two options:
1. **Command Palette**: Use `Gitpod Flex: Rebuild Container`
2. **Rebuild Prompt**: VS Code detects changes and prompts
While the container is rebuilding, you will be disconnected and automatically reconnected when it's finished. You can inspect the details view to learn about the progress and inspect logs.
## Troubleshooting
### Limitations
Currently there are a couple limitations related to the devcontainer specification:
* Port forwarding does not work for hosts other than `localhost`. For instance, forwarding ports from other services specified in a docker-compose.yml .
* ✅ Workaround: Use `network_mode: host` in your docker-compose.yml for the services you want to port forward.
* `remoteEnv` environment variables values are not applied unless the devcontainer is rebuilt.
### Build Issues
If the initial build or a rebuild fails, you will enter recovery mode.
When a build failure occurs:
1. A modal will appear notifying you of the failure.
2. Pay close attention to the error messages in the details view.
3. Inspect the logs as necessary to understand the root cause of the failure.
4. Make the required changes to the `.devcontainer.json` file to address the issue.
5. Trigger a rebuild using the `Gitpod Flex: Rebuild Container` command.
> **Important**: The recovery mode is not stable for development. Always aim to fix the configuration and successfully rebuild the container.
### Authentication Issues
If you're experiencing authentication issues or need to switch accounts:
1. Use the `Gitpod Flex: Sign Out` command to sign out.
2. Confirm the sign-out when prompted.
3. You can then sign in again with the same or a different account.
### General Issues
If you encounter unexpected problems:
1. Check the `Gitpod Flex` output view for any useful information.
2. Check your network settings, sometimes the VPN or firewall settings can interfere with the connection.
3. When sharing reports with us:
* Use `Developer: Set Log Level...` command to Trace, it would give us more insights. Remember to set it back to Info afterwards.
* In your VS Code settings, set `remote.SSH.logLevel` to `trace`.
* Use the `Gitpod Flex: Export all logs` command from the problematic window. This will contain all relevant logs.
> **Note**: Be cautious when sharing logs on the internet, as they may contain sensitive information.
## Uninstalling
When uninstalling the Gitpod Flex extension, simply removing the extension from VS Code is not sufficient for a complete uninstall. Using the `Uninstall Extension` command ensures that all associated configurations, including SSH settings, are properly cleaned up.
1. Use the `Gitpod Flex: Uninstall Extension` command to initiate the uninstallation process.
2. Follow the prompts to complete the uninstallation process.
If you've already uninstalled the extension without using the command, you can install it again and then use the uninstall command.
# Visual Studio Code Browser
Source: https://www.gitpod.io/docs/gitpod/editors/vscode-browser
You can connect to your environments using VS Code in the browser, providing a zero-install, “ready to code” experience.
This guide will walk you through the setup process and provide tips for managing and troubleshooting within VS Code Browser.
## Opening an Environment
1. Start an environment in Gitpod
2. Open in **VS Code Browser**
* While the environment is starting, you can click the **Open in VS Code Browser** button on the action bar, which is possible even when the environment is not fully running yet. VS Code Browser should open in a new tab.
3. VS Code Browser will then ask you to authenticate with your Gitpod account:
1. Click **Allow** when prompted to sign in to navigate to the Gitpod authentication page.
2. Follow the authentication process to complete the sign-in.
3. After signing in, you will be redirected back to VS Code and the page can be closed.
> **Note**: If you encounter any issues during the sign-in process, it may be helpful to sign out and try again.
## Managing Your Environment
Once connected, you can manage your environment directly from VS Code in the Browser:
### Viewing Environment Details
* Check the status, active branch, and logs using the **Environment Details** panel.
* If you closed the panel, re-open it using the `Gitpod Flex: Show Environment Details` command from the Command Palette.
### Accessing Commands
* Open the Command Palette (`Cmd+Shift+P` or `Ctrl+Shift+P`) and type `Gitpod Flex` to view commands such as:
* Clicking on the **remote indicator** in the bottom-left corner of the window also shows a quick menu of Gitpod commands.
### Rebuild
Rebuilding is necessary to apply changes made to `.devcontainer.json`, `Dockerfile`, or `docker-compose.yml` files to the container. This process ensures that your development environment reflects the latest configuration updates.
To rebuild the container, you have two options:
1. **Command Palette**: Use `Gitpod Flex: Rebuild Container`
2. **Rebuild Prompt**: VS Code detects changes and prompts
While the container is rebuilding, you will be disconnected and automatically reconnected when it's finished. You can inspect the details view to learn about the progress and inspect logs.
### Settings Sync
Enable Settings Sync to sync all your extensions and other preferences from VS Code Desktop in VS Code Browser, read more about over at the [offical Settings Sync documentation](https://code.visualstudio.com/docs/configure/settings-sync#_turning-on-settings-sync).
## Troubleshooting
### Limitations
The following limitations are present in addition to the [limitations listed for VS Code Desktop](/flex/editors/vscode#limitations):
* For environments using a Docker Compose configuration, it's required to set `network_mode: "host"` on the main service in your Docker Compose file for VS Code Browser to successfully connect to the environment.
* VS Code Browser is not supported for [local environments](/gitpod-desktop/overview#local-environments) created using Gitpod Desktop.
### Authentication Issues
If you're experiencing authentication issues or need to switch accounts:
1. Use the `Gitpod Flex: Sign Out` command to sign out.
2. Confirm the sign-out when prompted.
3. You can then sign in again with the same or a different account.
### General Issues
If you encounter unexpected problems:
1. Check the `Gitpod Flex` output view for any useful information.
2. When sharing reports with us:
* Use `Developer: Set Log Level...` command to Trace, it would give us more insights. Remember to set it back to Info afterwards.
* Use the `Gitpod Flex: Export all logs` command from the problematic window. This will contain all relevant logs.
> **Note**: Be cautious when sharing logs on the internet, as they may contain sensitive information.
# Windsurf
Source: https://www.gitpod.io/docs/gitpod/editors/windsurf
[Windsurf](https://windsurf.com/) uses the same extension as VS Code. Most of [VS Code documentation](/flex/editors/vscode) is applicable to Windsurf. When reaching out to support, please specify that you are using Windsurf as your editor.
## Opening an Environment
You can select Windsurf from the editor selector dropdown by clicking on the dropdown arrow next to the editor button on the action bar.
# Zed
Source: https://www.gitpod.io/docs/gitpod/editors/zed
## Connecting an environment to Zed
Gitpod works with any remote and SSH compatible editor, including [Zed](https://zed.dev/download).
### Step 1 - Install the CLI and setup your SSH configuration
The easiest way to setup SSH configuration is by installing the [Gitpod CLI](/flex/integrations/cli).
Once installed, run `gitpod env ssh-config` to update your **local** SSH configuration.
To validate ensure the directory `~/.ssh/gitpod` is created on your local machine.
### Step 2 - Find the host for your environment
You can find the host name on your started environment details page.
The host format is: `.gitpod.environment`
For example: `01922350-2462-79da-8c80-770fe4275aa2.gitpod.environment`
> **Note:** You do not need the `ssh` command when connecting to JetBrains.
### Step 3 - Connect with your environment
In Zed open the remote projects dialogue with `cmd-shift-p remote`. - Add a connection. - Insert the SSH host from above.
See [zed documentation](https://zed.dev/remote-development) for more.
# Archive & Auto-delete
Source: https://www.gitpod.io/docs/gitpod/environments/archive-auto-delete
Automatically manage inactive environments to optimize storage costs
Archive & Auto-delete automatically manages inactive environments through a two-stage lifecycle: archival after 7 days of inactivity, then auto-deletion based on configurable policies.
## How it works
1. **Automatic archiving**: After 7 days of inactivity (fixed)
2. **Configurable auto-deletion**: After 1, 2, or 4 weeks, or never
### Environment lifecycle
```mermaid
graph LR
A[Active] -->|7 days inactive| B[Archived]
B -->|After 1w, 2w, or 4w| C[Auto-deleted]
B -->|Unarchive| A
B -->|Delete| D[Deleted]
```
## Automatic archiving
Environments are archived when stopped for 7 consecutive days (fixed period).
Archived environments:
* Move to a separate archive view
* Can be unarchived or deleted
## Accessing archived environments
Click the **Archive** button in your sidebar to view archived environments. The button shows a badge when environments are archived. Press `Escape` to return to the main view.
## Managing archived environments
### Archive view organization
Environments are grouped by when they were archived:
* **1 week ago**
* **2 weeks ago**
* **1+ month ago**
### Available actions
#### Unarchive an environment
Hover over the environment and click the restore button to unarchive. The environment returns to your main list immediately.
#### Delete an environment
Hover over the environment and click the delete button to delete. Confirm in the dialog.
Deleting an environment permanently removes all content, including code, configurations, and data. This action cannot be undone.
#### Delete all archived environments
Click the **Delete All** button at the bottom and confirm to delete all archived environments.
## Auto-delete configuration
### Setting your preference
Select your auto-delete preference from the dropdown:
* **After 1 week**: 14 days total from last use
* **After 2 weeks**: 21 days total from last use
* **After 4 weeks**: 35 days total from last use
* **Never**
### Organization policies
Organization policies override user preferences when more restrictive. Disabled options in the dropdown indicate policy restrictions.
## Best practices
* **Before archiving**: Commit and push important work
* **Team coordination**: Align deletion timelines with your workflow needs
## Frequently asked questions
**When are environments archived?**
After 7 days of inactivity (fixed period).
**Can I recover deleted environments?**
No, deletion is permanent. Only archived environments can be recovered.
**Why are some auto-delete options disabled?**
Your organization policy may enforce maximum retention periods.
**Do running environments get archived?**
No, only stopped environments are archived.
## Troubleshooting
**Can't change auto-delete preference**: Check for organization policy restrictions.
# Configure a dev environment
Source: https://www.gitpod.io/docs/gitpod/getting-started/configure-dev-environment
With Gitpod, you have a fully configured development environment that starts in a single-click. We achieve this through configuring a Dev Container and Automations. This guide takes you through configuring your first environment.
{' '}
**Pre-requisites**
Install [Gitpod Desktop or the AWS Runner](/flex/getting-started)
before completing this guide.
{/* */}
{/* */}
**Steps**
* [Configure development environment](#configure-development-environment)
* [Create an environment](#create-an-environment)
* [Configure your Dev Container](#configure-your-dev-container)
* [Configuring Automations](#configuring-automations)
* [Publishing your project](#publishing-your-project)
* [What next?](#what-next)
## Create an environment
Start by choosing a repository and environment class to launch your first environment. Once launched we'll then configure the environment and save it as a project. This will mean that you've created a blueprint so your team can also self-serve a one-click experience for their own fully prepared development environment.
## Configure your Dev Container
Let's get started with Dev Container to eliminate the need to manually install tools and dependencies. If you don't have an existing devcontainer in your repository Gitpod will create a basic example file for you in your environment.
A basic Dev Container example stored in `.devcontainer/devcontainer.json`
```json
{
"name": "Node.js Dev Container",
"image": "mcr.microsoft.com/devcontainers/javascript-node:0-18",
"customizations": {
"vscode": {
"settings": {},
"extensions": ["dbaeumer.vscode-eslint"]
}
},
"remoteUser": "node"
}
```
As you make changes you can rebuild your environment by running:
`gitpod environment devcontainer rebuild`.
See [devcontainer](/flex/configuration/devcontainer) for more.
## Configuring Automations
Automations go beyond Dev Container and are a powerful way to define, automate and share common workflows that you perform with your development environment
Automations are defined in configuration YAML files and updated via the Gitpod CLI that comes preinstalled in your environment.
For example:
* Seeding a database
* Running a unit test.
See [automations - examples](/flex/configuration/automations/examples) for many more automation examples.
An example Automations file example stored in `.gitpod/automations.yaml`
```yaml
services:
database:
name: PostgreSQL
commands:
start: docker run postgres
tasks:
run-unit-tests:
name: Runs unit tests
command: go test -v ./...
install-dependencies:
name: Install dependencies
command: npm install
triggeredBy:
- postDevcontainerStart
- manual
```
When you’re done run `gitpod automations update` to register your Automations with Gitpod.
See [automations](/flex/configuration/automations) for more.
## Publishing your project
When done commit both your devcontainer and automation configuration files and hit publish on your project in Gitpod. You’ve now set up a fully-configured project that is your blueprint for a fully-configured development environment and it’s now shared with your team inside your Gitpod organization.
## What next?
Now that you're done, why not take a look at:
{/* */}
* Setting up an [AWS Runnner](/flex/runners/aws) or [Gitpod Desktop]() (if you haven't already)
* Further [optimizing your devcontainer](/flex/configuration/devcontainer/optimizing-startup-times)
* Exploring an [integration](/flex/integrations)
# Gitpod Desktop
Source: https://www.gitpod.io/docs/gitpod/getting-started/create-dev-environment-desktop-app
Run Gitpod environments locally on your Apple silicon Mac with Gitpod Desktop
Gitpod Desktop is the fastest and easiest way to run and recreate cloud development environments locally on your Apple silicon Mac. It provides a seamless development experience with the benefits of local computing resources.
## Benefits of Gitpod Desktop
* **Local Performance:** Harness the full power of your Apple silicon Mac.
* **Cost Efficiency:** Use your local machine resources without incurring additional cloud computing costs.
* **Work Offline:** Continue working in already-running environments even when you lose internet connectivity.
* **Resource Isolation:** Run development environments in isolation from your host system for improved security and dependency management.
* **Easy Setup:** One-click environment setup without complex virtualization configuration.
* **Consistent Experience:** Enjoy the same reliable, reproducible environments whether working locally or in the cloud.
## Prerequisites
* **Operating System**: macOS Sonoma or later
* **CPU**: Apple M1 chip or newer (Apple silicon)
* **RAM**: 16GB or more
* **Architecture**: Apple silicon (ARM-based Macs)
## Download and Install
1. Visit [app.gitpod.io](https://app.gitpod.io/) and look for the download link in the navigation bar
2. Alternatively, download directly from [gitpod.io/gitpod-desktop/download](https://www.gitpod.io/gitpod-desktop/download)
3. Install the application on your Mac
## First-Time Setup
When you first launch Gitpod Desktop, the application will:
1. Verify and configure the macOS runner
2. Set up the file system (this may take several minutes)
3. Display installation progress
4. Prompt you to authenticate with your Gitpod account
5. Guide you through Git authentication setup
## Create Your Environment
Once the setup is complete:
1. In the sidebar, click **Create an environment**
2. Paste a public or private repository URL
3. Click **Create environment**
## Choose Gitpod Desktop
To run your environment locally:
1. When prompted to select an environment class, choose **Gitpod Desktop**
2. Your local Gitpod Desktop application will begin setting up the environment
3. The setup process will pull necessary container images and configure your workspace
## Git Authentication
For accessing repositories (especially private ones), Gitpod Desktop provides several authentication options:
1. **Automatic detection**: The runner checks your local credential manager for existing Git tokens
2. **Manual token entry**: If no token exists, you'll be prompted to provide a Personal Access Token (PAT)
3. **Token management**: Manage your PATs under Settings → Git Authentication
4. **Token refresh**: Authentication tokens are automatically refreshed when environments restart
For self-hosted source control providers, organization administrators must configure them in organization settings first.
## Features and Limitations
### Key Features
* Uses your local machine resources at no additional cloud cost
* Built-in Linux virtualization optimized for Apple Silicon
* One-click setup with full workload isolation
* Limited offline capabilities for already-running environments
* Organization administrators can disable local runners
### Limitations
* No port sharing available (unlike cloud runners)
* Currently only available for Apple silicon Macs
## Troubleshooting
If you encounter issues with Gitpod Desktop:
* **Runner installation failures**: Verify system requirements and macOS version
* **Account switching issues**: Only one runner can be active at a time, tied to a single organization
* **Git authentication problems**: Check your credentials or generate a new PAT
* **Unexpected runner failures**: Restart the application or reset the runner
For persistent issues:
1. Collect logs through Help → Troubleshooting → Collect Logs and Diagnostics
2. Contact support through the support chat
3. If needed, perform a clean uninstall by following the instructions in the support documentation
## Advanced Configuration
* **Organization settings**: Administrators can control local runner usage through Settings → Runners → Gitpod Desktop
* **Repository access**: Administrators can configure repository access to source control providers
* **Git authentication**: Users can configure and manage Git authentication settings
* **Cache management**: Clear shared cache for Docker images and builds as needed
* **Preview builds**: Advanced users can switch between Stable and Insiders (preview) builds
## Next Steps
* Learn about [environment configuration](/flex/configuration) to customize your development setup
* Explore [VS Code extensions](/flex/vscode-extensions) to enhance your development environment
* Check out how to [switch between local and cloud environments](/flex/switching-environments) for different workflows
For additional help, visit the [Gitpod Community](https://community.gitpod.io/) or [contact support](https://www.gitpod.io/contact).
# Self-host Linux runner
Source: https://www.gitpod.io/docs/gitpod/getting-started/create-dev-environment-linux-runner
Run Gitpod environments on your own Linux machine
The Linux runner enables you to run Gitpod environments directly on your own Linux machine. This gives you full control over your infrastructure while enjoying Gitpod's collaborative features.
## Benefits of self-hosting
Self-hosting a Linux runner offers several advantages:
* **Full infrastructure control**: Maintain complete control over your hardware and environment configurations
* **Fixed costs**: Only pay for your own hardware with no usage-based billing
* **Network access**: Direct access to your local network services and resources
* **Resource allocation**: Support for up to 10 concurrent environments on a single runner
* **Security**: Keep your code and development activities within your own infrastructure
* **Customization**: Tailor hardware resources to your specific development needs
## Prerequisites
Before setting up a Linux runner, ensure your system meets these requirements:
* A Linux machine with AMD64/x86\_64 architecture
* Hardware virtualization support (KVM)
* Minimum 2GB RAM per environment you plan to run
* Root/sudo access for initial setup
* Admin access to your Gitpod organization
For detailed system requirements, see the [requirements documentation](/flex/runners/linux/requirements).
## Security considerations
When self-hosting a Linux runner:
* The runner requires root access during installation but runs with reduced privileges
* Environments run in isolated containers but can access the host network
* Consider network isolation if running on shared infrastructure
* Regularly update the runner for security patches
## Limitations
* Maximum of 10 concurrent environments per runner
* No built-in high availability options
## Installation and setup
To set up your Linux runner:
1. [Set up your Linux runner](/flex/runners/linux/setup)
2. [Configure environment classes](/flex/runners/linux/setup#environment-classes)
3. [Set up repository access](/flex/runners/linux/setup#repository-access)
For detailed information about Linux runners, including maintenance and troubleshooting, see the [Linux runners documentation](/flex/runners/linux).
# AWS Runner
Source: https://www.gitpod.io/docs/gitpod/getting-started/create-dev-environment-self-hosted-aws-runner
Deploy a Gitpod runner in your AWS account to create secure, cloud-based development environments for your entire team
Deploy a Gitpod runner in your AWS account to create secure, cloud-based development environments for your entire team. Unlike Gitpod Desktop which is installed per user, an AWS runner is deployed once and can be used by multiple team members.
## Benefits of the AWS Runner
* **Team-wide deployment**: Install once, benefit the entire team
* **Enhanced security**: Development environments run within your own AWS infrastructure
* **Resource efficiency**: Centralized management of compute resources
* **VPC integration**: Securely access internal services and resources within your AWS network
* **Customizable performance**: Configure environment classes to match your development needs
* **Scalability**: Support for multiple team members without individual installations
## Prerequisites
* **Admin role** in your Gitpod organization
* An AWS account with permissions to create CloudFormation stacks
* Basic knowledge of AWS networking concepts (VPC, subnets)
## Steps to set up an AWS runner
### 1. Create a runner configuration
1. Visit [app.gitpod.io](https://app.gitpod.io/)
2. Open your organization settings
3. Click **Runners** in the navigation
4. Click **Setup an AWS runner**
**Note:** A runner is associated with an organization. You can have multiple runners, each restricted to a single AWS region.
### 2. Connect the runner to AWS
1. Ensure you're logged into the correct AWS account
2. Click **Continue on AWS**
> If you don't have direct AWS access, you can copy the runner details from this page and share them with your AWS account administrator.
3. Complete the CloudFormation form with the **required** fields:
* VPC
* Availability zone
* Subnet
If you're unsure which values to use, select the [default networking](https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html) options, which should auto-populate in the form.
4. Click **Create stack**
The CloudFormation stack typically takes about 3 minutes to deploy.
### 3. Configure source control access
1. Return to the runner configuration page where your runner should now show as **Online**
2. Configure repository access by selecting a provider (such as GitHub)
3. Enable OAuth or [Personal Access Token (PAT)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) access
### 4. Configure environment classes (Optional)
You can configure available environment classes for your runner. An environment class defines the performance profile (CPU, memory) for development environments on this runner.
### 5. Create your development environment
1. Click **Create an environment** in the navigation bar
2. Paste a repository URL (public or private)
3. Click **Create environment**
4. Select an environment class from your AWS runner
## Troubleshooting
### Common issues
* **CloudFormation deployment fails**: Ensure you've selected a valid VPC and subnet. The most common error is forgetting to select these required fields.
* **Runner shows as offline**: Check your AWS console to verify the EC2 instances are running correctly.
* **Cannot access private repositories**: Verify your OAuth or PAT configuration has the correct permissions for repository access.
## Next steps
After setting up your AWS runner and creating your first environment:
* Learn more about [projects](/flex/projects/overview)
* See [AWS Runner](/flex/runners/aws) for more detailed information.
# Overview
Source: https://www.gitpod.io/docs/gitpod/getting-started/overview
Learn the different ways to run Gitpod development environments
Gitpod provides flexible options for running your development environments, either locally on your machine or securely in your own cloud infrastructure (VPC) or hardware.
## Deployment Options
Choose the option that best fits your workflow and infrastructure requirements:
| Option | Description | Best for |
| ------------------ | ----------------------------------------------------------- | ---------------------------------------------------------------- |
| **Gitpod Desktop** | Run environments locally with built-in Linux virtualization | Individual developers or teams without cloud infrastructure |
| **AWS Runner** | Run in your own AWS VPC with full control | Teams needing enterprise-grade compute resources and GPU support |
| **Linux Runner** | Run directly on your Linux machine with simple setup | Small teams wanting direct local network access |
## Detailed Comparison
### Gitpod Desktop
* **Infrastructure**: Runs locally on your machine using built-in virtualization
* **Cost**: No additional infrastructure costs
* **Compute Resources**: Limited to your local hardware
* **Collaboration**: Project sharing only available with other Gitpod Desktop users
* [**Get Started with Gitpod Desktop →**](/gitpod/getting-started/create-dev-environment-desktop-app)
### AWS Runner (Bring Your Own Cloud)
* **Infrastructure**: Runs securely in your own AWS VPC
* **Cost**: Pay only for the AWS resources you use (can be covered by AWS free tier)
* **Compute Resources**: Scale up to 896 vCPUs and 12TB RAM with GPU support
* **Collaboration**: Environments can be shared with everyone in your organization
* [**Get Started with AWS Runner →**](/gitpod/getting-started/create-dev-environment-self-hosted-aws-runner)
### Linux Runner (On Your Hardware)
* **Infrastructure**: Runs directly on your Linux machine
* **Cost**: Fixed costs based on your existing hardware
* **Compute Resources**: Support for up to 10 concurrent environments
* **Collaboration**: Direct local network access for your team
* [**Get Started with Linux Runner →**](/gitpod/getting-started/create-dev-environment-linux-runner)
## Next Steps
After selecting your deployment option:
1. [Configure your development environment](/gitpod/getting-started/configure-dev-environment)
2. Set up authentication (via Personal Access Token or OAuth)
3. Configure maintenance and update strategies
# Gitpod Desktop
Source: https://www.gitpod.io/docs/gitpod/gitpod-desktop/overview
Gitpod Desktop is the fastest and easiest way to run and recreate cloud development environments locally. It is currently available for Apple silicon users.
## Benefits
* Run Dev Containers locally, replacing Docker Desktop for local development optimized for Apple Silicon, providing native-like Linux development without the overhead.
* One-click setup, full workload isolation, and the ability to "break it, forget it" - iterate quickly without fear of polluting your system.
* Leverage your local machine's resources for free
* Easily share your configured environments across your team to benefit from the automation and standardization of cloud development environments on your own hardware.
* Through Automations, get an optimized developer experience to launch environments and common development workflows through Gitpod Automations.
* Stay productive with offline capability and built-in disaster recovery support, seamlessly switching between local and cloud development as needed.
## Setup
### Download
1. Download Gitpod Desktop for Apple Silicon [here](https://www.gitpod.io/gitpod-desktop/download)
2. Open `Gitpod.dmg` and drag `Gitpod.app` into the Applications folder
3. Launch Gitpod Desktop from the Applications folder
You can also find it in the Gitpod dashboard at [app.gitpod.io](https://app.gitpod.io).
### Install Runner
When you first launch Gitpod Desktop, it will guide you through a simple setup process:
1. The app will verify and configure the macOS runner (used to run [environments locally](#local-environments))
2. Wait for the installation to complete
* Note: The "Setting up file system" step may take several minutes
* The progress will show you the current status
{' '}
If you have trouble installing, please check the [troubleshooting guide](#runner-installation-failure).{' '}
## Authentication
To use Gitpod Desktop, you'll need to connect it with your Gitpod account:
1. When you first open the app, click **Sign into Gitpod** in the prompt window. This will open your default browser.
2. Sign in using your Gitpod account credentials.
3. Once signed in, you can close the browser window and return to Gitpod Desktop.
4. Gitpod Desktop should open or you should see a dialog asking you to open.
{' '}
If you have trouble signing in, try to [sign out completely and try again](#switching-accounts).{' '}
## Local Environments
Gitpod Desktop automatically starts a macOS runner for the current organization, managing local environments.
### Git Authentication
Local environments require Git access to clone repositories. Here's how authentication works:
1. **Git Credentials:** The runner automatically checks your local credential manager for an existing Git token. If found, it's used immediately. Tokens are automatically refreshed when environments restart to maintain access.
2. **Personal Access Token (PAT):** If no token exists, Gitpod will prompt you to provide a PAT when creating an environment first time. You can manage your PAT under `Settings` -> `Git Authentication`. Click `Authenticate and Create` to proceed.
3. **Connect to Source Control:** Gitpod Desktop will initiate a connection to your source control provider (e.g., GitHub). Follow along the instructions to grant access to your repositories.
4. **Self-Hosted SCM Providers:** If you use a self-hosted source control provider, administrators must configure it in the organization settings. Members can then authenticate using PATs. See [Configuring Repository Access](#configuring-repository-access).
{' '}
If you encounter Git access issues, try to [invalidate Git authentication](#invalidate-git-authentication).{' '}
### Runner Lifecycle
Each macOS runner is tied to a single organization, and only one runner can be active at a time.
Here's how it works:
* **Stopping the Runner:** Stops all associated local environments.
* **Quitting Gitpod Desktop:** Automatically stops the runner.
* **Switching Organizations:** The current organization's runner is stopped. The new organization's runner is started.
* **Restarting Gitpod Desktop:** Starts the runner again.
* **Restarting Environments:** Upon restarting Gitpod Desktop, you can start local environments again.
### Shared Cache
Local environments use a shared cache for Docker images and builds stored on your local machine. This cache speeds up the creation of new environments and the rebuilding of existing ones.
To clear the cache, select "Help" > "Troubleshooting" > "Clear Cache and Restart" from the menu bar.
Clearing the cache can be useful if the caches are corrupted or you want to start fresh.
## Organization Settings
### Disabling Local Environments
Organization administrators can control the use of local runners (Gitpod Desktop) across their organization:
1. Navigate to Settings -> Runners -> Gitpod Desktop in your organization settings
2. Use the toggle to enable or disable local runners for your organization
{' '}
Disabling local runners will immediately stop all running environments on Gitpod
Desktop and prevent members from starting new local environments. Before disabling,
notify organization members as they will lose access to any active work in local
environments.{' '}
### Configuring Repository Access
Administrators can configure repository access to source control providers for local runners:
1. Navigate to Settings -> Runners -> Gitpod Desktop
2. Configure authentication for source control providers:
* `github.com` and `gitlab.com` are configured by default
* For self-hosted SCM providers, administrators must add them here before members can authenticate
* Members can then use **Personal Access Tokens** (PAT) to authenticate with configured providers, if they don't have existing Git credentials on their machine
See [Source Control](/flex/source-control) for more information on configuring source control providers.
## Updating
Gitpod Desktop releases new versions weekly, delivering the latest improvements and features. While the application updates automatically, you can manually check for updates by selecting "Gitpod" > "Check for Updates..." from the menu bar.
After downloading a new version, Gitpod Desktop will prompt you to restart the application to apply the update.
### Checking Your Version
To check your current version, select "Gitpod" > "About Gitpod Desktop" from the menu bar.
Click "Copy" to save the version information to your clipboard, which can be helpful when [seeking support](#report-issue).
### Switching to Insiders
{' '}
Switching to Insiders is an advanced feature that may cause instability or break
your Gitpod Desktop installation. Only proceed if you understand the risks.{' '}
Gitpod Desktop provides nightly builds for testing and feedback purposes. While we recommend using the stable version, accessing Insiders builds can be useful when you want to preview upcoming features before their official release.
To switch to Insiders:
1. Quit Gitpod Desktop
2. Open your terminal and run: `echo "{\"quality\":\"insider\"}" > ~/Library/Gitpod/argv.json`
3. Launch Gitpod Desktop
4. Check for updates to install the latest version
5. Verify the installation by [checking your version](#checking-your-version). You should see "Insider" in the version information.
### Switching to Stable
To return to the stable version from Insiders, follow these steps:
1. Quit Gitpod Desktop
2. Open your terminal and run: `echo "{\"quality\":\"stable\"}" > ~/Library/Gitpod/argv.json`
3. Launch Gitpod Desktop
4. Check for updates to install the latest version
5. Verify the installation by [checking your version](#checking-your-version). You should not see "Insider" in the version information.
To switch back to the stable version, you must wait for a newer stable release to become available, as Gitpod Desktop does not support downgrading to previous versions.
To revert to a previous stable version:
1. [Uninstall](#uninstall) your current version of Gitpod Desktop
2. If experiencing compatibility issues, perform a [clean uninstall](#clean-uninstall)
3. [Setup](#setup) Gitpod Desktop again
## Uninstall
To uninstall Gitpod Desktop, select "Help" > "Troubleshooting" > "Uninstall" from the menu bar.
This action removes both the local runner and the application.
For a complete removal of all Gitpod Desktop data, including local environments and settings, perform a [clean uninstall](#clean-uninstall).
### Clean Uninstall
{' '}
Performing a clean uninstall will remove all Gitpod Desktop data, including your
local environments and settings.{' '}
1. Begin by [resetting Gitpod Desktop data](#reset-data).
2. When Gitpod Desktop restarts, do not proceed with the installation. Instead, [uninstall](#uninstall) the application.
## Troubleshooting
### Report Issue
If you encounter any issues:
1. Ensure you are [up-to-date](#updating).
2. Restart Gitpod Desktop, as some errors may be temporary.
3. If you don't have any sensitive local environments, try to [reset the data](#reset-data). This can sometimes resolve issues.
4. If the issue persists, collect diagnostics using "Help" > "Troubleshooting" > "Collect Logs and Diagnostics". Review them for system-specific problems.
5. Start a support chat with us using the bubble icon in the bottom right corner of the application. If it's not available in Gitpod Desktop, use Gitpod from the browser.
6. Describe what happened, what you did, and what you expected. Upload the logs and diagnostics, and include any relevant screenshots.
{' '}
Be cautious when sharing logs online, as they may contain sensitive information.{' '}
### Reset Data
Resetting data permanently removes all Gitpod Desktop data, including local environments and user settings.
This action is helpful when Gitpod Desktop is not functioning correctly or when you want to start with a clean installation.
To reset data, select "Help" > "Troubleshooting" > "Reset and Restart" from the menu bar.
### Runner Installation Failure
If you encounter installation errors:
1. Check the error message details
2. Make any required system adjustments
3. Restart the installation process
4. If problems continue, [submit an issue report](#report-issue)
### Switching Accounts
To switch to a different Gitpod account, follow these steps:
1. Logout from Gitpod Desktop
2. Logout from your current Gitpod account in your default browser
3. Launch Gitpod Desktop and complete the authentication process with your new account credentials
4. If problems continue, [submit an issue report](#report-issue)
### Invalidate Git Authentication
If you're experiencing Git authentication issues, try these steps:
1. Verify if you are using a Personal Access Token (PAT) for runner authentication in `Settings` > `Git Authentication`.
2. If using PAT, invalidate it by clicking `Remove`. Remember to also revoke the PAT in your source control provider, e.g. GitHub.
3. If not using PAT, verify your Git credentials by attempting to clone the repository on your local machine. Update credentials if authentication fails.
4. Restart your local environment to apply the changes.
### Unexpected Runner Failure
If your runner unexpectedly fails:
1. Check the error message for specific details
2. Restart Gitpod Desktop to attempt automatic recovery
3. If the issue persists, try [resetting the data](#reset-data)
4. If problems continue, [submit an issue report](#report-issue)
# Browser Extension
Source: https://www.gitpod.io/docs/gitpod/integrations/browser-extension
The browser extension adds a Gitpod button to GitHub, GitLab, Bitbucket and Azure DevOps repository interfaces, whether managed or self-hosted to allow you to quickly create environments.
**Caption:** The Gitpod button shown on a GitHub repository, created by the browser
extension
The extension is available for the following browsers:
1. [Chrome](https://chromewebstore.google.com/detail/gitpod/dodmmooeoklaejobgleioelladacbeki) (including Edge, Brave and other Chromium-based browsers)
2. [Firefox](https://addons.mozilla.org/firefox/addon/gitpod/)
## Access the extension settings
You can access the extension settings by clicking on the Gitpod icon in the browser toolbar. In the resulting popup you can find a comprehensive view of all possible customization.
## Enabling the browser extension on self-hosted SCM providers (e.g. GitLab CE/EE and Bitbucket Datacenter)
By default, the browser extension automatically is automatically enabled for the domains of GitHub (`github.com`), GitLab (`gitlab.com`) and Bitbucket (`bitbucket.org`) and Azure DevOps (`dev.azure.com`). If the `run on all sites` option is disabled, all other domains must be configured manually.
To add a custom SCM domain, open the Gitpod extension's context menu. Opening the context menu can be achieved by either right clicking the extension icon in the browser toolbar or revealing it by clicking on a kebab menu \[Chrome] / cog wheel \[Firefox] in the extensions dropdown.
| Chrome | Firefox |
| ------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
|  |  |
## Use a custom Gitpod instance URL
If you are using a custom Gitpod instance (e.g., [Gitpod Enterprise](https://www.gitpod.io/contact/enterprise-self-serve)) you can still use the browser extension by configuring it with your instance URL.
After you've installed the extension, open its options (see chapter [Access the extension settings](#access-the-extension-settings)) and enter your custom Gitpod instance URL. Then, simply click "Save" and approve the browser's request for new permissions.
## Source Code
Gitpod's browser extension is open source, meaning that you can check out its [source code](https://github.com/gitpod-io/browser-extension).
# Gitpod CLI
Source: https://www.gitpod.io/docs/gitpod/integrations/cli
The Gitpod CLI is a powerful tool that allows you to interact with your Gitpod environments and manage your development workflow directly from the terminal. Whether you're starting new environments, managing existing ones, or configuring your workspace, the CLI provides a streamlined interface for all your Gitpod operations.
## Installation
Getting started with the Gitpod CLI is straightforward. You have two options:
### Option 1: Quick Install (UNIX Systems - macOS, Linux)
This one-line installation method works for macOS and Linux systems:
```bash
curl -o gitpod -fsSL "https://releases.gitpod.io/cli/stable/gitpod-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/amd64/;s/\(arm64\|aarch64\)/arm64/')" && \
chmod +x gitpod && \
sudo mv gitpod /usr/local/bin
```
### Option 2: Direct Download
Choose the appropriate version for your system:
* macOS: [x86\_64](https://releases.gitpod.io/cli/stable/gitpod-darwin-amd64) | [arm64](https://releases.gitpod.io/cli/stable/gitpod-darwin-arm64)
* Linux: [x86\_64](https://releases.gitpod.io/cli/stable/gitpod-linux-amd64) | [arm64](https://releases.gitpod.io/cli/stable/gitpod-linux-arm64)
* Windows: [x86\_64](https://releases.gitpod.io/cli/stable/gitpod-windows-amd64.exe) | [arm64](https://releases.gitpod.io/cli/stable/gitpod-windows-arm64.exe)
After downloading, you'll need to:
1. Make the binary executable:
```bash
chmod +x gitpod
```
Move it to your PATH:
```bash
sudo mv gitpod /usr/local/bin
```
{' '}
**Note for macOS users:** When first running a downloaded binary, you may see
a security warning.
You can resolve this by either:
Approving the app in *System Settings* → *Privacy & Security*
Or removing the quarantine attribute via terminal:
```bash
xattr -d com.apple.quarantine gitpod
```
The binary's signature can be verified using:
```bash
codesign -v gitpod -vvv
```
### Verifying Download Integrity
For security, verify the integrity of your downloaded CLI binary using SHA256 checksums from our release manifest:
```bash
# Get the checksums for the current release
curl https://releases.gitpod.io/cli/stable/manifest.json -L
```
#### Verification Steps
1. **Get the expected checksum** for your platform:
```bash
# Extract checksum for your platform (requires jq)
curl -sL https://releases.gitpod.io/cli/stable/manifest.json | jq -r '.downloads[""].digest'
# Examples:
# macOS Intel: .downloads["darwin-amd64"].digest
# macOS Apple Silicon: .downloads["darwin-arm64"].digest
# Linux x86_64: .downloads["linux-amd64"].digest
# Windows x86_64: .downloads["windows-amd64"].digest
```
2. **Calculate your file's checksum**:
```bash
# macOS/Linux
shasum -a 256 gitpod
# Windows PowerShell
Get-FileHash gitpod-windows-amd64.exe -Algorithm SHA256
```
3. **Compare the checksums** - they must match exactly.
**Security Warning:** If the checksums don't match, do not use the binary and re-download from the official source.
#### Without jq
If you don't have `jq` installed, view the full manifest and manually find your platform's digest:
```bash
curl https://releases.gitpod.io/cli/stable/manifest.json -L
```
## Getting started with Gitpod CLI
### Authentication
The Gitpod CLI supports multiple authentication methods:
#### Automated Authentication (in Gitpod Environments)
When using the CLI in a Gitpod environment, it automatically authenticates using the environment's token. Check your authentication status:
```bash
gitpod whoami
```
The output shows your access level:
* `PRINCIPAL_ENVIRONMENT`: Limited access to current environment only
* Your username: Full access to all features and environments
#### Browser-based Authentication
```bash
gitpod login
```
This is the simplest method that will:
* Open your default browser for authentication
* Create a new context for your session
* Store your credentials securely
#### Personal Access Token Authentication
For headless environments or automation scenarios, you can authenticate using a [Personal Access Token](./personal-access-token):
```bash
gitpod login --token
```
You can also provide the token directly:
```bash
gitpod login --token "your-token-here"
```
#### Environment Variables
Set the `GITPOD_TOKEN` environment variable before logging in:
```bash
export GITPOD_TOKEN="your-token-here"
gitpod login
```
### CLI in Gitpod Environments
#### Pre-installed CLI
Every Gitpod environment comes with the CLI pre-installed as `gitpod`. The CLI is automatically authenticated with limited access to the current environment's context, allowing you to:
* Stop the current environment (`gitpod environment stop`)
* View environment logs (`gitpod environment logs`)
* Rebuild the development container (`gitpod devcontainer rebuild`)
#### Upgrading Environment Access
To access additional features like managing other environments or organization resources, you'll need to create a new, fully authenticated context:
1. From within your environment, run:
```bash
gitpod login
```
2. After authentication, the new context will automatically activate, giving you access to:
* All environment management commands
* Organization settings
* Project management
* Automation controls
* Secret management
Remember that this upgraded access persists only for the current environment session. You'll need to re-authenticate if you restart the environment.
### Access Levels and Authentication Scope
Depending on how you're logged in, you may have different access levels. You can always change your authentication method or scope using the `gitpod login` command.
#### Default Environment Access (Pre-authenticated)
* View current environment status
* Basic environment operations
* Local development container management
* Port forwarding
#### Full Authentication Access (After Login)
* Create and manage all environments
* Organization management
* Project creation and configuration
* Secret management
* Automation control
* Runner management
* Cross-environment operations
### Basic Commands
Here are some essential commands to get you started:
```bash
# View your user information
gitpod whoami
# List your environments
gitpod environment list
# Create a new environment
gitpod environment create
# Start an existing environment
gitpod environment start
# Stop an environment
gitpod environment stop
# Delete an environment
gitpod environment delete
```
### Machine-readable Output
For scripting and automation, you can get machine-readable output in JSON or YAML format:
```bash
gitpod environment list -o json
gitpod environment list -o yaml
```
## Core Features
### Environment Management
#### Creating Environments
```bash
gitpod environment create [flags]
# Common flags:
--class-id # Specify environment class
--editor # Choose your preferred editor
--interactive # Use interactive mode
--set-as-context # Set as active context
```
#### Working with Running Environments
```bash
# SSH into an environment
gitpod environment ssh
# View environment logs
gitpod environment logs
# List environment ports
gitpod environment port list
# Open a port
gitpod environment port open
# List available editors
gitpod environment list-editors
# Open with an editor
gitpod environment open --editor
```
### Automation Management
The CLI provides comprehensive automation management capabilities:
```bash
# Initialize new automation
gitpod automations init
# Update automations of an environment
gitpod automations update automations.yaml
# Update the default automation file of an environment
gitpod automations update -s .gitpod/automations.yaml
# List automation tasks
gitpod automations task list
# Start a task
gitpod automations task start
# View task logs
gitpod automations task logs
# List automation services
gitpod automations service list
# Start a task
gitpod automations service start
# View task logs
gitpod automations service logs
```
## Advanced Features
### SSH Configuration
Set up native SSH access to your environments:
```bash
gitpod environment ssh-config
```
After configuration, connect directly using:
```bash
ssh .gitpod.environment
```
### Project Management
```bash
# List projects
gitpod project list
# Get project details
gitpod project get
# Create a new project
gitpod project create
```
### Port Management
```bash
# Open a port with a custom name
gitpod environment port open --name "my-service"
# Close a port
gitpod environment port close
```
### Context Management
```bash
# List available contexts
gitpod config context list
# Switch contexts
gitpod config context use
# Modify context settings
gitpod config context modify
```
### Global Configuration
The CLI configuration file is located at `~/.gitpod/configuration.yaml`. You can modify settings using:
```bash
gitpod config set [flags]
# Common configuration options:
--autoupdate # Enable/disable automatic updates
--release-channel # Set release channel (stable/latest)
--host # Set Gitpod instance host
```
## Best Practices
1. **Context Management**
* Use separate contexts for different projects or organizations
* Name contexts meaningfully for easy identification
2. **Environment Lifecycle**
* Stop unused environments to conserve resources
* Use `--dont-wait` flags for batch operations
* Set appropriate timeouts for long-running operations
3. **Automation**
* Initialize automation files in your project root
* Use descriptive task names
* Monitor task logs for debugging
4. **Security**
* Regularly rotate access tokens
* Use environment-specific SSH keys
* Keep the CLI updated for security patches
## Troubleshooting
Common issues and solutions:
### Authentication Issues
```bash
gitpod login --non-interactive # For environments without browser access
gitpod login --token "" # Use a token directly
gitpod config context modify --token "" # Update token manually
```
### Connection Problems
```bash
gitpod environment logs --include-system-logs --raw # View detailed logs
gitpod environment ssh --verbose # Debug SSH connections
ssh -vvv .gitpod.environment # Debug SSH connections
```
### Too Many SSH Authentication Failures
If you encounter `too many authentication failures` when connecting to a Gitpod environment, it may be due to multiple SSH keys being offered by an agent (e.g., 1Password). The server rejects connections after six failed attempts.
**Solutions:**
1. Stop the SSH agent to prevent other keys from being offered.
2. Ensure only the CLI key is used by adding `IdentitiesOnly yes` to your `~/.ssh/gitpod/config` under the `Host *.gitpod.environment` section.
#### Testing:
Re-enable your SSH agent and test the connection:
```bash
ssh -vvv .gitpod.environment
```
Ensure the correct key (`Offering public key:`) is used.
## Shell Completion
Enable shell completion for easier CLI usage:
```bash
# Bash
gitpod completion bash > /etc/bash_completion.d/gitpod
# Zsh
gitpod completion zsh > "${fpath[1]}/_gitpod"
# Fish
gitpod completion fish > ~/.config/fish/completions/gitpod.fish
# PowerShell
gitpod completion powershell | Out-String | Invoke-Expression
```
## Updates and Maintenance
Keep your CLI up to date:
```bash
# Check version
gitpod version
# Update CLI
gitpod version update
# Force update (even if version is up-to-date)
gitpod version update --force
```
## Additional Resources
* Use `gitpod help` for comprehensive command documentation
* Add `-h` or `--help` to any command for specific usage information
* Use `--verbose` flag for detailed logging when troubleshooting
* Check the configuration file at `~/.gitpod/configuration.yaml` for custom settings
Remember that the CLI is constantly evolving with new features and improvements. Keep your installation updated and refer to the official documentation for the latest information.
# Gitpod URL
Source: https://www.gitpod.io/docs/gitpod/integrations/gitpod-url
You can open a Gitpod environment directly using a URL. The simplest way to start an environment is by using the format:
```
https://app.gitpod.io/#
```
This provides an alternative to creating environments with the [browser extension](/gitpod/integrations/browser-extension).
## URL Structure
The URL consists of the Gitpod instance URL followed by `#` and the full repository URL.
### Examples
* `https://app.gitpod.io/#https://github.com/gitpod-io/empty`
* `https://app.gitpod.io/#https://gitlab.com/gitpod-io/empty`
* `https://app.gitpod.io/#https://bitbucket.org/gitpod-io/empty`
## Choosing a Runner and Environment Class
When you open a repository in Gitpod, you will be prompted to choose a runner and environment class.
To configure a default for the environment class and runner for a repository, create a Project with your preferred configuration. When a project exists on a repository users in your organization are trying to open, it will be selected automatically.
## Next Steps
* Configure your [user settings](/gitpod/account/user-settings) to set default preferences such as your preferred editor
* Learn about [organization policies](/gitpod/organizations/policies) for team-wide configurations such as requiring users to use a project when creating an environment
# Overview
Source: https://www.gitpod.io/docs/gitpod/integrations/overview
Gitpod is designed to integrate with your existing development workflow and tools.
* [Port Sharing](/flex/integrations/ports): Learn how to expose ports from your Gitpod environment to the internet or just to team members, enabling easy access to web servers, databases, and other services running in your workspace.
* [Personal Access Tokens](/flex/integrations/personal-access-token): Discover how to generate and use personal access tokens to securely integrate Gitpod with headless systems and automate workflows.
* [CLI](/flex/integrations/cli): Learn how to use the Gitpod CLI to interact with your environment and manage your development workflow from the terminal.
* [Software Development Kits (SDKs)](/flex/integrations/sdk): Explore Gitpod's SDKs for programmatically interacting with Gitpod services and automating your development workflow.
* [Amazon Web Services (AWS)](/flex/integrations/aws): Discover how to integrate Gitpod with AWS using OpenID Connect (OIDC) for secure access to AWS resources.
# Personal Access Tokens
Source: https://www.gitpod.io/docs/gitpod/integrations/personal-access-token
Personal access tokens (PATs) provide a way to authenticate and authorize programmatic access to Gitpod. You can use PATs as an alternative to using your password for authentication when using the Gitpod CLI or API.
## Creating a PAT
To create a personal access token:
1. Go to [Personal access tokens in the settings](https://app.gitpod.io/projects#/settings/personal-access-tokens)
2. Click "New Token"
3. Enter a description for your token
4. Select an expiration period (30, 60, or 90 days)
5. Click "Create"
6. Copy the generated token immediately. For security reasons, you won't be able to see it again.
## Using a PAT
You can use a personal access token to authenticate with the Gitpod CLI:
```sh
gitpod login --token
```
## Token Permissions
Personal access tokens currently have the same permissions as your user account. They cannot be scoped down to specific actions or resources.
## Managing PATs
You can view and manage your personal access tokens at [https://app.gitpod.io/projects#/settings/personal-access-tokens](https://app.gitpod.io/projects#/settings/personal-access-tokens).
From this page, you can:
* View existing tokens
* Create new tokens
* Remove/Revoke tokens
## Security Considerations
* Treat personal access tokens like passwords. Do not share them or store them in insecure locations.
* Use the shortest expiration period that meets your needs.
* Revoke tokens that are no longer needed.
* Actions performed using a PAT will be logged in the audit logs, referencing the token ID.
## Example Use cases for PATs
### CI/CD Integration
Use a PAT to authenticate your CI/CD pipeline with Gitpod. This allows your automated workflows to create, manage, or interact with Gitpod environments without requiring manual authentication.
Example:
```yaml
name: Gitpod Integration
on: [push]
jobs:
create-environment:
runs-on: ubuntu-latest
steps:
- name: Create Gitpod Environment
env:
GITPOD_TOKEN: ${{ secrets.GITPOD_PAT }}
GITPOD_CLASS: some-class-id
run: |
gitpod login --token $GITPOD_TOKEN
gitpod environment create --class-id $GITPOD_CLASS https://github.com/your-repo
```
### Scripted Environment Management
Write scripts to manage your Gitpod environments programmatically. This is useful for tasks like bulk operations or scheduled maintenance.
Example:
```python
import subprocess
import json
GITPOD_PAT = "your_personal_access_token"
def run_gitpod_command(*args):
result = subprocess.run(
["gitpod"] + list(args),
capture_output=True,
text=True,
check=True
)
return result.stdout.strip()
# Login to Gitpod CLI using PAT
run_gitpod_command("login", "--token", GITPOD_PAT)
# List all environments
environments_json = run_gitpod_command("environment", "list", "-o", "json")
environments = json.loads(environments_json)
# Stop all running environments
for env in environments:
if env['status']['phase'] == 'ENVIRONMENT_PHASE_RUNNING':
print(f"Stopping environment {env['id']}")
run_gitpod_command("environment", "stop", env['id'])
print("All running environments have been stopped.")
```
### Third-Party Tool Integration
Integrate Gitpod with third-party development tools or services that need to access your Gitpod account. The PAT allows these tools to authenticate and perform actions on your behalf using the Gitpod CLI.
Example (using a hypothetical code review tool):
```python
import subprocess
from code_review_tool import CodeReviewClient
# Initialize code review client
cr_client = CodeReviewClient(api_key="code_review_api_key")
# Gitpod PAT
GITPOD_PAT = "your_gitpod_pat"
# When a new code review is created
def on_new_review(review):
# Login to Gitpod CLI using PAT
subprocess.run(["gitpod", "login", "--token", GITPOD_PAT], check=True)
# Create a Gitpod environment for the review
result = subprocess.run(
["gitpod", "environment", "create", review.repo_url, "--dont-wait"],
capture_output=True,
text=True,
check=True
)
# Extract the environment ID from the CLI output
env_id = result.stdout.strip()
# Get the environment details
result = subprocess.run(
["gitpod", "environment", "get", env_id, "-o", "json"],
capture_output=True,
text=True,
check=True
)
import json
env_details = json.loads(result.stdout)
# Add the Gitpod environment URL to the review
cr_client.add_comment(review.id, f"Gitpod environment: {env_details['url']}")
```
# Port sharing
Source: https://www.gitpod.io/docs/gitpod/integrations/ports
Port sharing allows you to expose HTTP ports from your running Gitpod environment to the internet, enabling easy sharing and collaboration. This feature is available for cloud-hosted Gitpod environments not Gitpod Desktop environments.
## How it works
When you share a port, Gitpod creates a public URL with automatic TLS termination. This allows secure access to your application or service running inside the Gitpod environment.
### Limitations
* Only HTTP traffic is supported.
* Not available on Gitpod Desktop environments.
* Subject to Gitpod's fair use policies and bandwidth limits.
### Prerequisites
To ensure port sharing works correctly, services must:
* listen on `0.0.0.0` instead of `localhost` or `127.0.0.1`
* be exposed from the Dev Container on the virtual machine using [the host network stack](/flex/configuration/devcontainer/getting-started#host-network-stack).
For example, if you're running a Node.js server, make sure to bind it to `0.0.0.0` instead of `localhost`.
```javascript
const app = express();
app.listen(3000, '0.0.0.0', () => {
console.log('Server is running on port 3000');
});
```
### Security considerations
While port sharing is convenient, it's important to be mindful of security:
* Only share ports when necessary and unshare them when you're done.
* Be cautious about sharing ports running sensitive services or containing confidential data.
* Remember that shared URLs are public and potentially accessible by anyone with the link.
## Sharing ports
There are two ways to share ports from your Gitpod environment:
### Using the UI
In the Gitpod UI, you'll see a section labeled "Public Ports" that allows you to manage port sharing for your environment.
To share a new port:
1. Click the "Open Port" button in the "Public Ports" section.
2. A dialog will appear titled "Open a public port".
3. Enter a name for the port (optional) and the port number you wish to share.
4. Click "Open Port" to confirm.
For ports that are already open:
They will be listed in the "Public Ports" section. Each open port will show its name (if given) and port number. A green indicator next to the port signifies it's currently active and accessible.
{' '}
**Security notice**: When you open a port, it will be available on the open internet.
Be careful when sharing the URL.
This interface provides an easy way to manage which ports are exposed from your Gitpod environment, allowing you to quickly share access to services or applications you're running.
### Using the CLI
Gitpod provides a set of CLI commands to manage port sharing. These commands allow you to list, open, and close ports directly from your terminal.
#### Listing ports
To view all currently open ports:
```
gitpod environment port list
```
This command will display a list of all ports that are currently open and available for sharing.
#### Opening a Port
To open and share a new port:
```
gitpod environment port open 3000 --name my-app
```
#### Closing a Port
To close a previously opened port:
```
gitpod environment port close
```
For example, to close port 3000:
```
gitpod environment port close 3000
```
#### Examples
1. Open a port for a web server:
```
gitpod environment port open 8080 --name webserver
```
2. Open a port for an API server:
```
gitpod environment port open 4000 --name api
```
3. List all open ports:
```
gitpod environment port list
```
4. Close a port that's no longer needed:
```
gitpod environment port close 4000
```
These CLI commands provide a quick and efficient way to manage port sharing directly from your terminal, especially useful for scripting or when you prefer command-line interactions.
## Use cases
Port sharing enables various scenarios that enhance development workflows and collaboration:
1. Demonstrating work-in-progress: Quickly share your application with teammates or clients without deploying to a staging environment.
2. API testing: Expose your local API server to test integrations with external services or mobile apps.
3. Collaborative debugging: Share a running application with a colleague to troubleshoot issues together in real-time.
4. Design reviews: Make your local development server accessible so designers can review and provide feedback on UI changes.
5. Webhooks development: Test webhook integrations by exposing your local server to receive real-time events from external services.
# Gitpod SDK
Source: https://www.gitpod.io/docs/gitpod/integrations/sdk
The Gitpod SDK provides powerful tools for developers to interact programmatically with Gitpod environments. It allows you to automate environment creation, run tasks, manage automations, and scale infrastructure with Gitpod runners. Available in Python, Node/Typescript, and Go, the SDK gives developers flexibility in their choice of language.
### SDKs Available
* **[Python SDK](https://pypi.org/project/gitpod-sdk/)**: For Python developers interacting with Gitpod environments.
* **[Node/Typescript SDK](https://www.npmjs.com/package/@gitpod/sdk)**: For JavaScript and TypeScript developers.
* **[Go SDK](https://github.com/gitpod-io/gitpod-sdk-go)**: For Go developers integrating with Gitpod.
For detailed API references, consult the [Gitpod API Reference](https://www.gitpod.io/docs/api-reference).
## End-to-End Walkthrough
Watch the video below to see an end-to-end walkthrough of how to use the Gitpod SDK. The steps below are based on the video.
### 1. **Sign Up at Gitpod**
* Go to [app.gitpod.io](https://app.gitpod.io) and sign up for a Gitpod account.
* Once logged in, generate a **Personal Access Token** for SDK authentication under your account settings at [Gitpod Personal Access Tokens](https://app.gitpod.io/settings/personal-access-tokens).
### 2. **Install the SDK**
You need to install the Gitpod SDK for your preferred language. Here’s how to do it for the three SDKs:
* **Python SDK**:
```bash
pip install gitpod-sdk
```
* **Node/Typescript SDK**:
```bash
npm install @gitpod/sdk
```
* **Go SDK**:
```bash
go get github.com/gitpod-io/gitpod-sdk-go
```
### 3. **Authenticate with Gitpod**
Once you’ve installed the SDK, authenticate using your personal access token. You can either set it via the environment variable or explicitly pass it in your code.
* **Option 1**: Set the environment variable `GITPOD_API_KEY`:
```bash
export GITPOD_API_KEY="your_token_here"
```
* **Option 2**: Authenticate directly in your code:
* **For Python SDK**:
```python
from gitpod_sdk import Gitpod
gitpod = Gitpod(bearer_token="your_token_here")
```
* **For Go SDK**:
```go
package main
import (
"github.com/gitpod-io/gitpod-sdk-go"
)
func main() {
gitpod := gitpod.NewGitpod("your_token_here")
}
```
* **For Node/Typescript SDK**:
```typescript
import { Gitpod } from '@gitpod/sdk';
const gitpod = new Gitpod({ bearerToken: 'your_token_here' });
```
### 4. **Run an Example**
Once authenticated, you can start experimenting with the SDK by running one of the examples. Here’s an example of how to create an environment and run a command inside it using the Python SDK:
```python
import asyncio
from gitpod import AsyncGitpod
import gitpod.lib as util
repo_url = "https://github.com/containerd/containerd"
command_to_execute = "go test -v -short ./..."
async def execute_command_in_environment():
client = AsyncGitpod()
machine_class_id = (await util.find_most_used_environment_class(client)).id
create_params = {
"machine": {"class": machine_class_id},
"content": {"initializer": {"specs": [{"context_url": {"url": repo_url}}]}}
}
environment = (await client.environments.create(spec=create_params)).environment
await util.wait_for_environment_running(client, environment.id)
async for line in await util.run_command(client, environment.id, command_to_execute):
print(line)
await client.environments.delete(environment_id=environment.id)
if __name__ == "__main__":
asyncio.run(execute_command_in_environment())
```
This example demonstrates:
* Creating a new environment initialized from a Git repository.
* Running a command inside the environment.
* Deleting the environment once the task is completed.
## Available Examples
Here are the available examples in the SDK repositories, with descriptions of what they demonstrate:
### 1. **Run a Command in an Environment**
* **Description**: Demonstrates how to initialize an environment from a Git repository and run a command inside it.
* **Location**: [Python SDK Example - Run Command](https://github.com/gitpod-io/gitpod-sdk-python/tree/main/examples/run_command.py)
### 2. **Run a Service in an Environment**
* **Description**: Demonstrates how to run a long-lived service (such as a database or message queue) inside a Gitpod environment.
* **Location**: [Python SDK Example - Run Service](https://github.com/gitpod-io/gitpod-sdk-python/tree/main/examples/run_service.py)
### 3. **Access the File System in an Environment**
* **Description**: Shows how to access and interact with the file system inside a Gitpod environment programmatically.
* **Location**: [Python SDK Example - File System Access](https://github.com/gitpod-io/gitpod-sdk-python/tree/main/examples/fs_access.py)
### 4. **Use the Anthropic Tool in a Gitpod Environment**
* **Description**: Demonstrates how to use the Anthropic tool within a Gitpod environment and interact with the **Model Context Protocol (MCP)**.
* **Location**: [Python SDK Example - Anthropic Tool Use](https://github.com/gitpod-io/gitpod-sdk-python/tree/main/examples/anthropic_tool_use.py)
### 5. **MCP Server Example**
* **Description**: Demonstrates the integration of the **Model Context Protocol (MCP)** in a Gitpod environment, used for managing model contexts.
* **Location**: [Go SDK Example - MCP Server](https://github.com/gitpod-io/gitpod-sdk-go/tree/main/examples/mcp-server)
# Automations
Source: https://www.gitpod.io/docs/gitpod/introduction/automations
Automations enable programmable tasks and services that integrate directly into your development environment. They let you create self-service actions for various development workflows:
* **Setup**: Seed databases, provision infrastructure, or authenticate with cloud accounts
* **Operations**: Transform runbooks into one-click self-service actions
* **Editor interfaces**: Start servers such as Jupyter notebooks
* **Policies**: Execute security or scanning tools
* **AI workflows**: Configure AI agents or code assistants
## Configuration
Automations are defined in a YAML file located at `.gitpod/automations.yaml` in your repository. This file can live alongside your source code, in another repository, or any location accessible from the development environment.
Automations are organized into two categories:
* **Services**: Long-running processes that provide functionality to your environment
* **Tasks**: One-off commands that perform specific actions
## Example Configuration
Here's a simple example of an Automations configuration file:
```yaml
services:
database:
name: PostgreSQL
commands:
start: docker run postgres
tasks:
run-unit-tests:
name: Runs unit tests
command: go test -v ./...
```
## Triggering Automations
Automations can be triggered in three ways:
1. **Manually through the UI**: Click on the automation in the Gitpod interface
2. **Via command line**: Execute automations using the CLI
3. **Automatically**: Trigger based on environment lifecycle events (e.g., when a Dev Container starts)
Each automation type has a corresponding UI element in the Gitpod interface, making them easily discoverable and accessible.
## Access Control
Anyone with access to an environment can create and run automations within that environment. Administrators cannot access other users' environments and therefore cannot create or run automations in those environments.
See the [examples](/flex/configuration/automations/examples) section for more detailed use cases and implementation patterns for Automations.
# Development Containers
Source: https://www.gitpod.io/docs/gitpod/introduction/devcontainer
Development Containers (or Dev Containers) allow you to use a container as a full-featured development environment. It can be used to run an application, separate tools, libraries, or runtimes needed for working with a codebase, and to aid in continuous integration and testing. Dev containers can be run locally or remotely, in a private or public cloud, in a variety of supporting tools and editors.
# Development Containers
{' '}
"A Development Container (or Dev Container for short) allows you to use a container
as a full-featured development environment. It can be used to run an application,
separate tools, libraries, or runtimes needed for working with a codebase, and
to aid in continuous integration and testing. Dev containers can be run locally
or remotely, in a private or public cloud, in a variety of supporting tools and
editors." - [containers.dev](https://containers.dev/)
Gitpod offers seamless support for [Dev Containers](https://containers.dev/), allowing you to standardize and automate your development environment across teams and projects. By defining your environment in a devcontainer.json file, Gitpod ensures that everyone on your team works with the same configuration, regardless of their local setup.
## Configuration Locations
Gitpod will automatically detect your Dev Container configuration in standard locations:
* `.devcontainer/devcontainer.json`
* `.devcontainer.json`
You can also specify custom paths when configuring Projects through the Gitpod UI.
## Image build caching
Gitpod provides efficient Docker image build caching on a per-project basis to optimize development workflows and reduce build times. This caching mechanism stores built images securely and reuses them across environments, significantly speeding up workspace creation.
### How it works
When you start a new workspace, Gitpod follows an intelligent caching strategy:
1. **Check for cached image**: First looks for a previously built image that matches your devcontainer configuration
2. **Pull from cache**: If found, pulls the cached image instead of rebuilding from scratch
3. **Build and cache**: If no cache exists, builds the image and stores it for future use
4. **Automatic management**: Cached images are automatically managed and cleaned up over time
### Key features
* **Project-Based Caching**: Images are cached per project, ensuring team members benefit from shared builds
* **Security & Isolation**: Each project has its own secure cache, preventing cross-project access
* **Automatic Operation**: Works transparently without requiring any configuration
* **Docker Layer Optimization**: Reuses Docker layers efficiently to minimize storage and transfer time
The caching system is particularly effective for teams working with similar devcontainer configurations, where subsequent workspace launches can be significantly faster by leveraging previously built images.
## Integration with Automations
Building on Dev Containers, Gitpod adds a powerful framework for running [Automations](/flex/introduction/automations) in your development environments. While Dev Containers define your base environment, we recommend using Automations instead of Dev Container lifecycle commands for setup tasks and workflows.
Automations allow you to set up self-service actions like seeding databases, automating testing, managing external infrastructure lifecycle, or launching AI assistants securely within your development environment.
## Example Dev Container
```json
{
"name": "Node.js Dev Container",
"image": "mcr.microsoft.com/devcontainers/javascript-node:18",
"customizations": {
"vscode": {
"extensions": ["dbaeumer.vscode-eslint"]
}
}
}
```
{/* For detailed information about Dev Container configuration options, best practices, migration from Gitpod Classic, and troubleshooting, see our [Dev Containers Guide](/flex/reference/dev-containers). */}
# Editors & IDEs
Source: https://www.gitpod.io/docs/gitpod/introduction/editor
Gitpod development environments are accessible through your preferred editor or CLI. You can connect your favorite code editor to Gitpod environments, allowing you to work in a familiar interface while leveraging Gitpod's cloud infrastructure.
## Connecting Your Editor
Gitpod supports multiple ways to connect your editor to development environments:
* **Direct Launch**: VS Code, VS Code Browser, Cursor, and JetBrains IDEs can be launched directly from the Gitpod user interface. Use the "Open in VS Code" button for VS Code, or buttons like "Open IntelliJ IDEA Ultimate" for JetBrains IDEs.
* **SSH Configuration**: Editors like Zed can connect via SSH. Simply run `gitpod env ssh-config` to set up the SSH configuration for your environment.
Gitpod works with any editor that supports SSH connections to remote backends, giving you flexibility to use your preferred development tools.
## Supported Editors
Gitpod officially supports these editors:
* **VS Code**: Launches directly from the Gitpod interface with required extensions automatically installed
* **VS Code Browser**: Launches directly in the Browser without the need to install additional tools
* **Cursor**: Similar to VS Code with direct integration through the Gitpod interface
* **JetBrains IDEs**: Connect through JetBrains Toolbox
* **Zed**: Connect using SSH configuration
## Prerequisites
Each editor has specific requirements:
* **VS Code/Cursor**: Requires extensions (Gitpod, Remote-SSH, Dev Containers) which are automatically installed when launching from Gitpod
* **JetBrains IDEs**: Requires [JetBrains Toolbox](https://www.jetbrains.com/toolbox-app/) installed
* **SSH-based editors**: Requires running `gitpod env ssh-config` to configure the connection
See [the integrations](/flex/editors) page for detailed setup instructions for each supported editor.
# Overview
Source: https://www.gitpod.io/docs/gitpod/introduction/overview
Looking for **Gitpod Classic** documentation? [Take me there](/classic/user/introduction/overview)
# What is Gitpod?
Gitpod is a **zero-trust platform** that provides automated and standardized development environments **in your own infrastructure**—whether on your local machine, in your cloud account (VPC), or on-prem. It streamlines coding workflows and boosts collaboration by letting teams **spin up secure, preconfigured dev environments** quickly and consistently.
## High-Level Overview
* **Run in Your Cloud or VPC**: Deploy Gitpod in your preferred environment — AWS, on-prem servers, or via a local desktop app.
* **Consistent Environments**: Use Dev Containers to ensure every environment has the same dependencies, tools, and configurations.
* **Automations**: Automate tasks like DB seeding, environment setup, or testing.
* **Zero-Trust Architecture**: Keep code and secrets in your cloud; you control access.
* **Scalable**: Expand across multiple infrastructure footprints or keep it lightweight for smaller teams.
## Key Benefits for CTOs & Engineering Leaders
* **Security & Compliance**
* Gitpod cannot access your source code or credentials, they all remain private and under your control.
* Centralized security policies, single sign-on, and advanced compliance.
* Full audit logs to track environment and user actions.
* **Flexible Cost & Infrastructure**
* Host dev environments where it makes sense—in your private VPC, existing cloud accounts, or local resources.
* Seat-based pricing for predictable budgeting, plus the option to use your own infrastructure investments.
* **Accelerated Onboarding & Collaboration**
* New devs can start coding in minutes—no manual install or environment setup.
* Shared, prebuilt project configurations eliminate "works on my machine" issues.
* Multiple dev environments can run side by side for different tasks.
## Key Benefits for Developers & Engineers
* **Instant, Ready-to-Code Environments**
* Dev Containers handle language runtimes and build tools automatically.
* Automations run tasks (build, test, seed DB) on environment startup.
* **Code From Anywhere**
* Launch an environment on your laptop, or in your VPC with powerful cloud servers.
* Switch seamlessly between local resources and your organization's infrastructure.
* **Reduced Context Switching**
* Keep separate environments for each feature branch or bug fix.
* Easily revert to a clean environment without reinstalling dependencies.
* [Runners](/gitpod/introduction/runners)
* [Dev Container](/gitpod/introduction/devcontainer)
* [Automations](/gitpod/introduction/automations)
* [Zero-trust](/gitpod/introduction/zero-trust)
* [Editor](/gitpod/introduction/editor)
# Runners
Source: https://www.gitpod.io/docs/gitpod/introduction/runners
Runners are flexible orchestrators of remote development environments that operate within your infrastructure. This "bring your own cloud" model provides you with complete control over where your development environments run while Gitpod manages the administration complexity.
## What are Runners?
Runners are responsible for key operational tasks within your infrastructure:
* Environment provisioning and scaling
* Backup management
* Local caching
* Source code management (SCM) integration
* Environment security
While runners operate in your infrastructure, they connect to Gitpod's management plane, which handles user authentication, identity management, and runner coordination. This hybrid approach gives you data control without the operational burden.
## Runner Types
Gitpod offers multiple runner options to fit your infrastructure needs:
1. **AWS Runner**
* Deployed in your AWS account via CloudFormation
* Supports horizontal scaling up to 400 concurrent environments
* Minimal base cost (approximately \$8/month, often covered by AWS free tier)
* Available in any AWS region or availability zone
* Support for GPU-enabled environments
2. **Linux Runner**
* Runs directly on your Linux machine with AMD64/x86\_64 architecture
* Supports up to 10 concurrent environments
* Provides direct local network access
* Requires hardware virtualization support (KVM)
3. **Gitpod Desktop**
* Run Dev Containers locally with built-in Linux virtualization
* No infrastructure costs—everything runs locally
* Currently available for Apple silicon users
## Runner Architecture
Runners work in conjunction with the Gitpod management plane:
* **Management Plane** (hosted by Gitpod): Handles database, SSO, identity management, user management, and runner coordination
* **Runner** (in your infrastructure): Manages environment provisioning, SCM authentication, and SCM context parsing
* **Environments** (created by runners): Provide security boundaries, secrets resolution, and automations execution
## Key Benefits
* **Infrastructure control**: Keep sensitive code and data within your own infrastructure
* **Private networking**: Access internal resources without exposing them to the public internet
* **Geographical flexibility**: Deploy runners close to your team to minimize latency
* **SCM integration**: Connect to private repositories on GitHub, GitLab, Bitbucket, or Azure DevOps
* **Resource optimization**: Use your own cloud resources and leverage committed spend
* **Team sharing**: Runners are shared across developers in your organization
* **Multiple deployment options**: Run as many runners as needed in different regions or availability zones
## Administration
* Runners require admin role in your Gitpod organization to create or modify
* Runners update automatically approximately once per week with no downtime
* Runners can be monitored using Prometheus
* Connection between users and environments is direct, secured with SSH keys
* Each runner can support up to 400 concurrent environments with no limit on total users
Organizations can deploy multiple runners across different regions and even mix runner types to best support global teams, data sovereignty requirements, and specific workloads.
For specific setup instructions, refer to the runner-specific documentation sections:
* [AWS Runner Setup](/flex/runners/aws)
* [Linux Runner Setup](/flex/runners/linux)
* [Gitpod Desktop](/flex/gitpod-desktop)
# Zero-trust environments
Source: https://www.gitpod.io/docs/gitpod/introduction/zero-trust
With Gitpod your source code, secrets, and internal network are isolated within your network perimeter. Gitpod's architecture is deployed in your infrastructure, providing full control over networking setup.
## How zero-trust principles protect your environments
Gitpod's architecture adheres to core zero-trust principles:
* **No implicit trust** — No user, device, or network is automatically trusted, whether inside or outside your architectural perimeter
* **Least privilege access** — Each component only has access to the resources it needs to function
* **Continuous validation** — Every request is authenticated, authorized, and validated before granting or maintaining access
* **Comprehensive identity model** — All actions are tied to specific identities (users, environments, runners, or accounts)
## Architecture that keeps you in control
Gitpod consists of two main components:
* **Management plane** (hosted by Gitpod) — Handles authentication, administrative functions, and policy management
* **Runners** (deployed in your VPC or "bring your own cloud") — Orchestrate development environments while keeping sensitive assets within your network boundaries
{/*