> ## 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

<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. Go to your [Project Settings](https://app.goldsky.com/dashboard/settings) page and create an API key.
  3. Back in your Goldsky CLI, log into your Project by running the command `goldsky login` and paste your API key.
  4. 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>
