This Docker image provides an efficient web server with secure file synchronization via LFTP.
1.5K
PHP-LFTP Docker Image (Optimized Trixie Builds)
This Docker image provides a efficient web server based on PHP 8.4 / 8.5 with Apache, designed to serve PHP applications while supporting secure file synchronization via lftp. It comes pre-configured with commonly used PHP extensions and allows PHP scripts to execute lftp commands via sudo for fetching files over FTP, FTPS, or SFTP.
✅ Features
Base Image: Built on the official PHP 8.4 / 8.5 Trixie image with Apache support, ensuring stability and compatibility for modern PHP applications.
Pre-installed PHP Extensions: Includes essential extensions for most web applications:
File Synchronization with lftp:
Apache Configuration:
Production-ready PHP:
🚀 Getting Started
Pull the image from Docker Hub:
Run the PHP 8.4 container:
docker run -d --name webserver -p 80:80 chrno79/php-lftp:latest
Run the PHP 8.5 container:
docker run -d --name webserver -p 80:80 chrno79/php-lftp:dev
This will start Apache on port 80.
📁 Volume Mapping
To serve your PHP files:
docker run -d --name webserver -p 80:80 \
-v /path/to/your/php/files:/var/www/html \
chrno79/php-lftp:latest
Replace /path/to/your/php/files with the path to your PHP application.
🔧 Using RemoteIP
To forward the real client IP from a reverse proxy, mount your remoteip.conf:
RemoteIPHeader X-Forwarded-For
RemoteIPTrustedProxy 172.18.0.0/16 <-- Webspace Network
RemoteIPTrustedProxy 172.19.0.0/24 <-- Reverse Proxy Network
Mount it:
docker run -d --name webserver -p 80:80 \
-v /path/to/remoteip.conf:/etc/apache2/conf-enabled/remoteip.conf:ro \
-v /path/to/your/php/files:/var/www/html \
chrno79/php-lftp:latest
The container automatically enables the config at startup.
Nginx-Proxy-Manager:
Edit Proxy Host -> Advanced -> Custom Nginx Configuration:
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
🔧 Mount with custom php.ini:
You can provide your own PHP configuration:
docker run -d --name webserver -p 80:80 \
-v /path/to/remoteip.conf:/etc/apache2/conf-enabled/remoteip.conf:ro \
-v /path/to/your/php/files:/var/www/html \
-v /path/to/your/custom_php.ini:/usr/local/etc/php/php.ini
chrno79/php-lftp:latest
🤝 Contributing
Contributions are welcome! Fork the repository and submit pull requests for improvements, new features, or updated extensions.
Content type
Image
Digest
sha256:b5c2f795b…
Size
398.3 MB
Last updated
7 months ago
docker pull chrno79/php-lftp