SureCommerce
Complete installation guide for local development and production server deployment.
Jump to section
📋 Server Requirements
| Component | Minimum | Recommended |
|---|---|---|
| PHP | 8.4 | 8.4+ |
| MySQL | 5.7 | 8.0+ / MariaDB 10.3+ |
| RAM | 512 MB | 1 GB+ |
| Disk | 500 MB | 2 GB+ |
| Web Server | Apache 2.4+ / Nginx 1.10+ | Nginx 1.18+ |
PHP Extensions
php-curl — API requestsphp-gd — Image processingphp-imagick — Advanced image manipulationphp-json — JSON handlingphp-zip — File compressionphp-mbstring — Multi-byte stringsphp-xml — XML processingphp-pdo / php-pdo_mysql — Databasephp-bcmath — Math operationsphp-tokenizer — Laravel frameworkphp-redis — Redis cache (performance)php-opcache — Opcode cachephp.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)
Extract and configure
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=3359Start containers
docker-compose up -dInstall dependencies
docker exec -it surecommerce_php composer installRun CMS installer
docker exec -it surecommerce_php php artisan cms:install
docker exec -it surecommerce_php php artisan cms:install "admin@yoursite.com" yourusername yourpasswordStart queue worker (new terminal tab)
docker exec -it surecommerce_php php artisan queue:work --queue=high,defaultAccess 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):
# 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
Extract files to htdocs folder
- XAMPP (Windows):
C:\xampp\htdocs\surecommerce - MAMP (Mac):
/Applications/MAMP/htdocs/surecommerce
Create database
http://localhost/phpmyadmin and create a new database (e.g. surecommerce_db).Configure .env
cp .env.example .env
# Edit .env:
APP_URL=http://localhost/surecommerce/public
DB_DATABASE=surecommerce_db
DB_USERNAME=root
DB_PASSWORD=Install dependencies & run installer
cd /path/to/surecommerce
composer install
php artisan cms:installStart queue worker
php artisan queue:work --queue=high,defaultAccess the application
- Frontend:
http://localhost/surecommerce/public - Admin:
http://localhost/surecommerce/public/admin
🔧 Full Production Installation
Upload source code
- Upload to web root:
/var/www/htmlor/home/yourdomain/public_html - Document root must point to the
public/folder
Set file permissions
chmod -R 755 storage bootstrap/cache public/uploads public/vendor lang/vendorCreate 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;Configure .env
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
APP_DEBUG=false in production!Install Composer dependencies
composer install --optimize-autoloader --no-devRun 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.
Configure web server
Set up queue workers (production)
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
php artisan queue:work --queue=high,default in a separate terminal. For production use Supervisord.Supervisord setup (production)
Install Supervisor
# Ubuntu/Debian
sudo apt-get install supervisor
# CentOS/RHEL
sudo yum install supervisor
sudo systemctl enable supervisord && sudo systemctl start supervisordCreate config file
cp supervisord.ini.example supervisord.iniThen 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=3600Deploy and start
sudo cp supervisord.ini /etc/supervisor/conf.d/surecommerce-worker.conf
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start surecommerce-worker:*Verify
sudo supervisorctl statusExpected 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.
- Login to Admin Panel at
/admin - Navigate to Settings → Email Configuration
- Enter SMTP Host, Port, Username, Password, Encryption, and From address
- Use the built-in Send Test Email button to verify
- Save settings
sudo ufw allow 587/tcp && sudo ufw reload🔎 Troubleshooting
⚠️ 500 Internal Server Error
- Check file permissions:
chmod -R 755 storage bootstrap/cache - Check Laravel logs:
cat storage/logs/laravel.log - Verify
.envexists and database credentials are correct - Ensure all required PHP extensions are installed
- Clear all caches:
php artisan optimize:clear
⚠️ composer: command not found
- Install Composer:
curl -sS https://getcomposer.org/installer | php - Use
php composer.phar installinstead ofcomposer 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.1instead oflocalhost
⚠️ Images not uploading or displaying
- Check permissions:
chmod -R 755 public/uploads - Verify
php-gdandphp-imagickextensions are enabled - Check
upload_max_filesizeandpost_max_sizein 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
- Clear all caches:
php artisan optimize:clear - 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.
- 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.
- In
packages/warranty/resources/views/serial/pdf/print_item.blade.php, uncomment the base64 image block for Docker/localhost environments - Run
php artisan queue:restartto reload workers with the change
✅ After Installation — What to Test
cms:install.Admin Panel Features
/admin with credentials from cms:install outputQueue-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
APP_DEBUG=false in .env (production)SureCommerce — Installation Guide
© 2026 DreamTeam. All rights reserved. | FAQ | User Guide