External Storage

OpenReplay session recordings are by default stored on your instance, but the destination can be changed to any S3-compatible object storage service, which allows for greater scalability and lower deployment costs.

Change recordings’ storage destination

Section titled Change recordings’ storage destination

Recordings can be persisted in any object storage destination as long as it’s S3 compatible, which makes OpenReplay compatible with all major public cloud services. Below are the steps to configure a different destination for your recordings:

You must create the below buckets in your object storage service. Their names can be different, but we’ll use the below references in the remainder of this section:

  • openreplay-recordings: where recordings will be persisted
  • openreplay-assets: where assets (such as css and fonts) will be copied
  • openreplay-sourcemaps: for storing source maps (see how to upload them)
  • openreplay-spots: for storing spot recordings

Once the bucket created:

  1. Enable CORS for each of the above buckets. If you’re on AWS, that would be under ‘Permissions > Cross-origin resource sharing (CORS)’ using the following configuration:
[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": []
    }
]
  1. Enable public access to the openreplay-assets bucket only. This latter contains only stylesheets, icons and fonts that are required for proper session replay. If you’re on AWS, first navigate to ‘Permissions > Block public access (bucket settings)’ and turn it off, then go to ‘Permissions > Bucket policy’ and use the following configuration:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AddPerm",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::openreplay-assets/*"
        }
    ]
}
  1. Finally, make sure to generate the appropriate access keys to these 4 buckets only so OpenReplay backend can programmatically access them to upload files. The required S3 permissions are:
"s3:PutObject",
"s3:GetObjectAcl",
"s3:GetObject",
"s3:GetObjectTagging",
"s3:ListBucket",
"s3:PutObjectTagging",
"s3:GetBucketLocation"
  1. Login to your OpenReplay instance and openreplay -e to update the below env variables in s3 section:
VariableDescription
accessKeyYour object storage access key (your IAM access key ID if you’re on AWS, on Google Cloud it’d be your HMAC key for service account)
secretKeyYour object storage secret
endpointThe URL (starting with https) of your object storage service (i.e. check the list of S3 endpoints if you’re on AWS, on Google Cloud Storage this would be https://storage.googleapis.com)
regionThe region (if applicable) of your buckets (i.e. if you’re using AWS S3, this would be something like us-east-1)
assetsBucketThe assets’ bucket name (i.e. openreplay-assets)
recordingsBucketThe recordings’ bucket name (i.e. openreplay-recordings)
sourcemapsBucketThe sourcemaps’ bucket name (i.e. openreplay-sourcemaps)
spotsBucketThe spot’ bucket name (i.e. openreplay-spots)
  1. Save and quit using :wq for the changes to take effect

Newly recorded sessions should now be stored and retrieved (when replayed) from your new destination/object storage service.

If case of any issues, please connect to our Slack or check out our Forum and get help from our community.