php-s3

Self-hosted S3 server · plain PHP 8.1+ · zero runtime dependencies

S3 object storage on the hosting you already pay for.

php-s3 speaks the real S3 API: SigV4 auth, multipart uploads, presigned URLs, range requests, and streaming in constant memory. Upload it, run the browser installer, point any S3 client at it. No daemons, no Docker, no root, and no Composer on the server.

  • PHP 8.1+
  • MySQL 5.7+ / MariaDB 10.3+
  • 0 runtime dependencies
  • 223 tests · 386 assertions
  • Apache · LiteSpeed · nginx · Caddy

What is in the box

  1. 01

    Signature verification with no bypass flags

    Header mode, presigned query URLs from 1 second to 7 days, and aws-chunked streams with a per-chunk signature chain. Every request is verified with constant-time comparisons. There is no simple-auth mode to forget to turn off.

  2. 02

    Streaming in constant memory

    Uploads and downloads run as a 64 KiB loop while MD5 and SHA-256 are computed on the way through. A multi-gigabyte object never sits in RAM, which matters when your PHP memory limit is 256 MB.

  3. 03

    Listings that stay fast

    MySQL is the index. Objects live at sha256-sharded paths, so one directory never holds millions of entries and pagination does not degrade into a full disk scan.

  4. 04

    Storage that cannot be traversed

    Object keys never touch the filesystem path. Paths are derived from a hash and a UUID, the data root lives outside the web root, and containment is checked with realpath on every read and delete.

  5. 05

    A panel you can actually run

    Browser installer, session login with throttling, access keys with per-bucket scoping, usage statistics, and a CLI for migrations, garbage collection, doctor checks, and key creation.

The honest comparison

Summary of the four open-source PHP projects studied in full source before php-s3 existed. Yes, partial, and no are read straight from that audit, not from marketing pages.

php-s3 compared with four reference PHP S3 projects
Capabilityphp-s3opsfour/s3-serversimple-php-s3-serverlite-s3buckie-php
Real S3 XML API with SigV4yesyesyespartialno
Signature verified on every requestyesyespartialnono
Runs on shared hosting, no daemon or rootyesnoyesyesyes
Streaming uploads and downloadsyesyesnopartialyes
Database-indexed listingsyesyesnoyesno
Multipart with AWS-format ETagsyesyesyespartialno
Presigned URLs with expiryyesyespartialpartialno
aws-chunked with per-chunk signaturesyesyesnonono
Web installer and admin panelyesnonoyesno
Automated tests in repo223745nonenone56

opsfour/s3-server is the best-in-class PHP S3 server and we openly credit it as the quality bar. php-s3 targets the same correctness without PHP 8.4, fibers, or a long-running worker. Full source audit in the research notes.

From upload to endpoint in three steps

01

Upload the files

Clone the repository or drop the release into your document root. No build step on the server.

# extract the release, then
composer install --no-dev
02

Run the installer

One form: database credentials, your admin account, and the data directory outside the web root.

# open on your domain
/_admin/install
03

Point your client

Create a bucket and an access key in the panel, then connect any S3 tool with path-style addressing. Replace DOMAIN with your endpoint.

# real request, real signature
aws --endpoint-url https://DOMAIN s3 ls

API coverage

Buckets

  • ListBuckets
  • CreateBucket
  • HeadBucket
  • DeleteBucket

Objects

  • PutObject
  • GetObject + Range
  • HeadObject
  • DeleteObject
  • CopyObject

Listing

  • ListObjectsV1
  • ListObjectsV2
  • Prefix + delimiter
  • Continuation tokens

Batch

  • DeleteObjects
  • 1000 keys per call
  • Quiet mode

Multipart

  • Create
  • UploadPart
  • Complete
  • Abort
  • ListParts
  • ListUploads

Auth and transport

  • SigV4 header mode
  • Presigned URLs
  • aws-chunked signed chain
  • Unsigned trailers

Not yet: versioning, ACLs and policies, checksum trailers, public access. Evidence for every operation lives in the compatibility matrix.

What php-s3 is not

Backups
It is storage, not a backup service. The disk is yours, so the backup plan is yours.
Multi-tenancy
One owner, many scoped access keys. There are no client accounts and no sign-up.
Public access
Every request is signed. There is no anonymous mode and no public-read bucket flag.
Performance
As fast as your host's disk and PHP worker limit, and honest about both.
Finished
Versioning, ACLs, and checksum trailers are on the roadmap, not in a release note.