Object Storage is a cloud-based file storage system that lets you save, retrieve, and manage files from your Replit App with persistent access.
Replit Object Storage lets you build apps that handle user-uploaded files like images, videos, and documents. Unlike files uploaded to your Workspace, Object Storage provides persistent, scalable cloud storage that your deployed apps can access and serve to builders.
Ask Agent to add Object Storage to your app with details on what types of files your app should handle. Agent will set up the integration, create the necessary buckets, and update your app to upload, store, and retrieve files.
With Object Storage, you can build apps like:
Photo sharing platforms: Let builders upload, store, and display images
Video streaming services: Handle video uploads and serve content to viewers
Document management systems: Store and organize builder files with secure access
Portfolio sites: Showcase work with media files that load reliably
File backup services: Provide builders with cloud storage for their important files
Object Storage stores files in cloud containers called buckets. Buckets include access policies to control what actions builders or applications can perform on their contents.
The Replit Object Storage tool lets you share data between your development and production environments or with other Replit Apps.
Replit Object Storage is powered by Google Cloud Storage (GCS).
This means you receive the benefits of industry-leading uptime,
availability, and security.
Object Storage provides the following features for building file-handling apps:
Persistent cloud storage: Store files that remain accessible to your deployed app and users
Scalable file handling: Handle growing data needs without worrying about storage limits
Cross-app data sharing: Share buckets across multiple Replit Apps for distributed architectures
Programmatic access: Upload, download, and manage files using intuitive APIs
Agent integration: Let Agent set up Object Storage and implement file handling in your app
Here are specific ways you can use Object Storage in your apps:
Store builder profile pictures and media uploads
Serve product images for e-commerce sites
Handle document uploads for form submissions
Create file sharing and collaboration features
Build content management systems with media libraries
Your Replit App must authenticate with Google Cloud Storage to access a bucket and its objects.
Use the official Replit Object Storage client libraries to automatically authenticate.
You can access the Object Storage tool directly in your Replit App Workspace.
How to access the Object Storage tool
From the left Tool dock:
Select All tools to see a list of workspace tools.
Select Object Storage.
From the Search bar:
Select the magnifying glass at the top to open the search tool.
Type “Object Storage” to locate the tool and select it from the results.
To add Object Storage to your Replit App, create a bucket from the Object Storage tool. You must then integrate the Object Storage client libraries and update your app code to handle file operations.To create a bucket:
How to create a bucket
From the Object Storage tool:
Select Create new bucket.
Enter a name for the bucket in the Name field and select Create bucket.
The Object Storage tab should resemble the following screenshot:
To create additional buckets, open the bucket dropdown menu on the top left of the Object Storage tab and select Create new bucket.
The following sections explain the bucket and object management options in the Object Storage tool.
To switch between your storage buckets, select the dropdown menu in the top left corner of the Object Storage tab.The selected bucket displays a checkmark next to its name, as shown in the screenshot below:
To view the Bucket ID by selecting the Settings view from the dropdown at the top of the Object Storage tab.
The Bucket ID uniquely identifies the bucket, which your code must reference to perform an operation.If you have multiple buckets, select the correct bucket from the dropdown menu in the top left corner.The following screenshot shows the Bucket ID for the “FileVault Bucket One” bucket:
Navigate to the Objects view in the Object Storage tab.
Select Upload files, or Upload folder to upload all files from a folder.
Then, select one or more files to upload from the file dialog.
Alternatively, drag a file or folder into the area that lists the contents of the bucket.
To download an object from the selected bucket:
Navigate to the Objects view in the Object Storage tab.
Select the download icon to the right of the file to download it.
Navigate to the Objects view in the Object Storage tab.
Select Create Folder in the Objects view.
Enter a name for the folder.
To add objects to a folder in the Objects view, drag an object to the destination folder.To move the object to a parent folder, drag it above the header to the name of the folder above the object list.
The following animation shows moving the “product_demo.mov” file from the “videos” folder to the parent “Objects” folder:
Replit connects all buckets you create to your account and makes them available to
all your Replit Apps. The Replit App from which you create the bucket automatically
receives access.You can control which of your Replit Apps have access to a specific bucket, which lets you
share data efficiently and securely.To grant your Replit App access to a bucket from another app on your account:
Select Add an existing bucket from the bucket menu at the top left of the Object Storage tab.
In the Choose a Bucket dialog, choose the bucket you want to add and select Add Bucket to Repl.
To revoke your Replit App’s access to a bucket:
Navigate to the Settings view in the Object Storage tab.
From the bucket dropdown in the top left of the tab, select the bucket name.
Select Remove Bucket from Repl and confirm removal in the confirmation dialog.