---
title: "Reference: Mastra.setStorage() | Core"
description: "Documentation for the `Mastra.setStorage()` method in Mastra, which sets the storage instance for the Mastra instance."
packages:
  - "@mastra/core"
---

# Mastra.setStorage()

The `.setStorage()` method is used to set the storage instance for the Mastra instance. This method accepts a single `MastraStorage` parameter.

## Usage example

```typescript
mastra.setStorage(
  new LibSQLStore({
    id: 'mastra-storage',
    url: ":memory:",
  }),
);
```

## Parameters

<PropertiesTable
  content={[
    {
      name: "storage",
      type: "MastraStorage",
      description: "The storage instance to set for the Mastra instance.",
    },
  ]}
/>

## Returns

This method does not return a value.

## Related

- [Storage overview](/reference/v1/storage/overview)
- [Storage reference](/reference/v1/storage/libsql)
