- 1Log in to cPanelAccess cPanel at
yourdomain.com/cpanelor:2083. - 2Open File ManagerIn cPanel, go to the Files section → click File Manager.
- 3Navigate to public_htmlClick on public_html in the left directory tree.
- 4Upload the ZIP FileClick Upload → drag and drop your
[project-name]-web-[version].zip. Wait for progress bar to reach 100%.
- 1Right-click the ZIP FileRight-click on
[project-name]-web-[version].zip→ select Extract. - 2Set Extraction PathEnter
/public_htmlas destination → click Extract Files. - 3Set Document Root to /publicIn cPanel, go to Domains → your domain → Document Root → set to
/public_html/public→ click Save.
public into public_html and edit index.php paths accordingly.app/, bootstrap/, config/, public/, routes/, storage/, and .env.example.- 1Open MySQL DatabasesIn cPanel, go to Databases → MySQL® Databases.
- 2Create New DatabaseEnter database name (e.g.
myapp) → click Create Database. cPanel prefixes it (e.g.cpanelusername_myapp). - 3Add a MySQL UserGo to MySQL Users → Add New User. Enter username and strong password. Click Create User.
- 4Add User to DatabaseIn Add User To Database, select your user and database → click Add.
- 5Grant All PrivilegesOn Manage User Privileges, check ALL PRIVILEGES → click Make Changes.
.env file.- 1Copy .env.exampleIn File Manager, find
.env.example→ Right-click → Copy → rename to.env. - 2Edit the .env FileRight-click
.env→ Edit. Update values below → click Save Changes.
APP_NAME="Your App Name" APP_ENV=production APP_KEY= # Will be generated via artisan key:generate APP_DEBUG=false APP_URL=https://yourdomain.com DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=cpanelusername_myapp # Full prefixed database name DB_USERNAME=cpanelusername_script # Full prefixed username DB_PASSWORD=YourStrongPassword123! MAIL_MAILER=smtp MAIL_HOST=mail.yourdomain.com MAIL_PORT=465 [email protected] MAIL_PASSWORD=your_email_password MAIL_ENCRYPTION=ssl
cd ~/public_html
# If Composer is available globally: composer install --no-dev --optimize-autoloader # If Composer is not in PATH, download it first: php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php composer-setup.php php composer.phar install --no-dev --optimize-autoloader
# Generate application key php artisan key:generate # Run database migrations php artisan migrate --force # Create symbolic link for storage php artisan storage:link # Cache configuration and routes for performance php artisan config:cache php artisan route:cache php artisan view:cache
chmod -R 755 ~/public_html chmod -R 775 ~/public_html/storage chmod -R 775 ~/public_html/bootstrap/cache
mod_rewrite by default. Laravel's public/.htaccess is already included and handles URL rewriting automatically.# This file is included — verify it exists at public/.htaccess <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews -Indexes </IfModule> RewriteEngine On # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # Redirect Trailing Slashes If Not A Folder RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] # Send Requests To Front Controller RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule>
AllowOverride All is set. Contact your host if .htaccess rules are not being respected.- 1Set PHP Version to 8.2In cPanel, go to Software → Select PHP Version. Change to 8.2 → click Set as current.
- 2Enable Required PHP ExtensionsEnable:
openssl,pdo,pdo_mysql,mbstring,tokenizer,json,gd,curl,zip,zlib,fileinfo,exif,bcmath→ click Save. - 3Enable SSL CertificateGo to Security → SSL/TLS Status → click Run AutoSSL.
- 4Open Your WebsiteNavigate to https://yourdomain.com. The installation wizard will guide you.
public_html/public, PHP is 8.2, and all extensions are enabled.| Common Issue | Solution |
|---|---|
| 500 Internal Server Error | Check storage/logs/laravel.log; set APP_DEBUG=true temporarily |
| Database connection failed | Verify DB credentials include cPanel prefix (e.g. cpanelusername_myapp) |
| 404 on all routes | Ensure document root is public_html/public and mod_rewrite is enabled |
| Blank white page | Run php artisan config:clear via Terminal; confirm PHP is 8.2 |
| Composer not found | Download manually: php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" |
| Permission denied errors | Run chmod -R 775 storage bootstrap/cache from Terminal |
| Images/files not loading | Run php artisan storage:link to create the public storage symlink |