DaytonaDocs

ObjectStoreService

Connect S3 buckets and mount them into sandboxes.

ObjectStoreService manages object stores: named references to your own S3-compatible buckets (AWS S3, MinIO/Ceph, Cloudflare R2, ...). Credentials are project secrets referenced by name — create them first with daytona.secret.set(). A store can be mounted into a sandbox at creation (via objectStoreMounts) or at runtime (via mount()); the sandbox sees the bucket as a FUSE filesystem. Obtain the service as daytona.objectStore. See the object stores guide.

create()

Creates an object store referencing a bucket and its credential secrets. The store is ready immediately.

TypeScript
create(name: string, opts: CreateObjectStoreOptions): Promise<ObjectStore>
ParameterTypeDefaultDescription
namestringStore name (unique within the project).
opts.bucketstringBucket name.
opts.accessKeySecretstringName of the project secret holding the access key — not the value.
opts.secretKeySecretstringName of the project secret holding the secret key.
opts.endpointstringCustom S3 endpoint (MinIO, R2, ...).
opts.regionstringBucket region.
opts.prefixstringKey prefix to scope the mount to.
opts.pathStylebooleanfalseUse path-style addressing (typical for MinIO/Ceph).
opts.readOnlybooleanfalseDefault mounts to read-only.
opts.provider'AWS' | 'Minio' | 'Ceph' | 'Cloudflare' | 'Other'Provider hint.
opts.sessionTokenSecretstringName of a secret holding a session token, for temporary credentials.

Returns: the ObjectStore DTO (id, name, bucket, state, ...; credential fields expose only secret names, never values).

Note: The directory-listing cache TTL (dir_cache_secs) can currently only be set through the REST API — it is not exposed in the SDKs yet.

TypeScript
await daytona.secret.set('s3-access-key', 'AKIA...')
await daytona.secret.set('s3-secret-key', '...')
 
const store = await daytona.objectStore.create('training-data', {
  bucket: 'acme-training-data',
  accessKeySecret: 's3-access-key',
  secretKeySecret: 's3-secret-key',
  region: 'us-east-1',
})

get()

Fetches an object store by id or name.

TypeScript
get(nameOrId: string): Promise<ObjectStore>

Throws: DaytonaNotFoundError if it does not exist.

list()

Lists the project's object stores. Deleted stores are excluded unless includeDeleted is true.

TypeScript
list(includeDeleted = false): Promise<ObjectStore[]>

delete()

Deletes an object store. Accepts an ObjectStore DTO (its id is used) or a plain id/name string. Fails with a conflict while a live sandbox has it mounted.

TypeScript
delete(store: ObjectStore | string): Promise<void>

Throws: DaytonaConflictError if the store is mounted by a live sandbox.

Runtime mounts

Mount and unmount stores on a running sandbox without recreating it. See mounting object stores.

mount()

Mounts an object store into a running sandbox at mountPath.

TypeScript
mount(sandboxId: string, objectStore: string, mountPath: string, readOnly?: boolean): Promise<void>
ParameterTypeDefaultDescription
sandboxIdstringTarget sandbox id.
objectStorestringStore id or name.
mountPathstringAbsolute in-sandbox mount path.
readOnlybooleanOverride the store's default read-only for this mount.
TypeScript
await daytona.objectStore.mount(sandbox.id, 'training-data', '/mnt/data', true)

unmount()

Unmounts a mount by name from a running sandbox.

TypeScript
unmount(sandboxId: string, name: string): Promise<void>

listMounts()

Lists a sandbox's current object-store mounts.

TypeScript
listMounts(sandboxId: string): Promise<unknown[]>

Returns: the list of mount records.

Mounting at creation: ObjectStoreMount

Attach stores at sandbox creation with ObjectStoreMount objects in objectStoreMounts:

TypeScript
const sandbox = await daytona.create({
  image: 'node:22-slim',
  objectStoreMounts: [{ objectStore: 'training-data', mountPath: '/mnt/data' }],
})
FieldTypeDefaultDescription
objectStorestringStore id or name (resolved server-side).
mountPathstringAbsolute in-sandbox mount path.
readOnlybooleanOverride the store's default read-only for this mount.

On this page