Storage
Lovable provides built-in cloud storage for your app's files like photos and documents, organizing them into 'buckets'. You can manage these files directly, set their access as private or public, and control upload size limits.
Anyone building an app with Lovable needs this when their app requires storing and managing user-uploaded files or other digital assets.
Do this, in order
- 1
Go to 'More' in your Lovable project, then select 'Cloud', and finally 'Storage'.
This is where you can see and manage all the files your app uses.
- 2
Click 'New bucket' to create a new storage area for your files.
Buckets help organize your files, like folders on your computer, and you can set different access rules for each.
- 3
Give your new bucket a name using only lowercase letters, numbers, and hyphens, between 3 and 63 characters long.
Following these rules ensures your bucket name is valid and works correctly, and you can't change it later.
- 4
Decide if your bucket should be 'Private' (default) or 'Public'.
Private means only authorized users can access files, while Public means anyone with the file's link can see it. Public buckets are blocked by default for security.
- 5
Open a bucket to upload files, create folders, or manage existing items.
This is how you populate your storage with the actual files your app needs, like user photos or documents.
- 6
If you need to change the maximum size for file uploads, go to the 'Storage' view, enter a new value under 'Upload size limit' (up to 5 GB), choose 'MB' or 'GB', and click 'Save'.
This ensures your app can handle files of the size you expect, preventing errors for larger uploads.
Paste this into your project
Add a contract upload field to each deal. Let clients have profile pictures and display them on the client detail page. Upload invoice PDFs and show a download link on the invoices table.
Words decoded
- Bucket
- A digital container or folder in the cloud where your app stores files, like a labeled box for specific types of items.
- Public access
- When files in a bucket can be viewed or downloaded by anyone who has the direct link, without needing special permission.
- Private access
- When files in a bucket can only be viewed or downloaded by users who have been granted specific permission by your app.
- Signed URL
- A temporary, secure web link that grants access to a private file for a limited time, like a one-time pass.
- Row level security policies
- Rules that control which specific rows (entries) in your database a user can see or change, based on their identity or role.
Where people get stuck
- Creating public storage buckets without understanding the security implications, as public files are accessible to anyone with the URL.
- Trying to delete a bucket or folder that still contains files, as they must be empty first.
- Attempting to change a bucket's name after it has been created.
- Expecting storage usage to stop billing when your Cloud project is paused; storage continues to incur costs.
- Assuming storage files are included in database exports; they are not and must be downloaded separately.
The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.