- PHP 65.2%
- CSS 33%
- Dockerfile 1.8%
Buen
A simple self-hosted micro photo sharing engine written in PHP.
Example: jetstream
Features
- Single-user photo sharing for personal use
- Minimal dependencies - only requires PHP
- Easy to deploy - no database (posts are saved as JSON files), no exotic dependencies
- No learning curve - straightforward and simple
- Wall page with all photos displayed as a thumbnail grid
- Strips all EXIF metadata from uploaded photos
- Sunshine: a simple like system — click the sun icon to show appreciation (cookie-based, one per post per visitor)
- Microformats2 support
- Works with simian
Requirements
- PHP 7.4+ with GD extension
- A web server or PHP built-in server
Installation
-
Clone this repository:
git clone https://github.com/dmpop/buen.git -
Generate a password hash:
php -r "echo password_hash('YOUR_PASSWORD', PASSWORD_DEFAULT);" -
Open
config.phpand replace the default password hash with your generated hash:define("PASSWORD_HASH", '2ドルy12ドル$...'); -
Update the site title, description, and URL in
config.phpas needed.
Running
Using PHP Built-in Server (Testing)
Start the built-in PHP server:
php -S 127.0.0.1:8080
Open http://127.0.0.1:8080 in your browser.
Using Docker
Build and start the container:
docker compose up -d
Open http://localhost:8080 in your browser.
Using a Web Server
Configure your web server (Apache, Nginx, etc.) to serve the application directory. Ensure the posts/, uploads/, and uploads/thumbs/ directories are writable by the web server.
Usage
- View photos: Navigate to the site URL to browse uploaded photos
- Upload photos: Access
/admin.phpto upload and manage photos - RSS feed: Access
/rss.phpfor the RSS feed
Fix upload limit
Upload doesn't work? Most likely upload_max_filesize or post_max_size in your PHP config is too small and PHP is silently dropping the upload. Check your current limits:
php -i | grep -E 'upload_max_filesize|post_max_size|file_uploads'
If they're too low (default is often 2MB), either edit /etc/php/8.x/apache2/php.ini directly:
file_uploads = On
upload_max_filesize = 25M
post_max_size = 27M
Or drop a .htaccess file in your blog directory:
php_value upload_max_filesize 25M
php_value post_max_size 27M
Note that post_max_size must be larger than upload_max_filesize — it covers the entire POST body including the file plus form fields.
After editing php.ini, restart Apache:
sudo systemctl restart apache2
The .htaccess approach takes effect immediately without a restart, which is handy for testing. If neither helps, also check that the uploads/ and uploads/thumbs/ directories exist and are writable by the www-data user:
ls -la uploads/
sudo chown -R www-data:www-data uploads/ posts/
License
GPLv3 - see the LICENSE file for details.