---
id: actor-configuration
title: Actor configuration
---

import RunnableCodeBlock from '@site/src/components/RunnableCodeBlock';

import ConfigExample from '!!raw-loader!roa-loader!./code/11_config.py';

The [`Actor`](../../reference/class/Actor) class gets configured using the [`Configuration`](../../reference/class/Configuration) class, which initializes itself based on the provided environment variables.

If you're using the Apify SDK in your Actors on the Apify platform, or Actors running locally through the Apify CLI, you don't need to configure the `Actor` class manually,unless you have some specific requirements, everything will get configured automatically.

If you need some special configuration, you can adjust it either through the `Configuration` class directly,or by setting environment variables when running the Actor locally.

To see the full list of configuration options, check the `Configuration` class or the list of environment variables that the Actor understands.

## Configuring from code

This will cause the Actor to persist its state every 10 seconds:

<RunnableCodeBlock className="language-python" language="python">
    {ConfigExample}
</RunnableCodeBlock>

## Configuring via environment variables

All the configuration options can be set via environment variables. The environment variables are prefixed with `APIFY_`, and the configuration options are in uppercase, with underscores as separators. See the [`Configuration`](../../reference/class/Configuration) API reference for the full list of configuration options.

This Actor run will not persist its local storages to the filesystem:

```bash
APIFY_PERSIST_STORAGE=0 apify run
```
