Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/concepts/railpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ services:

| Provider | Railpack Support |
|----------------|:----------------:|
| Playground | |
| Playground | |
| AWS | ✅ |
| DigitalOcean | ❌ |
| GCP | ✅ |
32 changes: 20 additions & 12 deletions docs/tutorials/deploy-to-aws.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,33 @@ description: Defang allows you deploy to your own Amazon Web Services (AWS) acco

This tutorial will show you how to deploy your services to your own AWS account using Defang.

## Pre-requisites
* [A Dockerfile in your project](https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile/)
* [A `compose.yaml` file in your project](https://docs.docker.com/compose/gettingstarted/)
* [A Defang Account](/docs/concepts/authentication)
* [The Defang CLI](/docs/getting-started#install-the-defang-cli)
* [AWS Account Credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-authentication.html)
## Prerequisites

- [The Defang CLI](/docs/getting-started#install-the-defang-cli)
- [A Defang Account](/docs/concepts/authentication)
- [AWS Account Credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-authentication.html)
- [A `compose.yaml` file in your project](https://docs.docker.com/compose/gettingstarted/)
- [A Dockerfile in your project](https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile/) or use [Railpack](../concepts/railpack.md)

:::warning["MCP prerequisite"]
If you would like to deploy using [MCP](https://modelcontextprotocol.io/), you like need to setup the [Defang MCP Server](../concepts/mcp.md) with the IDE of your choice.
:::

## Step 1 - Navigate to your project directory

Head to the folder where your project is located.

```bash
$ cd path/to/your/project
```

## Step 2 - Authenticate Defang to use your AWS Account
## Step 2 - Configure your AWS credentials

There are many ways to authenticate your [AWS account](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-authentication.html).
There are many ways to authenticate with your [AWS account](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-authentication.html).
Once you've done that, Defang will look for your AWS credentials in your shell environment and expect to find one of the following credential sets:
* the `AWS_PROFILE` environment variable
* or, the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_REGION` environment variables

- the `AWS_PROFILE` environment variable, and optionally the `AWS_REGION` environment variable
- or, the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_REGION` environment variables

:::tip
If you have the AWS CLI installed (which is not required in order to use the Defang CLI), you can verify that you've authenticated to AWS by running `aws sts get-caller-identity` and see your account ID.
Expand All @@ -41,10 +49,10 @@ For example:
$ defang compose up --provider=aws
```

## Step 4 - Inspect your deployment
### Step 4 - Inspect your deployment

Defang will provision resources in your AWS account and deploy your services. You can inspect the resources created in your AWS Dashboard.

***
---

For a deeper discussion of the Defang AWS Architecture, including a list of the resources we provision in your account, see our [AWS Provider docs](/docs/providers/aws).
25 changes: 16 additions & 9 deletions docs/tutorials/deploy-to-gcp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,28 @@ description: Defang allows you deploy to your own Google Cloud Platform (GCP) ac

This tutorial will show you how to deploy your services to your own GCP project using Defang.

## Pre-requisites
* [A Dockerfile in your project](https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile/)
* [A `compose.yaml` file in your project](https://docs.docker.com/compose/gettingstarted/)
* [A Defang Account](/docs/concepts/authentication)
* [The Defang CLI](/docs/getting-started#install-the-defang-cli)
* [gcloud CLI](https://cloud.google.com/sdk/docs/install)
* [GCP Account Credentials](https://cloud.google.com/docs/authentication/set-up-adc-local-dev-environment)
## Prerequisites

- [The Defang CLI](/docs/getting-started#install-the-defang-cli)
- [A Defang Account](/docs/concepts/authentication)
- [gcloud CLI](https://cloud.google.com/sdk/docs/install)
- [GCP Application Default Credentials](https://cloud.google.com/docs/authentication/set-up-adc-local-dev-environment)
- [A `compose.yaml` file in your project](https://docs.docker.com/compose/gettingstarted/)
- [A Dockerfile in your project](https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile/) or use [Railpack](../concepts/railpack.md)

:::warning["MCP prerequisite"]
If you would like to deploy using [MCP](https://modelcontextprotocol.io/), you like need to setup the [Defang MCP Server](../concepts/mcp.md) with the IDE of your choice.
:::

## Step 1 - Navigate to your project directory

Head to the folder where your project is located.

```bash
$ cd path/to/your/project
```

## Step 2 - Authenticate Defang to use your GCP Account
## Step 2 - Configure your GCP credentials

After signing in to your GCP account, select an existing project or [create a new project](https://developers.google.com/workspace/guides/create-project). Make sure [billing is enabled](https://cloud.google.com/billing/docs/how-to/modify-project). Then, note down the project ID and set it as environment variable `GCP_PROJECT_ID`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a link to instructions on how to sign in to the GCP account (similar to how we have that for AWS)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well not really because we have a list of pre recs and they have to have all that to be able to use this feature. Unless you think we should point that out specifically here.
https://github.com/DefangLabs/defang-docs/pull/281/files#diff-1eba8d9c0631215162beb78c17860fd9be34a65ec489fa858da41f2bfd21c7e2R10-R16


Expand All @@ -39,6 +46,6 @@ $ defang compose up --provider=gcp

Defang will provision resources in your GCP account and deploy your services. You can inspect the resources created in your [GCP Dashboard](https://console.cloud.google.com/).

***
---

For a deeper discussion of the Defang GCP Architecture, see our [GCP docs](/docs/providers/gcp).
25 changes: 18 additions & 7 deletions docs/tutorials/deploy-to-playground.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,24 @@ description: Deploy to the free Defang Playground.

This tutorial will show you how to deploy your project to the free [Defang Playground](/docs/concepts/defang-playground).

## Pre-requisites
* [A Dockerfile in your project](https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile/)
* [A `compose.yaml` file in your project](https://docs.docker.com/compose/gettingstarted/)
* [A Defang Account](/docs/concepts/authentication)
* [The Defang CLI](/docs/getting-started#install-the-defang-cli)
## Prerequisites

- [The Defang CLI](/docs/getting-started#install-the-defang-cli)
- [A Defang Account](/docs/concepts/authentication)
- [A `compose.yaml` file in your project](https://docs.docker.com/compose/gettingstarted/)
- [A Dockerfile in your project](https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile/) or use [Railpack](../concepts/railpack.md)

## CLI

### Step 1 - Navigate to your project directory

## Step 1 - Navigate to your project directory
Head to the folder where your project is located.

```bash
$ cd path/to/your/project
```

## Step 2 - Deploy
### Step 2 - Deploy

```
$ defang compose up
Expand Down Expand Up @@ -53,6 +58,12 @@ When you do this, you should see something similar to the output below:
* Done.
```

You can also check on your deployment on the on the [Defang portal](#defang-portal) as well.

---

## Defang Portal

Now we can go to [https://portal.defang.dev/service/app](https://portal.defang.dev/service/app) to see our service listed in the Defang portal.

![screenshot of the defang portal](/img/getting-started-portal.png)
103 changes: 103 additions & 0 deletions docs/tutorials/deploying-with-the-defang-mcp-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Deploying with the Defang MCP Server

This tutorial will show you how to deploy your services with the [Defang MCP Server](/docs/concepts/mcp.md).

## Prerequisites

- [The Defang MCP Server](/docs/concepts/mcp.md#installation)
- [A Defang Account](/docs/concepts/authentication)
- [A `compose.yaml` file in your project](https://docs.docker.com/compose/gettingstarted/)

Open your project with an IDE that has the [Defang MCP Server](/docs/concepts/mcp.md) installed.

:::tip
If the Defang MCP server doesn’t start automatically, try starting or restarting it from your IDE settings.
![VS Code](/img/prompts/start-server.png)
:::

## AWS

### Step 1 - Collect your credentials

There are many ways to authenticate with your [AWS account](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-authentication.html).

:::tip
If you have the AWS CLI installed, you can verify that you've authenticated to AWS by running `aws sts get-caller-identity` and see your account ID. (The AWS CLI is not required in order to use Defang with AWS)
:::

### Step 2 - Setup Defang for AWS

Open your chat window and type `/defang.AWS_Setup`, or select the corresponding prompt from your IDE’s options.

![Trigger Prompt](/img/prompts/aws-prompt.png)

The [MCP prompt](https://modelcontextprotocol.io/specification/2025-06-18/server/prompts) accepts two types of credentials:

1. Method 1 - Using an AWS Profile:
The following prompt will have three arguments and only the first argument is required:

- AWS Credential - REQUIRED : The name of the AWS profile you want to use (e.g., "default" or "my-profile"). ![AWS Profile argument](/img/prompts/aws-profile-arg.png)
- AWS_SECRET_ACCESS_KEY - IGNORE : Leave this argument blank and press Enter. ![Ignore AWS Secret Access Key argument](/img/prompts/aws-ignore_secret.png)
- AWS_REGION - OPTIONAL : The AWS region where you want to deploy your services (e.g., "us-west-2"). ![AWS Region argument Optional](/img/prompts/aws-optional-region.png)

2. Method 2 - Using Access Keys:
The following prompt will have three arguments and all three arguments are required:

- AWS Credential - REQUIRED : The AWS Access Key ID (e.g., "AKIAIOSFODNN7EXAMPLE"). ![AWS Access Key ID argument](/img/prompts/aws-access-key-arg.png)
- AWS_SECRET_ACCESS_KEY - REQUIRED : The AWS Secret Access Key. (e.g., "wJalrXUtnFEMI/K7MDENG/bPExampleSecretKey").![AWS Secret Access Key argument](/img/prompts/aws-secret-key-arg.png)
- AWS_REGION - REQUIRED : The AWS region where you want to deploy your services (e.g., "us-west-2"). ![AWS Region argument](/img/prompts/require-aws-region-arg.png)

### Step 3 - Deploy

Once the prompt completes without errors, your chat input will be automatically populated with the deployment command for the IDE to execute.

### Step 4 - Inspect your deployment

You can check the status of your deployment by using the [Defang Services tool](../concepts/mcp#services) or you can inspect the resources created in your AWS Dashboard.

## GCP

### Prerequisites

- [gcloud CLI](https://cloud.google.com/sdk/docs/install)
- [GCP Application Default Credentials](https://cloud.google.com/docs/authentication/set-up-adc-local-dev-environment)

### Step 1 - Collect your credentials

After signing in to your GCP account, select an existing project or [create a new project](https://developers.google.com/workspace/guides/create-project). Make sure [billing is enabled](https://cloud.google.com/billing/docs/how-to/modify-project). Then, note down the project ID for the next step.

### Step 2 - Setup Defang for GCP

In your chat window, type `/defang.GCP_Setup` or select the corresponding prompt from your IDE’s options.

![Trigger Prompt](/img/prompts/gcp-prompt.png)

The [MCP argument](https://modelcontextprotocol.io/specification/2025-06-18/server/prompts) will require your GCP project ID you created in [Step 1](#step-1---collect-your-credentials-1).
![GCP Project ID](/img/prompts/gcp-project-id.png)

### Step 3 - Deploy

Once the prompt completes without errors, your chat input will be automatically populated with the deployment command for the IDE to execute.

### Step 4 - Inspect your deployment

You can check the status of your depolyment by using the [Defang Services tool](../concepts/mcp#services) or you can inspect the resources created in your GCP Dashboard.

## Playground

### Step 1 - Setting your provider

In your chat window, type `/defang.Playground_Setup` or select the corresponding prompt from your IDE’s options.

![Trigger Prompt](/img/prompts/playground-prompt.png)

There are no arguments to this prompt.

### Step 2 - Deploy

Once the prompt completes without errors, your chat input will be automatically populated with the deployment command for the LLM to execute.

### Step 3 - Inspect your deployment

You can check the status of your deployment by using the [Defang Services tool](../concepts/mcp#services) or you can inspect the the project on the [Defang portal](https://portal.defang.io/projects).
![screenshot of the defang portal](/img/getting-started-portal.png)
Binary file added static/img/prompts/aws-access-key-arg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/prompts/aws-ignore_secret.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/prompts/aws-optional-region.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/prompts/aws-profile-arg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/prompts/aws-prompt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/prompts/aws-secret-key-arg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/prompts/gcp-project-id.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/prompts/gcp-prompt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/prompts/playground-prompt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/prompts/require-aws-region-arg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/prompts/start-server.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.