Quick Start

This guide walks you through basic S4 operations using the AWS CLI.

1.1 Start the Server

export S4_ACCESS_KEY_ID=myaccesskey
export S4_SECRET_ACCESS_KEY=mysecretkey

./target/release/s4-server
# Server listens on http://127.0.0.1:9000

1.2 Start the Server with docker

docker run -d \
  --name s4-server \
  -p 9000:9000 \
  -v s4-data:/data \
  -e S4_ACCESS_KEY_ID=myaccesskey \
  -e S4_SECRET_ACCESS_KEY=mysecretkey \
  s4-server:latest

2. Configure AWS CLI

aws configure set aws_access_key_id myaccesskey
aws configure set aws_secret_access_key mysecretkey

3. Basic Operations

Create a Bucket

aws --endpoint-url http://localhost:9000 s3 mb s3://mybucket

Upload a File

aws --endpoint-url http://localhost:9000 s3 cp file.txt s3://mybucket/file.txt

List Objects

aws --endpoint-url http://localhost:9000 s3 ls s3://mybucket

Download a File

aws --endpoint-url http://localhost:9000 s3 cp s3://mybucket/file.txt downloaded.txt

Delete a File

aws --endpoint-url http://localhost:9000 s3 rm s3://mybucket/file.txt

Delete a Bucket

aws --endpoint-url http://localhost:9000 s3 rb s3://mybucket

4. Using curl

S4 also works with simple HTTP requests:

# Create bucket
curl -X PUT http://127.0.0.1:9000/test-bucket

# Upload object
curl -X PUT http://127.0.0.1:9000/test-bucket/hello.txt -d "Hello S4!"

# Download object
curl http://127.0.0.1:9000/test-bucket/hello.txt

# List buckets
curl http://127.0.0.1:9000/

# List objects in bucket
curl http://127.0.0.1:9000/test-bucket

# Delete object
curl -X DELETE http://127.0.0.1:9000/test-bucket/hello.txt

Next Steps

  • Enable Object Versioning to keep file history
  • Set up IAM for multi-user access control
  • Configure TLS for encrypted connections
  • Deploy with Docker