Building Your Portfolio Experience
Loading Tariqul Islam's projects...
Loading Tariqul Islam's projects...
Deploy PipraPay on a VPS using Docker and Traefik with this production-ready guide. Learn how to set up a secure MySQL database, configure reverse proxy routing, enable automatic HTTPS, and manage a scalable payment system for your SaaS or web application.
PipraPay is a powerful payment automation system that allows developers and businesses to integrate payment collection, transaction tracking, and payout workflows into their platforms.
In this guide, you will learn how to deploy PipraPay on a VPS using Docker and Traefik, creating a secure, scalable, and production-ready environment. This setup is ideal for SaaS platforms, eCommerce systems, and custom applications that require a reliable payment backend.
Using Docker provides several advantages in a production environment:
Consistent deployment across environments
Isolation from other applications on the server
Simplified dependency management
Easy scaling and portability
Seamless integration with reverse proxies like Traefik
Before starting, ensure you have the following:
A VPS running Ubuntu (22.04 or later recommended)
A domain or subdomain (e.g., pay.yourdomain.com)
Docker and Docker Compose installed
A reverse proxy setup (Traefik recommended)
If you have not yet set up your VPS or Docker environment, refer to your base deployment setup guide.
This deployment uses two main services:
piprapay-db: MySQL database container
piprapay-app: PipraPay application (PHP/Laravel-based)
Both services communicate over a shared Docker network, and Traefik handles routing and HTTPS.
Make file path
mkdir -p /srv/apps/piprapay & cd /srv/apps/piprapayClone piprapay repository
git clone https://github.com/PipraPay/PipraPay.gitCreate a Dockerfile file
FROM php:8.2-apache
RUN apt-get update && apt-get install -y \
git \
unzip \
curl \
libzip-dev \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libonig-dev \
libxml2-dev \
libmagickwand-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install pdo pdo_mysql mysqli mbstring zip exif pcntl bcmath gd \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& a2enmod rewrite headers remoteip \
&& echo 'SetEnvIf X-Forwarded-Proto "https" HTTPS=on' > /etc/apache2/conf-available/forwarded-proto.conf \
&& a2enconf forwarded-proto \
&& rm -rf /var/lib/apt/lists/*Create a docker-compose.yml file:
services:
piprapay-db:
image: mysql:8.0
container_name: piprapay-db
restart: unless-stopped
environment:
MYSQL_DATABASE: piprapay
MYSQL_USER: piprapay
MYSQL_PASSWORD: strongpassword
MYSQL_ROOT_PASSWORD: strongrootpassword
volumes:
- piprapay_mysql_data:/var/lib/mysql
command: --default-authentication-plugin=mysql_native_password
networks:
- proxy
piprapay-app:
build: .
container_name: piprapay-app
restart: unless-stopped
depends_on:
- piprapay-db
working_dir: /var/www/html
volumes:
- ./PipraPay:/var/www/html
environment:
APP_ENV: production
APP_DEBUG: "false"
DB_CONNECTION: mysql
DB_HOST: piprapay-db
DB_PORT: 3306
DB_DATABASE: piprapay
DB_USERNAME: piprapay
DB_PASSWORD: strongpassword
HTTPS: "on"
HTTP_X_FORWARDED_PROTO: "https"
SERVER_PORT: 443
labels:
- traefik.enable=true
- traefik.docker.network=proxy
- traefik.http.routers.piprapay.rule=Host(`pay.yourdomain.com`)
- traefik.http.routers.piprapay.entrypoints=websecure
- traefik.http.routers.piprapay.tls.certresolver=letsencrypt
- traefik.http.services.piprapay.loadbalancer.server.port=80
- traefik.http.middlewares.piprapay-https.headers.customrequestheaders.X-Forwarded-Proto=https
- traefik.http.routers.piprapay.middlewares=piprapay-https
networks:
- proxy
volumes:
piprapay_mysql_data:
networks:
proxy:
external: trueIn your domain provider dashboard, create an A record:
Host: pay.yourdomain.com
Value: Your VPS IP address
Wait for DNS propagation before proceeding.
docker exec -it piprapay-app bash -c "chown -R www-data:www-data /var/www/html"
docker exec -it piprapay-app bash -c "chmod -R 755 /var/www/html"
docker exec -it piprapay-app bash -c "chmod -R 777 /var/www/html/pp-content"
docker exec -it piprapay-app bash -c "chmod -R 777 /var/www/html/pp-media"From your project directory, run:
docker compose up -d --buildOnce the containers are running, open:
If Traefik is configured properly:
SSL certificates will be generated automatically via Let’s Encrypt
All traffic will be served over HTTPS
No manual SSL setup is required
PipraPay is a PHP-based application, typically built with Laravel
It should be deployed separately from Node.js applications
Always isolate your database using a dedicated container
Ensure your reverse proxy network (proxy) exists before deployment
Ensure services restart automatically:
restart: unless-stoppedRegularly back up your MySQL volume
Use automated cron jobs for daily backups
Store backups in external storage (S3, R2, etc.)
Check logs using:
docker logs piprapay-appFor advanced monitoring, consider:
Portainer for container management
Grafana + Prometheus for metrics
To deploy updates:
git pull
docker compose down
docker compose up -d --buildThis ensures the latest code is rebuilt and deployed cleanly.
After completing this setup, you will have:
A secure payment system running on your domain
Automatic HTTPS with Traefik
A scalable Docker-based architecture
A clean and maintainable deployment workflow
Deploying PipraPay using Docker and Traefik provides a robust and production-ready payment infrastructure. This approach is ideal for developers building SaaS platforms, subscription systems, or eCommerce applications that require reliable payment processing.
With proper configuration, you can easily extend this setup to support features like automated billing, wallet systems, and webhook-based integrations.
PipraPay Website: https://piprapay.com
PipraPay Developer Documentation: https://piprapay.readme.io/reference/overview
Docker Official Website: https://www.docker.com
Docker Compose Documentation: https://docs.docker.com/compose/
Traefik Documentation: https://doc.traefik.io/traefik/
MySQL Docker Image: https://hub.docker.com/_/mysql
Let’s Encrypt (Free SSL): https://letsencrypt.org
Hostinger VPS: https://www.hostinger.com/vps-hosting
If you want a more advanced version, you can also include:
GitHub (for deployment & version control): https://github.com
Portainer (Docker GUI management): https://www.portainer.io
Cloudflare (DNS & security): https://www.cloudflare.com