Object storage (S3)
On this page
This is the reference for pushing and pulling files programmatically from
a Dokwe storage space. Every space is an S3-compatible bucket running on a
BYOS server you own, fronted by a managed HTTPS endpoint. If you've used the
AWS SDK, Boto3, the aws s3 CLI, the MinIO clients, mc, or any other S3
tooling — they all work here unchanged.
1. Quick start#
# 1. Mint a read-write key in the dashboard:
# Storage → <your space> → Keys → Mint Key
export AWS_ACCESS_KEY_ID=dkwk_xxxxxxxxxxxxxxxxxxxx
export AWS_SECRET_ACCESS_KEY=<secret-shown-once>
# 2. Upload (the bucket name is your space slug)
aws s3 cp ./photo.jpg s3://my-space/photo.jpg \
--endpoint-url https://my-space-s3.dokwe.com
# 3. Download
aws s3 cp s3://my-space/photo.jpg ./photo.jpg \
--endpoint-url https://my-space-s3.dokwe.com
# 4. Or just hit the public file URL (public spaces only)
curl -O https://my-space-file.dokwe.com/photo.jpgThat's it. Everything else in this guide is variations and edge cases.
2. Concepts#
A storage space is an S3 bucket on a BYOS server, fronted by two hostnames managed by the platform:
| URL | Purpose |
|---|---|
https://<slug>-s3.dokwe.com | S3 API endpoint. SDK / CLI clients point here. SigV4-signed PUT/GET/LIST/DELETE/multipart all supported. |
https://<slug>-file.dokwe.com | Public file serving (cached). For public spaces this URL serves objects without auth. For private spaces, requests without a signed query string get 403 — use a presigned URL instead. |
A custom domain added in the dashboard (e.g. cdn.example.com) routes
to the same cache backend as <slug>-file.dokwe.com.
The bucket name is your space's slug. So a space at
my-uploads-s3.dokwe.com holds objects in the my-uploads bucket.
Folders are pure prefix conventions — objects with / in their keys
group into folders in the dashboard, but on the wire they're just keys. The
dashboard's "New folder" affordance creates a zero-byte object with a
trailing / (AWS console convention) so an empty folder shows up in
listings.
3. Endpoints#
| Operation | URL | Notes |
|---|---|---|
| All S3 API calls | https://<slug>-s3.dokwe.com | Path-style addressing: https://<slug>-s3.dokwe.com/<bucket>/<key> |
| Public file GET | https://<slug>-file.dokwe.com/<key> | Only public spaces; cached at the edge |
| Custom domain (file) | https://your-domain/<key> | If you've added a verified custom domain |
The region is us-east-1 for SigV4 signing purposes — any value works
since MinIO ignores it, but us-east-1 is what the platform signs internal
calls with so it's safe to standardize on.
Always use path-style addressing. Virtual-hosted-style (<bucket>.<host>)
requires a wildcard TLS cert per space slug which we don't issue. Every
example below sets the corresponding SDK flag.
4. Authentication: minting an access key#
- Open the dashboard → Storage → your space → Keys tab.
- Click Mint Key. Choose:
- Label: a name for your records (e.g. "CI uploader", "Python ingest").
- Permissions:
read-only— canListObjects,GetObject,HeadObject.read-write— addsPutObject,DeleteObject, multipart, etc.
- The secret is shown exactly once. Copy it into your secret manager immediately — there's no way to recover it later. Mint a new one if you lose it (revoke the old one).
- Revoke from the same tab when the key is no longer needed.
You can have multiple keys per space — mint one per CI job / service / app so revoking one doesn't take everything down.
5. Uploading#
5.1 aws CLI#
export AWS_ACCESS_KEY_ID=dkwk_xxxx
export AWS_SECRET_ACCESS_KEY=xxxx
export AWS_DEFAULT_REGION=us-east-1
# Single file
aws s3 cp ./report.pdf s3://my-space/reports/2026/q2.pdf \
--endpoint-url https://my-space-s3.dokwe.com
# Whole directory
aws s3 sync ./build s3://my-space/build \
--endpoint-url https://my-space-s3.dokwe.com \
--acl private
# Set content type (helpful when serving from -file.dokwe.com)
aws s3 cp ./index.html s3://my-space/index.html \
--endpoint-url https://my-space-s3.dokwe.com \
--content-type text/htmlAdd this to ~/.aws/config once and drop the --endpoint-url:
[profile dokwe]
endpoint_url = https://my-space-s3.dokwe.com
region = us-east-1
s3 =
addressing_style = pathaws --profile dokwe s3 cp ./photo.jpg s3://my-space/photo.jpg5.2 Python (boto3)#
import boto3
from botocore.config import Config
s3 = boto3.client(
"s3",
endpoint_url="https://my-space-s3.dokwe.com",
aws_access_key_id="dkwk_xxxx",
aws_secret_access_key="xxxx",
region_name="us-east-1",
config=Config(s3={"addressing_style": "path"}),
)
# Upload from a local file
s3.upload_file("./report.pdf", "my-space", "reports/2026/q2.pdf")
# Upload from bytes
s3.put_object(
Bucket="my-space",
Key="logs/runtime.log",
Body=b"some bytes",
ContentType="text/plain",
)5.3 Node.js (@aws-sdk/client-s3)#
import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3";
import { createReadStream } from "node:fs";
const s3 = new S3Client({
endpoint: "https://my-space-s3.dokwe.com",
region: "us-east-1",
credentials: {
accessKeyId: process.env.DOKWE_KEY!,
secretAccessKey: process.env.DOKWE_SECRET!,
},
forcePathStyle: true,
});
await s3.send(new PutObjectCommand({
Bucket: "my-space",
Key: "uploads/report.pdf",
Body: createReadStream("./report.pdf"),
ContentType: "application/pdf",
}));5.4 Node.js (minio)#
import { Client } from "minio";
const mc = new Client({
endPoint: "my-space-s3.dokwe.com",
port: 443,
useSSL: true,
accessKey: process.env.DOKWE_KEY!,
secretKey: process.env.DOKWE_SECRET!,
region: "us-east-1",
pathStyle: true,
});
await mc.fPutObject("my-space", "uploads/report.pdf", "./report.pdf", {
"Content-Type": "application/pdf",
});5.5 Go (minio-go)#
import (
"context"
"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
)
mc, err := minio.New("my-space-s3.dokwe.com", &minio.Options{
Creds: credentials.NewStaticV4(os.Getenv("DOKWE_KEY"), os.Getenv("DOKWE_SECRET"), ""),
Secure: true,
Region: "us-east-1",
})
// minio-go uses path-style automatically when endpoint isn't AWS.
_, err = mc.FPutObject(context.Background(),
"my-space", "uploads/report.pdf", "./report.pdf",
minio.PutObjectOptions{ContentType: "application/pdf"})5.6 PHP (aws/aws-sdk-php)#
use Aws\S3\S3Client;
$s3 = new S3Client([
'version' => 'latest',
'region' => 'us-east-1',
'endpoint' => 'https://my-space-s3.dokwe.com',
'use_path_style_endpoint' => true,
'credentials' => [
'key' => getenv('DOKWE_KEY'),
'secret' => getenv('DOKWE_SECRET'),
],
]);
$s3->putObject([
'Bucket' => 'my-space',
'Key' => 'uploads/report.pdf',
'SourceFile' => './report.pdf',
'ContentType' => 'application/pdf',
]);5.7 Ruby (aws-sdk-s3)#
require "aws-sdk-s3"
s3 = Aws::S3::Client.new(
endpoint: "https://my-space-s3.dokwe.com",
region: "us-east-1",
force_path_style: true,
access_key_id: ENV.fetch("DOKWE_KEY"),
secret_access_key: ENV.fetch("DOKWE_SECRET"),
)
s3.put_object(
bucket: "my-space",
key: "uploads/report.pdf",
body: File.open("./report.pdf", "rb"),
content_type: "application/pdf",
)5.8 curl against a presigned URL#
Mint a presigned PUT URL from your backend (see §9), then any client can upload with a plain HTTP PUT:
curl -X PUT "https://my-space-s3.dokwe.com/my-space/photo.jpg?X-Amz-Algorithm=...&X-Amz-Signature=..." \
-H "Content-Type: image/jpeg" \
--data-binary @./photo.jpg6. Downloading#
Public file URL (cached)#
For public spaces, fetch the file URL directly — no auth, no signature, served from the nginx cache in front of MinIO:
curl -O https://my-space-file.dokwe.com/photo.jpgS3 API (works on public + private)#
aws s3 cp s3://my-space/photo.jpg ./photo.jpg \
--endpoint-url https://my-space-s3.dokwe.coms3.download_file("my-space", "photo.jpg", "./photo.jpg")import { GetObjectCommand } from "@aws-sdk/client-s3";
const res = await s3.send(new GetObjectCommand({ Bucket: "my-space", Key: "photo.jpg" }));
// res.Body is a Readable; pipe it to disk / a response / whereverStreaming#
All SDKs above stream by default — Body is a stream/iterator, not an
in-memory buffer. Useful for files larger than process memory.
7. Listing objects (and folders)#
# Top level
aws s3 ls s3://my-space/ \
--endpoint-url https://my-space-s3.dokwe.com
# Inside a folder
aws s3 ls s3://my-space/photos/2026/ \
--endpoint-url https://my-space-s3.dokwe.com
# Recursive (flat)
aws s3 ls s3://my-space/ --recursive \
--endpoint-url https://my-space-s3.dokwe.com# Page through everything (paginator handles continuation tokens)
paginator = s3.get_paginator("list_objects_v2")
for page in paginator.paginate(Bucket="my-space", Prefix="logs/"):
for obj in page.get("Contents", []):
print(obj["Key"], obj["Size"])import { ListObjectsV2Command } from "@aws-sdk/client-s3";
let token: string | undefined;
do {
const page = await s3.send(new ListObjectsV2Command({
Bucket: "my-space",
Prefix: "logs/",
Delimiter: "/", // tree view — folders surface in CommonPrefixes
ContinuationToken: token,
}));
for (const obj of page.Contents ?? []) console.log(obj.Key, obj.Size);
for (const f of page.CommonPrefixes ?? []) console.log("folder:", f.Prefix);
token = page.NextContinuationToken;
} while (token);Folders: pass Delimiter: "/" to get a tree view. Without a delimiter
S3 returns all keys flat. The dashboard always uses delimiter-mode.
8. Deleting#
aws s3 rm s3://my-space/photo.jpg \
--endpoint-url https://my-space-s3.dokwe.com
# Whole folder (S3 has no real folders; this just lists + deletes)
aws s3 rm s3://my-space/photos/2026/ --recursive \
--endpoint-url https://my-space-s3.dokwe.coms3.delete_object(Bucket="my-space", Key="photo.jpg")
# Batch up to 1000 at a time
s3.delete_objects(
Bucket="my-space",
Delete={"Objects": [{"Key": "a.jpg"}, {"Key": "b.jpg"}]},
)9. Browser-side uploads (presigned URLs)#
For a web app, don't ship credentials to the browser. Instead, your backend mints a short-lived presigned PUT URL and the browser uploads directly to MinIO — no proxy hop through your Node/Python server.
Backend (Node)#
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
import { PutObjectCommand } from "@aws-sdk/client-s3";
app.post("/api/upload-url", async (req, res) => {
const key = `uploads/${randomUUID()}-${req.body.filename}`;
const url = await getSignedUrl(
s3,
new PutObjectCommand({
Bucket: "my-space",
Key: key,
ContentType: req.body.contentType,
}),
{ expiresIn: 600 }, // 10 minutes
);
res.json({ url, key });
});Backend (Python)#
@app.post("/api/upload-url")
def upload_url():
key = f"uploads/{uuid4()}-{request.json['filename']}"
url = s3.generate_presigned_url(
"put_object",
Params={"Bucket": "my-space", "Key": key, "ContentType": request.json["contentType"]},
ExpiresIn=600,
)
return {"url": url, "key": key}Browser#
const { url } = await fetch("/api/upload-url", {
method: "POST",
body: JSON.stringify({ filename: file.name, contentType: file.type }),
}).then((r) => r.json());
await fetch(url, {
method: "PUT",
body: file,
headers: { "Content-Type": file.type },
});For upload progress bars, swap fetch for XMLHttpRequest (the only
browser API that surfaces upload progress events). The Dokwe dashboard's
own Files tab does exactly this — open it in DevTools to see the pattern.
Presigned GET (downloads from private spaces)#
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
import { GetObjectCommand } from "@aws-sdk/client-s3";
const url = await getSignedUrl(
s3,
new GetObjectCommand({ Bucket: "my-space", Key: "photo.jpg" }),
{ expiresIn: 3600 },
);
// hand `url` to the browser — works as a plain HTTPS GET10. Public vs private spaces#
| Public space | Private space | |
|---|---|---|
Anyone can GET https://<slug>-file.dokwe.com/<key> | yes | no (403) |
GET with a presigned URL | yes | yes |
| All other operations require signed S3 requests | yes | yes |
| Default | private | — |
Flip via dashboard → Storage → space → Settings → Access mode. Flipping mutates the bucket policy on MinIO; existing presigned URLs keep working until they expire.
11. Large files (multipart)#
Files bigger than ~100 MB should use multipart upload. Every SDK in this guide does this automatically when you use the high-level helpers:
aws s3 cp/aws s3 sync— automatic, threshold 8 MB- boto3
upload_file— automatic, threshold 8 MB @aws-sdk/lib-storageUpload— call this instead ofPutObjectCommand- minio JS
fPutObject— automatic, threshold 64 MB - minio Go
FPutObject— automatic, threshold 64 MB
For browser-side uploads with multipart, mint multiple presigned URLs (one
per part) and orchestrate from the client. That's a Phase 1.5 addition to
the Dokwe API (POST /storage/spaces/:id/objects/presign-multipart) — until
then, single-PUT uploads cap at MinIO's max object size in one PUT (5 GB),
which is plenty for typical web uploads.
12. CORS#
In v1, browser uploads to *-s3.dokwe.com need the origin to match a CORS
allow list. The platform applies a permissive default (Access-Control-Allow-Origin: *)
to the MinIO API at the server level — usable for development and most
production flows. Per-bucket CORS rules via the dashboard land in Phase 1.5.
For the cached file URL (*-file.dokwe.com), nginx passes CORS headers
through from origin, so the same allow rules apply.
13. Replicas#
A replica is a second copy of a space on another of your servers. If the space's server stops answering, Dokwe's router sends requests to the replica instead. Your app keeps using the same URLs and keys.
Replicas come with paid plans. Owners and admins add one in the space's Settings › Replica: pick the second server and click Add replica. Both servers' agents need to be on version 0.5.2 or later.
What happens when you add one
- The replica server copies every file from the space. The space keeps serving, and uploads keep working, the whole time.
- Dokwe turns on two-way sync: a file written on either server is copied to the other, and so are overwrites and deletes. Your keys, quota, CORS rules and cache settings are applied on both servers.
- The router starts checking both servers every 5 seconds and sends requests to the main server while it answers.
When the main server goes down
- Requests that reach it just as it fails can error for up to about 10 seconds, until the router's checks notice. After that, requests go to the replica.
- Uploads work on the replica. When the main server answers again, they sync back to it and requests return to it on their own.
- A file uploaded in the last few seconds before the main stopped may not have reached the replica yet. It appears again once the main is back.
- Owners and admins get an alert email and a push notification when requests move to the replica, and again when they move back.
- If both servers stop answering, the space is down.
Versions
Two-way sync needs versioning. On a space with a replica, an overwritten or deleted file keeps its old version for a day, then Dokwe deletes it. This uses the bucket's lifecycle rules, so any lifecycle rule you set yourself is replaced. Old versions count toward the space's quota until they're deleted.
Planned work on a server
Make replica the main (in the Replica card) swaps the two servers: requests go to the other one first, with no downtime, and both keep syncing. Use it before you restart or upgrade the main server.
Removing a replica
Remove replica deletes the copy on the second server. You can't remove it while it's the one serving (the main is down), and you can't move a space to another server while it has a replica.
14. Limits & caveats#
- Path-style only. Always set
forcePathStyle: true/use_path_style_endpoint: true/pathStyle: true(or your client's equivalent). Virtual-hosted-style addressing needs a per-slug wildcard cert which the platform doesn't issue. - One bucket per space. A space's slug is the bucket name; you can't have multiple buckets in one space.
- Bucket policies you manage out-of-band can be overwritten when you flip access mode in the dashboard. If you've set a custom JSON policy via
aws s3api put-bucket-policy, treat the access-mode toggle as authoritative. - No object lifecycle rules yet. Auto-expire by age lands in Phase 2; for now, schedule your own
aws s3 rmin CI / cron. - Object change events (S3
ObjectCreated:*webhooks) are Phase 2. - The cache in front of public spaces respects upstream
Cache-Control. SetCache-Control: max-age=31536000, immutableonPutObjectfor hashed-filename assets so the edge holds them for a year. - Server outage: a space lives on one BYOS server. If that server goes down, the space is unreachable until it's back, unless it has a replica on another server.
15. Troubleshooting#
SignatureDoesNotMatch
- Your secret has a copy-paste error (trailing whitespace, missed a char), or the system clock on the client is more than 15 minutes off UTC. Sync NTP and verify the secret in your secret manager matches the one you minted.
AccessDenied on PUT
- The key is read-only. Mint a separate read-write key for uploaders.
- Or the space is over its quota (set a higher quota in dashboard → Settings, or delete some objects).
AccessDenied on GET https://<slug>-file.dokwe.com/<key>
- The space is private. Use the S3 endpoint with a signed request, or a presigned GET URL.
NoSuchBucket
- You're using the wrong bucket name. The bucket name is the space's slug, not its display name — find it under Settings, or look at the
*-file.dokwe.comhostname (<bucket>-file.dokwe.com).
Files don't show in the dashboard's Files tab after upload via SDK
- Click the Refresh button on the Files tab, or navigate out and back in. The tab does paginated list calls and doesn't auto-refresh on a fixed interval.
Connection times out from a serverless function
- Some serverless providers block outbound to non-AWS S3 endpoints by default. Whitelist
*-s3.dokwe.com(or your custom domain) in the platform's egress rules.
The S3 endpoint returns a 502
- The BYOS server hosting the space is offline or its agent is disconnected. Check the dashboard's Servers list; restart the agent if it's been a while.