Skip to main content
Object storage is in beta.
Object storage keeps files such as images, uploads, backups and exports in buckets. Each bucket is either private (files are reached only with an API key) or public (anyone with a file’s link can read it, which suits website assets).

Create a bucket

  1. Open Object storage in the sidebar and select Create bucket.
  2. Enter a name: 3 to 63 lowercase letters, digits and hyphens, unique in the workspace.
  3. The bucket is private by default. To make it public, open the bucket’s Settings tab and turn on public access.
A bucket can be deleted once it is empty.

Work with files in the dashboard

Inside a bucket you can:
  • upload files with Upload or by dragging them onto the list;
  • create folders (a folder appears once a file is uploaded into it);
  • download, copy a public link (public buckets), and delete files or whole folders.
The panel at the top of the file list shows the bucket’s Public URL for the folder you are viewing (public buckets) and its API endpoint, each with a copy button.

Public and private buckets

Uploading and deleting always require a key, also for public buckets. Every file in a public bucket has its own link:
Use it directly in a website:
Public links can be loaded by any website, and they are cached for five minutes.

Private files

Private files are read through the API with a key. Never put a key in browser code; read the file on your server and send it to the visitor, or keep the bucket private and serve files through your app.

Connect a bucket to your app

The easiest way to use object storage from an app is to connect a bucket in the app’s settings. Servbase then adds the configuration to the app for you.
  1. Open your app and go to Settings, then Object storage.
  2. Choose the bucket and the access: Read and write, or Read only.
  3. Select Connect bucket.
Servbase creates an API key that works only for that bucket and adds these variables to the app’s Variables: A running app restarts automatically so it picks up the new variables. A static site reads them on its next deployment.
  • Change switches to another bucket or access level; the old key is revoked.
  • Disconnect revokes the key and removes the variables.
  • Only the workspace owner can connect or disconnect a bucket, because it creates an API key.
  • The key appears on the API page as App storage: <app domain>. If you delete it there, the settings page shows that the connection stopped working.

Use the bucket in your code

Every request sends the key as a bearer token. Paths below are relative to SERVBASE_STORAGE_ENDPOINT.

Example: show uploaded images from a public bucket

When the connected bucket is public, build image links from SERVBASE_STORAGE_PUBLIC_URL instead of downloading the files:
Express

Example: serve a private file to signed-in users

Flask

Use the API without connecting an app

For scripts or CI, create an API key on the API page with the storage scopes it needs (storage:read, storage:write, storage:delete, and storage:buckets to create or change buckets), for all buckets or only specific ones. Every endpoint, with examples, is in the Object storage API reference:
A key created by connecting an app is limited to its bucket: it cannot reach other buckets or create, change or delete buckets.

Limits

The Object storage page shows how much of your workspace’s storage quota is used and the maximum size of one object. Keys are limited to 600 requests per minute.