> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goldsky.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy a subgraph

> Deploy a subgraph to Goldsky from source code, via migration, or with instant no-code subgraphs.

<video controls className="w-full aspect-video" src="https://gssupport.s3.us-east-2.amazonaws.com/docs/Subgraph+Deployment+Walkthrough.mp4" />

There are three primary ways to deploy a subgraph on Goldsky:

1. From source code
2. Migrating from The Graph or any other subgraph host
3. Via instant, no-code subgraphs

For any of the above, you'll need to have the Goldsky CLI installed and be logged in; you can do this by following the instructions below.

<Accordion title="Install Goldsky's CLI and log in">
  1. Install the Goldsky CLI:

     **For macOS/Linux:**

     ```shell theme={null}
     curl https://goldsky.com | sh
     ```

     **For Windows:**

     ```shell theme={null}
     npm install -g @goldskycom/cli
     ```

     <Note>Windows users need to have Node.js and npm installed first. Download from [nodejs.org](https://nodejs.org) if not already installed.</Note>
  2. Log into your Project by running:
     ```shell theme={null}
     goldsky login
     ```
     This opens your browser to sign in (Google, GitHub, SSO, or email). Once you authenticate, the CLI is logged in automatically — there's no API key to copy or paste.
     <Note>On a headless or remote machine (or in CI), create an API key on your [Project Settings](https://app.goldsky.com/dashboard/settings) page and pass it directly with `goldsky login --token <API_KEY>`. Use `goldsky login --no-browser` to print the login URL instead of opening a browser.</Note>
  3. Now that you are logged in, run `goldsky` to get started:
     ```shell theme={null}
     goldsky
     ```
</Accordion>

For these examples we'll use the Ethereum contract for [POAP](https://poap.xyz).

# From source code

If you've developed your own subgraph, you can deploy it from the source. In our example we'll work off of a clone of the [POAP subgraph](https://github.com/goldsky-io/poap-subgraph).

First we need to clone the Git repo.

```shell theme={null}
git clone https://github.com/goldsky-io/poap-subgraph
```

Now change into that directory. From here, we'll build the subgraph from templates. Open source subgraphs have different instructions to get them to build, so check the `README.md` or look at the `package.json` for hints as to the correct build commands. Usually it's a two step process, but since POAP is deployed on multiple chains, there's one extra step at the start to generate the correct data from templates.

```shell theme={null}
yarn prepare:mainnet
yarn codegen
yarn build
```

Then you can deploy the subgraph to Goldsky using the following command.

```shell theme={null}
goldsky subgraph deploy poap-subgraph/1.0.0 --path .
```

# From The Graph or another host

<Info>
  For a detailed walkthrough, follow our [dedicated
  guide](/subgraphs/migrate-from-the-graph).
</Info>

# Via instant, low-code subgraphs

<Info>
  For a detailed walkthrough, follow our [dedicated
  guide](/subgraphs/guides/create-a-low-code-subgraph).
</Info>


## Related topics

- [Create no-code subgraphs](/subgraphs/guides/create-a-no-code-subgraph.md)
- [Index onchain data with Subgraphs](/subgraphs/introduction.md)
- [Agent Skills](/ai-skills.md)
- [Send subgraph-driven webhooks](/subgraphs/guides/send-subgraph-driven-webhooks.md)
- [Indexing Saga EVM with Goldsky](/chains/saga.md)
