Running Decoded ionCube Files in Docker Containers
How to deploy decoded ionCube PHP files in Docker containers. Remove the Loader dependency and simplify your Docker images.
Docker containers should be lightweight and portable. ionCube Loader adds unnecessary complexity. This guide shows how to deploy decoded files in Docker — no Loader needed.
The Problem with ionCube in Docker
Running ionCube-protected files in Docker requires:
- Downloading and installing the ionCube Loader in the Dockerfile
- Matching the Loader to the exact PHP version
- Increasing image size with Loader binaries
- Complex multi-stage builds
- Version pinning headaches
After decoding, you eliminate all of this.
Dockerfile Without ionCube (After Decoding)
FROM php:8.1-fpm-alpine
# Install PHP extensions (no ionCube needed!)
RUN docker-php-ext-install pdo_mysql opcache
# Copy decoded source code
COPY ./src/ /var/www/html/
# Standard PHP configuration
COPY ./php.ini /usr/local/etc/php/
EXPOSE 9000
CMD ["php-fpm"]
Compare this to a Dockerfile WITH ionCube:
FROM php:8.1-fpm-alpine
# Download and install ionCube Loader (complex!)
RUN wget -q https://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz && tar -xzf ioncube_loaders_lin_x86-64.tar.gz && cp ioncube/ioncube_loader_lin_8.1.so $(php -i | grep extension_dir | awk '{print $NF}')/ && rm -rf ioncube* && echo "zend_extension=$(php -i | grep extension_dir | awk '{print $NF}')/ioncube_loader_lin_8.1.so" > /usr/local/etc/php/conf.d/ioncube.ini
# Install PHP extensions
RUN docker-php-ext-install pdo_mysql opcache
# Copy encoded source code
COPY ./src/ /var/www/html/
Benefits of Removing ionCube from Docker
Smaller Images
No Loader binary = smaller Docker image = faster builds and deployments.
Simpler Dockerfile
No multi-step Loader installation. Just PHP extensions and source code.
Better Compatibility
Works on any Docker platform (AWS ECS, Google Cloud Run, Kubernetes, Docker Swarm).
Easier PHP Upgrades
Change the base image PHP version — no need to download a new Loader.
Faster Container Start
No Loader initialization overhead during container startup.
Docker Compose Example
version: '3.8'
services:
app:
build: .
ports:
- "8080:80"
volumes:
- ./src:/var/www/html
depends_on:
- db
db:
image: mysql:8.0
environment:
MYSQL_DATABASE: app
MYSQL_ROOT_PASSWORD: secret
No ionCube configuration needed anywhere.
Kubernetes Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: php-app
spec:
template:
spec:
containers:
- name: app
image: my-app:latest # Contains decoded PHP
ports:
- containerPort: 9000
Standard Kubernetes deployment — no special configuration for ionCube.
CI/CD Pipeline
# GitLab CI
build:
script:
# No ionCube Loader installation step!
- docker build -t my-app .
- docker push my-app
Migration Steps
- Decode all ionCube files using our decoder
- Replace encoded files with decoded versions
- Update Dockerfile to remove Loader installation
- Rebuild Docker image
- Test thoroughly
- Deploy
Conclusion
Decoded ionCube files make Docker deployment dramatically simpler. No Loader, no version matching, no complex Dockerfiles. Just standard PHP in a container.
Decode your files — free trial available.
Update: SourceGuardian support is now included
PHPDecompile now supports both ionCube and SourceGuardian protected PHP files. If your project contains a mix of protected vendor files, abandoned modules, or legacy PHP packages, you can use the same upload, trial preview, progress tracking, and download workflow for both supported encoders.
Related Articles
Reviewing Encoded PHP Before a Production Deploy
You can't review what you can't read. Learn how to prepare encoded PHP you own for a real pre-deploy code review and ship with confidence.
Using Staging Before Production for Recovered Code
Never push recovered PHP straight to production. A staging environment lets you validate behavior safely before real users and real data are involved.
PHPDecompile for ionCube and SourceGuardian Files
Use one online PHP decoder for ionCube and SourceGuardian protected files, with trial previews, secure uploads, and clean source recovery.
Decoder Guides
Ready to decode ionCube and SourceGuardian files?
Try PHPDecompile free. No credit card required.