Manual Installation

This guide covers installing Auto Commerce on a traditional server without Docker.

Prerequisites

Ensure your server has:

  • PHP 8.2+ with extensions: pdo, pdo_pgsql (or pdo_mysql), mbstring, openssl, tokenizer, xml, ctype, json, bcmath, redis, gd
  • Composer 2.x
  • PostgreSQL 14+ or MySQL 8+
  • Redis 6+
  • Node.js 18+ and npm
  • Nginx or Apache
  • Git

Step 1: Clone Repository

git clone https://github.com/your-org/autocom.git
cd autocom

Step 2: Backend Setup

cd backend

# Install PHP dependencies
composer install --no-dev --optimize-autoloader

# Copy and configure environment
cp .env.example .env

# Generate application key
php artisan key:generate

Edit .env with your database and Redis configuration:

APP_URL=https://your-domain.com

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=autocom
DB_USERNAME=your_db_user
DB_PASSWORD=your_db_password

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

Step 3: Frontend Setup

cd ../frontend

# Install Node dependencies
npm ci

# Configure environment
cp .env.example .env.local

# Build for production
npm run build

Edit .env.local:

NEXT_PUBLIC_API_URL=https://api.your-domain.com

Step 4: Set Permissions

# Set ownership
chown -R www-data:www-data backend/storage backend/bootstrap/cache

# Set permissions
chmod -R 775 backend/storage
chmod -R 775 backend/bootstrap/cache

Step 5: Configure Web Server

Nginx Configuration

Create /etc/nginx/sites-available/autocom-api:

server {
    listen 80;
    server_name api.your-domain.com;
    root /var/www/autocom/backend/public;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-Content-Type-Options "nosniff";

    index index.php;

    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

For the frontend, you can run Next.js with PM2:

npm install -g pm2
cd /var/www/autocom/frontend
pm2 start npm --name "autocom-frontend" -- start
pm2 save

Or use a reverse proxy to the Next.js server.

Enable Sites

ln -s /etc/nginx/sites-available/autocom-api /etc/nginx/sites-enabled/
nginx -t
systemctl reload nginx

Step 6: Configure Queue Worker

Create a systemd service for the queue worker:

sudo nano /etc/systemd/system/autocom-queue.service
[Unit]
Description=Auto Commerce Queue Worker
After=network.target

[Service]
User=www-data
Group=www-data
Restart=always
WorkingDirectory=/var/www/autocom/backend
ExecStart=/usr/bin/php artisan queue:work redis --sleep=3 --tries=3 --max-time=3600

[Install]
WantedBy=multi-user.target

Enable and start:

sudo systemctl enable autocom-queue
sudo systemctl start autocom-queue

Step 7: Access Installation Wizard

Navigate to your domain in a browser. You'll be redirected to the Installation Wizard to complete setup.

See Installation Wizard for detailed steps.

Step 8: Configure Scheduler

Add the Laravel scheduler to crontab:

crontab -e

Add this line:

* * * * * cd /var/www/autocom/backend && php artisan schedule:run >> /dev/null 2>&1

SSL Configuration

Use Certbot for free SSL certificates:

sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d api.your-domain.com -d your-domain.com

Next Steps