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

# Self-hosting logos

> Store Logo.dev logos on your own infrastructure with an Enterprise plan. Implementation guides for AWS S3, Google Cloud Storage, Azure, and custom CDNs.

<Note>
  Enterprise plans include a license to store logos on your own infrastructure
  for as long as your subscription is active.
</Note>

Self-hosting (or logo hosting) means downloading logos from Logo.dev and serving them from your own storage. You fetch once, host them in your infrastructure (S3, CDN, filesystem), and serve unlimited times. This reduces API calls and gives you full control over caching and delivery.

## Implementation

The pattern is the same on any stack: fetch once, store the bytes, serve from your own CDN.

### Basic pattern

```javascript theme={null}
// 1. Fetch logo from Logo.dev
const response = await fetch(
  `https://img.logo.dev/${domain}?token=${LOGO_DEV_PUBLISHABLE_KEY}&format=webp`
);

const buffer = await response.arrayBuffer();

// 2. Store in your infrastructure
await yourStorageSystem.upload(`logos/${domain}.webp`, buffer);

// 3. Serve from your CDN
return `https://your-cdn.com/logos/${domain}.webp`;
```

### Batch processing

```javascript theme={null}
const domains = ["stripe.com", "shopify.com", "square.com"];

await Promise.all(
  domains.map(async (domain) => {
    const response = await fetch(
      `https://img.logo.dev/${domain}?token=${LOGO_DEV_PUBLISHABLE_KEY}`
    );
    const buffer = await response.arrayBuffer();
    await yourStorageSystem.upload(`logos/${domain}.webp`, buffer);
  })
);
```

## Storage examples

Adapt these to your infrastructure:

### AWS S3

```javascript theme={null}
import AWS from "aws-sdk";

const s3 = new AWS.S3();

async function storeInS3(domain) {
  const response = await fetch(
    `https://img.logo.dev/${domain}?token=${LOGO_DEV_PUBLISHABLE_KEY}&format=webp`
  );
  const buffer = await response.arrayBuffer();

  await s3
    .putObject({
      Bucket: "your-bucket",
      Key: `logos/${domain}.webp`,
      Body: Buffer.from(buffer),
      ContentType: "image/webp",
      CacheControl: "public, max-age=31536000",
    })
    .promise();
}
```

### Google Cloud Storage

```javascript theme={null}
import { Storage } from "@google-cloud/storage";

const storage = new Storage();
const bucket = storage.bucket("your-bucket");

async function storeInGCS(domain) {
  const response = await fetch(
    `https://img.logo.dev/${domain}?token=${LOGO_DEV_PUBLISHABLE_KEY}&format=webp`
  );
  const buffer = await response.arrayBuffer();

  await bucket.file(`logos/${domain}.webp`).save(Buffer.from(buffer), {
    contentType: "image/webp",
  });
}
```

### Azure Blob Storage

```javascript theme={null}
import { BlobServiceClient } from "@azure/storage-blob";

const blobService = BlobServiceClient.fromConnectionString(CONNECTION_STRING);
const container = blobService.getContainerClient("logos");

async function storeInAzure(domain) {
  const response = await fetch(
    `https://img.logo.dev/${domain}?token=${LOGO_DEV_PUBLISHABLE_KEY}&format=webp`
  );
  const buffer = await response.arrayBuffer();

  await container
    .getBlockBlobClient(`${domain}.webp`)
    .uploadData(Buffer.from(buffer), {
      blobHTTPHeaders: { blobContentType: "image/webp" },
    });
}
```
