
CONTACT
43/3 Lalbagh, Dhaka 1205
arafat.rony1999@gmail.com
+880 1879 923111

Before uploading, make sure your project is ready for production:
1. Run database migrations:
php artisan migrate --force2. Install dependencies in production mode:
composer install --optimize-autoloader --no-dev
3. Optimize configuration and routes:
php artisan config:cache
php artisan route:cache
php artisan view:cacheShared Hosting (cPanel/FTP):
Upload all project files to your hosting account.
Typically, the public_html folder is your root. Place Laravel’s public folder contents inside public_html.
Keep the rest of your Laravel files in a separate directory (e.g., laravel_project) for security.
VPS or Dedicated Server:
Use SSH to clone or upload your project into /var/www/yourdomain.com.
.env FileEdit your .env file on the server with:
Database credentials (from your hosting or VPS).
APP_URL to your domain name.
Storage or mail settings if needed.
Example:
APP_NAME=Laravel
APP_ENV=production
APP_URL=https://yourdomain.com
APP_KEY=base64:xxxxxxLaravel’s entry point is public/index.php. On cPanel, set your domain’s document root to the public folder.
If you’re on a VPS with Nginx/Apache:
Point the server block (Nginx) or virtual host (Apache) to project_path/public.
Run these commands to allow Laravel to write to necessary directories:
chmod -R 775 storage bootstrap/cacheNow open your domain in a browser. If configured correctly, your Laravel website should load successfully! 🎉
Hosting a Laravel website involves preparing your project, uploading files, configuring the .env file, and pointing your domain to the public folder. Whether you’re using cPanel shared hosting or a VPS server, following these steps ensures a smooth deployment. For larger projects, you can explore Laravel Forge, Docker, or cloud hosting platforms for more advanced deployment options.
👉 Do you want me to write this specifically for cPanel hosting (step-by-step with screenshots style), or keep it general for both shared hosting and VPS?
php artisan config:cache
php artisan route:cache
php artisan view:cache
composer install --optimize-autoloader --no-dev
php artisan migrate --force