Installation Guide

SureCommerce

Complete installation guide for local development and production server deployment.

Before you begin: Read this guide carefully and make sure your server meets all requirements below. For the quickest setup (e.g. CodeCanyon review), use the Docker method.

📋 Server Requirements

Component Minimum Recommended
PHP8.48.4+
MySQL5.78.0+ / MariaDB 10.3+
RAM512 MB1 GB+
Disk500 MB2 GB+
Web ServerApache 2.4+ / Nginx 1.10+Nginx 1.18+

PHP Extensions

REQUIREDphp-curl — API requests
REQUIREDphp-gd — Image processing
REQUIREDphp-imagick — Advanced image manipulation
REQUIREDphp-json — JSON handling
REQUIREDphp-zip — File compression
REQUIREDphp-mbstring — Multi-byte strings
REQUIREDphp-xml — XML processing
REQUIREDphp-pdo / php-pdo_mysql — Database
REQUIREDphp-bcmath — Math operations
REQUIREDphp-tokenizer — Laravel framework
OPTIONALphp-redis — Redis cache (performance)
OPTIONALphp-opcache — Opcode cache

php.ini Recommended Settings

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
max_input_time = 300
memory_limit = 256M
max_input_vars = 3000

🚧 Quick Start — Docker (Recommended for reviewers)

Fastest method: Docker bundles PHP 8.4+, MySQL 8, and Nginx in pre-configured containers. No manual dependency installation required.
1

Extract and configure

Copy the environment file and configure the database host and application URL for Docker:
cp .env.example .env
# Edit .env:
DB_HOST=surecommerce_mysql
APP_URL=http://localhost:9059

# Optional – customize Docker port/name:
NAME_CONTAINER=surecommerce
PORTS_NGINX=9059
PORTS_MYSQL=3359
2

Start containers

docker-compose up -d
3

Install dependencies

docker exec -it surecommerce_php composer install
4

Run CMS installer

docker exec -it surecommerce_php php artisan cms:install
The terminal will display the admin username and password after installation. Save them immediately!
You can also pass custom credentials:
docker exec -it surecommerce_php php artisan cms:install "admin@yoursite.com" yourusername yourpassword
5

Start queue worker (new terminal tab)

docker exec -it surecommerce_php php artisan queue:work --queue=high,default
6

Access the application

  • Frontend: http://localhost:9059
  • Admin panel: http://localhost:9059/admin

Container names & useful commands

Default container names (prefix = NAME_CONTAINER value from .env):

surecommerce_nginx surecommerce_php surecommerce_mysql
# View running containers
docker ps

# Check logs
docker logs surecommerce_php
docker logs surecommerce_nginx

# Open shell in PHP container
docker exec -it surecommerce_php bash

# Restart all
docker-compose restart

# Stop and remove containers (keeps DB data)
docker-compose down

# Stop and remove everything including DB data
docker-compose down -v

💻 Quick Start — XAMPP / MAMP / WAMP

For Windows/Mac users who prefer not to use Docker. Requires PHP 8.4+ with all required extensions already installed in your local server.
1

Extract files to htdocs folder

  • XAMPP (Windows): C:\xampp\htdocs\surecommerce
  • MAMP (Mac): /Applications/MAMP/htdocs/surecommerce
2

Create database

Open phpMyAdmin at http://localhost/phpmyadmin and create a new database (e.g. surecommerce_db).
3

Configure .env

cp .env.example .env

# Edit .env:
APP_URL=http://localhost/surecommerce/public
DB_DATABASE=surecommerce_db
DB_USERNAME=root
DB_PASSWORD=
4

Install dependencies & run installer

cd /path/to/surecommerce
composer install
php artisan cms:install
5

Start queue worker

php artisan queue:work --queue=high,default
6

Access the application

  • Frontend: http://localhost/surecommerce/public
  • Admin: http://localhost/surecommerce/public/admin
Keep the queue worker terminal open while testing features that use background jobs (product Excel imports, email sending, etc.).

🔧 Full Production Installation

1

Upload source code

Upload all files to your server (FTP/SFTP or cPanel File Manager).
  • Upload to web root: /var/www/html or /home/yourdomain/public_html
  • Document root must point to the public/ folder
2

Set file permissions

chmod -R 755 storage bootstrap/cache public/uploads public/vendor lang/vendor
3

Create database

CREATE DATABASE surecommerce_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'surecommerce_user'@'localhost' IDENTIFIED BY 'strong_password';
GRANT ALL PRIVILEGES ON surecommerce_db.* TO 'surecommerce_user'@'localhost';
FLUSH PRIVILEGES;
4

Configure .env

Copy and edit the environment file:
cp .env.example .env
APP_NAME="surecommerce"
APP_ENV=production
APP_DEBUG=false
APP_URL=https://yourdomain.com

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=surecommerce_db
DB_USERNAME=surecommerce_user
DB_PASSWORD=strong_password

QUEUE_CONNECTION=database
Security: Always set APP_DEBUG=false in production!
Mail settings: No SMTP config needed in .env. Configure mail via Admin → Settings → Email Configuration after installation.
5

Install Composer dependencies

composer install --optimize-autoloader --no-dev
6

Run CMS installer

php artisan cms:install
Or with custom credentials:
php artisan cms:install "admin@yoursite.com" adminuser yourpassword
This command will: generate app key, run migrations, seed data, create admin account, publish assets, and clear caches.
After installation, the admin credentials will be shown in the terminal. Save them immediately!
7

Configure web server

See Server Configuration section below for Apache and Nginx config examples.
8

Set up queue workers (production)

See Queue Worker Configuration section for Supervisord setup.
9

Verify installation

  • Open https://yourdomain.com/admin
  • Login with credentials from step 6
  • Change the default password immediately

⚙️ Server Configuration

Apache — .htaccess

Ensure mod_rewrite is enabled. The .htaccess in the public/ folder should contain:

<IfModule mod_rewrite.c>
    Options -MultiViews -Indexes
    RewriteEngine On
    RewriteCond %{{HTTP:Authorization}} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{{HTTP:Authorization}}]
    RewriteCond %{{REQUEST_FILENAME}} !-d
    RewriteCond %{{REQUEST_URI}} (.+)/$
    RewriteRule ^ %1 [L,R=301]
    RewriteCond %{{REQUEST_FILENAME}} !-d
    RewriteCond %{{REQUEST_FILENAME}} !-f
    RewriteRule ^ index.php [L]
</IfModule>

Nginx — server block

server {{
    listen 80;
    server_name yourdomain.com;
    root /path/to/project/public;
    index index.php;
    charset utf-8;

    location / {{
        try_files $uri $uri/ /index.php?$query_string;
    }}
    location ~ \.php$ {{
        fastcgi_pass unix:/var/run/php/php8.4-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }}
    location ~ /\.(?!well-known).* {{
        deny all;
    }}
}}

▶️ Queue Worker Configuration

Queue workers are required for background jobs: Excel product imports, email sending, order notifications, image optimization. For local testing run php artisan queue:work --queue=high,default in a separate terminal. For production use Supervisord.

Supervisord setup (production)

1

Install Supervisor

# Ubuntu/Debian
sudo apt-get install supervisor

# CentOS/RHEL
sudo yum install supervisor
sudo systemctl enable supervisord && sudo systemctl start supervisord
2

Create config file

Copy the example:
cp supervisord.ini.example supervisord.ini
Then edit supervisord.ini and update paths:
[program:surecommerce-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /path/to/project/artisan queue:work --queue=high,default --sleep=2 --tries=2 --timeout=120
autostart=true
autorestart=true
user=www-data
numprocs=1
redirect_stderr=true
stdout_logfile=/path/to/project/storage/logs/worker.log
stopwaitsecs=3600
3

Deploy and start

sudo cp supervisord.ini /etc/supervisor/conf.d/surecommerce-worker.conf
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start surecommerce-worker:*
4

Verify

sudo supervisorctl status

Expected output: surecommerce-worker:surecommerce-worker_00 RUNNING pid 12345, uptime 0:00:10

Useful Supervisord commands

sudo supervisorctl status
sudo supervisorctl start surecommerce-worker:*
sudo supervisorctl stop surecommerce-worker:*
sudo supervisorctl restart surecommerce-worker:*
sudo supervisorctl tail -f surecommerce-worker:surecommerce-worker_00

Alternative: systemd service

[Unit]
Description=surecommerce Queue Worker
After=network.target

[Service]
User=www-data
Group=www-data
Restart=always
ExecStart=/usr/bin/php /path/to/project/artisan queue:work --queue=high,default --sleep=2 --tries=2 --timeout=120

[Install]
WantedBy=multi-user.target
sudo systemctl enable surecommerce-worker
sudo systemctl start surecommerce-worker
sudo systemctl status surecommerce-worker

Mail Configuration

After installation, configure SMTP via Admin Panel → Settings → Email Configuration. No need to edit .env manually.

  1. Login to Admin Panel at /admin
  2. Navigate to Settings → Email Configuration
  3. Enter SMTP Host, Port, Username, Password, Encryption, and From address
  4. Use the built-in Send Test Email button to verify
  5. Save settings
Some servers block outbound SMTP ports 587/465. Contact your hosting provider if emails are not sending. You can open these ports with: sudo ufw allow 587/tcp && sudo ufw reload

🔎 Troubleshooting

⚠️ 500 Internal Server Error

  1. Check file permissions:
    chmod -R 755 storage bootstrap/cache
  2. Check Laravel logs:
    cat storage/logs/laravel.log
  3. Verify .env exists and database credentials are correct
  4. Ensure all required PHP extensions are installed
  5. Clear all caches:
    php artisan optimize:clear

⚠️ composer: command not found

  • Install Composer:
    curl -sS https://getcomposer.org/installer | php
  • Use php composer.phar install instead of composer install

⚠️ SQLSTATE[HY000] [1045] Access denied

  • Check DB credentials in .env: DB_HOST, DB_DATABASE, DB_USERNAME, DB_PASSWORD
  • Verify the database user has ALL PRIVILEGES on the database
  • Try DB_HOST=127.0.0.1 instead of localhost

⚠️ Images not uploading or displaying

  • Check permissions:
    chmod -R 755 public/uploads
  • Verify php-gd and php-imagick extensions are enabled
  • Check upload_max_filesize and post_max_size in php.ini

⚠️ Background jobs not processing (Excel import, email, etc.)

  • Confirm the queue worker is running:
    sudo supervisorctl status
  • Start worker if stopped:
    sudo supervisorctl start surecommerce-worker:*
  • Check failed jobs:
    php artisan queue:failed
  • Retry failed jobs:
    php artisan queue:retry all
  • Check worker logs:
    sudo supervisorctl tail -f surecommerce-worker:surecommerce-worker_00

⚠️ Updates not taking effect after code deploy

  1. Clear all caches:
    php artisan optimize:clear
  2. Restart queue workers (critical!):
    sudo supervisorctl restart surecommerce-worker:*

    Workers load PHP classes into memory at startup — they will not see new code until restarted.

  3. Clear browser cache (Ctrl+Shift+Delete)

⚠️ PDF export / QR images not showing in Docker

This affects the Warranty module when queue workers run inside Docker containers and cannot resolve localhost image URLs.

  1. In packages/warranty/resources/views/serial/pdf/print_item.blade.php, uncomment the base64 image block for Docker/localhost environments
  2. Run php artisan queue:restart to reload workers with the change

✅ After Installation — What to Test

For Reviewers: Quick checklist of features to verify after running cms:install.

Admin Panel Features

Login: /admin with credentials from cms:install output
Dashboard: Statistics overview
Products: Create, edit, import via Excel
Orders: View and manage customer orders
Blog/Posts: Create and manage articles
Pages: Manage static pages
Users: Admin user management and roles
Settings: Mail, SEO, payments, theme
Media Manager: Upload, crop, organize images
Warranty Module: Batch & serial management

Queue-dependent features to test

These require a running queue worker to function:

  • Excel product import (Admin → Products → Import)
  • Email sending (password reset, order notifications)
  • Image optimization on upload
  • Warranty serial code generation
# Run locally (keep this terminal open):
php artisan queue:work --queue=high,default

# Check for failed jobs:
php artisan queue:failed

Post-Installation Security Checklist

Change the default admin password immediately after first login
Set APP_DEBUG=false in .env (production)
Enable HTTPS with a valid SSL certificate
Set correct file permissions (755 on storage & uploads)
Enable Two-Factor Authentication for admin accounts (Settings → Security)
Ensure .env is not publicly accessible
Schedule regular database backups

SureCommerce — Installation Guide

© 2026 DreamTeam. All rights reserved.  |  FAQ  |  User Guide