Installation Guide

System Requirements

Server Specifications

  • Operating System: Ubuntu 20.04 LTS or CentOS 8+
  • CPU: 4+ cores (8 recommended for high traffic)
  • RAM: 16GB minimum (32GB recommended)
  • Storage: 100GB SSD (NVMe preferred)
  • Network: 1Gbps connection

Software Dependencies

  • Nginx 1.20+ or Apache 2.4+
  • PHP 8.1+ with extensions (mysqli, curl, gd, mbstring, xml, zip)
  • MySQL 8.0+ or PostgreSQL 13+
  • Redis 6.0+ for caching
  • Node.js 16+ for real-time features

Pre-Installation Steps

1. Server Preparation

apt update && apt upgrade -y
apt install nginx mysql-server redis-server php8.1-fpm

2. Database Creation

Create dedicated database with proper collation:

CREATE DATABASE casino_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'casino_user'@'localhost' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON casino_db.* TO 'casino_user'@'localhost';

3. SSL Certificate Setup

Configure Let’s Encrypt for HTTPS:

certbot --nginx -d yourdomain.com -d www.yourdomain.com

Installation Process

Step 1: Upload Files

Extract package contents to web root directory. Set proper permissions:

chown -R www-data:www-data /var/www/casino
chmod -R 755 /var/www/casino
chmod -R 775 /var/www/casino/storage

Step 2: Configuration

Edit config.php with database credentials and site settings:

  • Database connection parameters
  • Site URL and domain
  • API keys for payment processors
  • Game provider credentials
  • Email server configuration

Step 3: Database Migration

Run installation script to create tables:

php install.php

Script creates 47 tables including users, games, transactions, sessions, bonuses.

Step 4: Admin Account

Access /admin/setup to create administrator credentials. First user gets superadmin privileges automatically.

Step 5: Cron Jobs

Configure scheduled tasks for system maintenance:

*/5 * * * * php /var/www/casino/cron/process_games.php
0 * * * * php /var/www/casino/cron/update_balances.php
0 0 * * * php /var/www/casino/cron/daily_reports.php

Post-Installation Configuration

Payment Gateway Integration

Navigate to Admin > Payment Settings and configure processors with API credentials. Test mode available for verification before going live.

Game Provider Setup

Add provider API keys in Admin > Game Providers. System automatically fetches game libraries after key validation.

License Verification

Enter license key in Admin > System Settings. License validates against our servers and enables all features.

Troubleshooting

Common Installation Issues

Database Connection Failed

Verify credentials in config.php match database user. Check MySQL service running:

systemctl status mysql

Permission Errors

Ensure web server user owns files and storage directory writable:

ls -la /var/www/casino

White Screen After Installation

Check PHP error logs for details:

tail -f /var/log/nginx/error.log

Performance Optimization

Enable OPcache

Add to php.ini:

opcache.enable=1
opcache.memory_consumption=256
opcache.max_accelerated_files=20000

Redis Configuration

Edit redis.conf for production:

maxmemory 2gb
maxmemory-policy allkeys-lru

Nginx Optimization

Configure worker processes and connections:

worker_processes auto;
worker_connections 4096;

Security Hardening

Firewall Configuration

ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable

Disable Directory Listing

Add to nginx server block:

autoindex off;

Hide PHP Version

Add to php.ini:

expose_php = Off

Backup Strategy

Automated Database Backups

Create backup script:

#!/bin/bash
DATE=$(date +%Y%m%d_%H%M%S)
mysqldump -u casino_user -p casino_db > /backups/db_$DATE.sql
find /backups -name "db_*.sql" -mtime +7 -delete

File System Backups

Schedule rsync for files:

rsync -avz /var/www/casino/ /backups/files/

Monitoring Setup

Server Monitoring

Install monitoring tools:

apt install htop iotop nethogs

Application Logs

Log locations:

  • Application: /var/www/casino/storage/logs/
  • Nginx: /var/log/nginx/
  • PHP: /var/log/php8.1-fpm.log
  • MySQL: /var/log/mysql/

Next Steps

After successful installation:

  1. Configure payment processors in admin panel
  2. Add game provider API credentials
  3. Customize branding and theme
  4. Set up email templates
  5. Configure bonus rules
  6. Test all functionality in staging
  7. Enable SSL and force HTTPS
  8. Launch production environment
Casino Clone