Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Simple PHP S3 Server - Self-hosted Object Storage for Virtual Hosts

TL;DR Version

Want S3-compatible storage on your cheap virtual host? Here's how:

  1. Create a new website on your VPS/virtual host
  2. Drop the index.php from GitHub repo into webroot
  3. Set your password in the config section

S3 Client Configuration:
- endpoint: Your domain name
- access_key: The password you set
- secret_key: Any value (ignored)
- region: Any value (ignored)

Example: Uploading hello.mp3 to bucket music stores it at ./data/music/hello.mp3

Pro tip: Pair with Cloudflare CDN for extra speed+reliability :grinning:


Backstory

Recently got a storage box from Hostbbr (basically a DA panel virtual host). While FTP/RSYNC work great, I needed S3-compatible access for my IPv6-only servers (yes, I know about WARP but wanted native solution).

Couldn't find any good self-hosted S3 servers that:

  • Work on basic PHP hosts
  • Don't require databases
  • Are stupid simple to deploy

So I built one!


The Goods

GitHub: https://github.com/hochenggang/simple-php-s3-server
README: https://github.com/hochenggang/simple-php-s3-server/blob/main/README-en.md

Key Features:
✅ Core S3 object operations (PUT/GET/DELETE/POST)
✅ Multipart upload support
✅ Zero-database filesystem storage
✅ AWSv4-style auth (simplified)
✅ Single-file deployment

Perfect for:

  • Backup targets
  • Static file hosting
  • Cross-server sync

If this helps you, stars appreciated! :star:

(Tested on DirectAdmin + Apache, should work on any PHP 8+ host with rewrite rules)

«1

Comments

  • angstromangstrom Moderator

    Initial commit 2 hours ago

    You didn't wait long!

    Thanked by 2nghialele cainyxues
  • imhcgimhcg Member

    @angstrom said:

    Initial commit 2 hours ago

    You didn't wait long!

    I'm really itching for some praise from everyone, but I know it might not go the way I hope. Fingers crossed I don’t get roasted instead! >:)

  • sliixsliix Member

    Ohhh this supposed to be goooood. I’ll try soon.

    Thanked by 1imhcg
  • PUSHR_VictorPUSHR_Victor Member, Host Rep

    That looks super nice!

    Thanked by 1imhcg
  • MultiMulti Member

    Call me paranoid but I would prefer to keep the access information in a seperate file outside the public folder.

    Thanked by 2ethanblake87 tux
  • imhcgimhcg Member

    @Multi said:
    Call me paranoid but I would prefer to keep the access information in a seperate file outside the public folder.

    I also think you're right, but I just did it this way for the sake of simplicity and convenience. Maybe you can utilize the AI to make it better as it might offer some useful solutions.

  • @imhcg said: So I built one!

    Nice

    Thanked by 1imhcg
  • looks like a good lightweight s3 solution will give it a try, thanks for sharing

    Thanked by 2cainyxues imhcg
  • Isn't this just some CRUD storage api with aws like auth? S3 is far more than this imo.

    Thanked by 1BasToTheMax
  • imhcgimhcg Member

    @webcraft said:
    Isn't this just some CRUD storage api with aws like auth? S3 is far more than this imo.

    Only object related api.😂
    I use it to backup.

  • Looks good! Starred.

    Thanked by 1imhcg
  • qebaqeba Member

    is it need to be into webroot or can be put into example.com/s3 ?.

  • Oooh looks awesome! Thank you :)

    Thanked by 1imhcg
  • TrKTrK Member

    S3 + php.... Interested how are you handling bigger files with memory limitations.

    Thanked by 1imhcg
  • MultiMulti Member

    @TrK said:
    S3 + php.... Interested how are you handling bigger files with memory limitations.

    Afaik you can send data in smaller chunks. But I'm not sure if the php script would be able to handle this. Feel free to try and report.

    Thanked by 2imhcg mrTom
  • imhcgimhcg Member

    @qeba said:
    is it need to be into webroot or can be put into example.com/s3 ?.

    In order to be compatible with OSS clients, such as Minio, the form of example.com/s3 cannot be used. You can use s3.example.com instead. :#

    Thanked by 3cainyxues qeba mrTom
  • imhcgimhcg Member

    @TrK said:
    S3 + php.... Interested how are you handling bigger files with memory limitations.

    I tested the OSS client for uploading slightly larger files. Minio will automatically perform segmented uploading when the file size is larger than 4MiB, and it won't directly consume a large amount of memory. :D
    This comparison is just made out of the needs of a niche group, and it may not be able to meet particularly serious requirements. Therefore, if you need formal S3 support, you need to choose a more formal product. Just take it easy.

  • how to use in wordpress

  • imhcgimhcg Member

    @denimzine said:
    how to use in wordpress

    Hi,
    This project most likely won't work with WordPress, sorry about that.

    If you have any other questions, feel free to ask!

  • t0past0pas Member

    Tried to deploy to usual DirectAdmin hosting php 8.1 and get the following:

    1st - aws_s3 CLI
    2nd - AList app

    Please, could you clarify if there exist suitable 3d-party apps to work with such type of s3 storage? or it's can be processed only under code (programming language code integration) ?

    Thank you in advance.

  • @t0pas said:
    Tried to deploy to usual DirectAdmin hosting php 8.1 and get the following:

    1st - aws_s3 CLI
    2nd - AList app

    Please, could you clarify if there exist suitable 3d-party apps to work with such type of s3 storage? or it's can be processed only under code (programming language code integration) ?

    Thank you in advance.

    it should be https://yourdomain/data/bucket/

    -put the bucket name any.
    -put any access code

    Thanked by 1nghialele
  • w3e4r5w3e4r5 Member

    Looks good! Starred.

  • t0past0pas Member

    @webontop said:

    @t0pas said:
    Tried to deploy to usual DirectAdmin hosting php 8.1 and get the following:

    1st - aws_s3 CLI
    2nd - AList app

    Please, could you clarify if there exist suitable 3d-party apps to work with such type of s3 storage? or it's can be processed only under code (programming language code integration) ?

    Thank you in advance.

    it should be https://yourdomain/data/bucket/

    -put the bucket name any.
    -put any access code


    Thank you very much for assistance. Works great. Starred.

  • RurikoRuriko Member

    @imhcg can you provide the nginx config? I'm not familiar on how to convert htaccess to nginx

  • nghialelenghialele Member
    edited July 2025

    @Ruriko said:
    @imhcg can you provide the nginx config? I'm not familiar on how to convert htaccess to nginx

    location / {
      if (!-e $request_filename){
        rewrite ^(.*)$ /index.php break;
      }
    }
    
  • Thank you very much; was looking for something like this.

    IMPORTANT NOTES FOR OTHER USERS

    Security Limitations:
    - This only checks if the access key exists in an allowlist, but doesn't verify AWS Signature V4 like real S3. Since there's no secret key verification, anyone with your access key can authenticate. Never use this for public-facing applications or embed keys in client-side code
    - THIS IS NOT suitable for untrusted networks as there is no protection against replay attacks or man-in-the-middle attacks without HTTPS

    ⚠️ DO NOT USE AS PRIMARY BACKUP This should only be a secondary or tertiary backup method due to potential data corruption under load

    as there are some reliability concerns like No file locking or atomic operations means concurrent uploads can corrupt data & Missing Content-MD5 validation and proper ETag generation

    PS: Abandoned multipart uploads will accumulate and waste disk space; so do clean up regularly.

  • For those that want a more production(ish) support using the same storage; here is a method I will recommend.

    Use rclone: https://rclone.org/commands/rclone_serve_s3/

    But rclone can't run on the Direct Admin server; so what it will need is a second server that will have rclone installed; the server will then form FTP/SFTP or any other supported protocol over to this server; and proxy over the commands to S3.

    This is still not as secure enough. But is much better than above if your usecase requires client exposure.

    For backups; you can use the above PHP. Or if you don't have another server; then we don't have a choice :lol: . Though be concious of the security implications.

    Thanked by 1imhcg
  • @ersauravadhikari said:
    For those that want a more production(ish) support using the same storage; here is a method I will recommend.

    Use rclone: https://rclone.org/commands/rclone_serve_s3/

    But rclone can't run on the Direct Admin server; so what it will need is a second server that will have rclone installed; the server will then form FTP/SFTP or any other supported protocol over to this server; and proxy over the commands to S3.

    This is still not as secure enough. But is much better than above if your usecase requires client exposure.

    For backups; you can use the above PHP. Or if you don't have another server; then we don't have a choice :lol: . Though be concious of the security implications.

    Yeah, you're absolutely right – thx for the heads-up. There's definitely a lot that needs improvement. I just pushed an update with some tweaks, but as mentioned, it's still far from perfect. Basically, don't run this in production – treat it as for learning, research, or just messing around.

  • is there a way to troubleshoot the s3 php server? logging or so? I get all the time errors when i try to connect to the php s3 server. @imhcg does it has some way of logging?

  • anubhavhiranianubhavhirani Member
    edited December 2025

    I am unable to set this up with Cyberduck, it needs both access key and secret key. Random character as secret_key does not work.

    Edit:

    Somehow it started working itself, maybe something to do with CF, anyway I am getting double the speed of ftp/sfpt using CF:

    Thank you for making this! :heart:

Sign In or Register to comment.