Replay data retention

Depending on how your app or website is built, recordings can take a lot of disk space. To manage this, we have the following retention policy options in place.

Note: Any individual recording you want to preserve can be downloaded as a JSON file by clicking "Export to JSON" in the more options menu in the top right of a recording. Downloaded recordings can then be imported back into PostHog for future playback, even if the original recording has expired.

PostHog Cloud

The retention period for your recordings can be configured in the Data Retention section of the session replay settings:

Configure data retention settings for your recordings

The longest available retention period depends on your PostHog plan:

PlanData retention
FreeUp to 30 days
Pay-as-you-goUp to 90 days
BoostUp to 1 year
ScaleUp to 1 year
EnterpriseUp to 5 years

Note: When a recording expires, the deletion is not immediate. Recordings may still appear for a short time after the retention period expires or when manually deleted via the UI. Once a recording has been deleted we are unable to restore it - this makes data retention a useful feature if you are subject to data protection regulations.

Long-term storage

Regardless of your data retention settings, some recordings are stored for a full year:

  • recordings pinned to a playlist
  • recordings shared publicly
  • recordings added to a notebook

🧠 Heads up: This isn't meant to be a storage hack! We limit storage to keep replay prices low for everyone. If it looks like someone's gaming the system (e.g. automating these actions to stockpile recordings), we might apply a fair-use limitation and block automation against these endpoints for their project.

Self-hosted installations

The original version of session replay stored recordings in ClickHouse. At a higher scale, this was impractical and expensive. To make PostHog cheaper and easier to run and maintain, we have deprecated storing recordings in ClickHouse. We now only support blob storage backed recordings. In PostHog Cloud, we use AWS S3 as a blob store. Self-hosted versions include MINIO to enable you to use whichever blob storage you prefer.

I want to keep using ClickHouse for recording storage...

The final PostHog release to officially support ClickHouse stored recordings can be pinned using the deploy-hobby script. All subsequent releases only support blob storage-backed recordings.

You can also edit your docker-compose file to replace image: posthog/posthog:$POSTHOG_APP_TAG with image: posthog/posthog:9c68581779c78489cfe737cfa965b73f7fc5503c.

Managing storage

Self-hosted installations pinned to earlier versions can control the TTL by updating the RECORDINGS_TTL_WEEKS configuration on your instance settings page.

Please note that you need to manage the available capacity for versions of PostHog that rely on Clickhouse storage. Ensure you increase volume capacity before changing the RECORDINGS_TTL_WEEKS value (even if you're decreasing the value). ClickHouse requires abundant free disk space to manage the session_recording_events table.

In later versions (which do not use Clickhouse for recording storage), the installation will be relying on its configured blob storage. You can manage storage using blob storage lifecycle policies. This will vary by environment.

Community questions

Was this page useful?

Questions about this page? or post a community question.