# Mastra.setStorage()

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

## Usage example

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

## Parameters

**storage** (`MastraCompositeStore`): The storage instance to set for the Mastra instance.

## Returns

This method doesn't return a value.

## Related

- [Storage overview](https://mastra.ai/reference/storage/overview)
- [Storage reference](https://mastra.ai/reference/storage/libsql)