How to Host a Laravel Website on Plesk
What You'll Need
Before starting, make sure you have:
- A Plesk server with the Laravel Toolkit extension installed
- Your Laravel application ready to upload (or create a new one)
- Database access (MySQL/MariaDB)
- Basic knowledge of Laravel
Note: This guide assumes your hosting provider has already installed the Laravel Toolkit extension. If the Laravel option doesn't appear in your Plesk panel, contact your hosting provider.
What is Laravel Toolkit?
The Laravel Toolkit is a Plesk extension that simplifies hosting Laravel applications. It provides:
- One-click Laravel installation - Create new Laravel apps instantly
- Integrated tools - PHP, Composer, Artisan, npm, MySQL, and Git all in one place
- No SSH required - Manage everything from Plesk interface
- Artisan commands - Run Laravel commands directly from the panel
- Git integration - Deploy and update from remote repositories
- Environment management - Edit
.envfiles easily - Log viewing - Access Laravel logs from Plesk
- Automatic SSL - Secure your application with Let's Encrypt
Method 1: Create a New Laravel Application
This is the easiest way to get started with Laravel on Plesk.
Step 1: Add a New Domain
- Log in to Plesk
- Go to Websites & Domains
- Click the Add Domain button
Step 2: Select Laravel Site
- From the list of available options, select Laravel site
- You'll see a Laravel-specific setup screen
Step 3: Configure Domain Settings
Fill in the following information:
Domain name:
- Enter your domain name (e.g.,
mylaravelapp.com) - Or subdomain (e.g.,
app.mydomain.com)
PHP Version:
- Select the PHP version for your Laravel app
- Laravel 10.x requires PHP 8.1 or higher
- Laravel 9.x requires PHP 8.0 or higher
- Choose the latest compatible version
Project Name:
- Give your Laravel project a name
- This will be used for the directory structure
Installation Method: Choose one of the following:
Option A: Create New Application
- Creates a fresh Laravel installation
- Best for new projects
Option B: Deploy from Git Repository
- Enter your Git repository URL
- Provide credentials if private repository
- Best for existing Laravel projects
Step 4: Start Installation
- Click Install Application (or similar button)
- Plesk will automatically:
- Install Laravel via Composer
- Set up the directory structure
- Configure PHP settings
- Generate application key
- Set proper permissions
- Wait for the installation to complete (1-3 minutes)
Step 5: Access Your Application
Once installation is complete:
- You'll see a confirmation message
- Click Open in Browser to view your Laravel app
- You should see the default Laravel welcome page
Method 2: Upload Existing Laravel Application
If you already have a Laravel application, you can upload it to Plesk.
Step 1: Upload Application Files
Using File Manager:
- Go to Websites & Domains
- Find your domain and click Files
- Navigate to the document root (usually
/httpdocs) - Upload your Laravel application files
- Preserve the directory structure
Using FTP/SFTP:
- Connect with your FTP client
- Upload all Laravel files to your domain directory
- Don't upload
.envfile (you'll configure this in Plesk)
Using Git:
- Go to Websites & Domains
- Click Git
- Clone your repository
Step 2: Set Up Laravel in Plesk
- Go to Websites & Domains
- Click Manage Laravel Application on your domain
- Plesk will detect your Laravel installation
Configure Your Laravel Application
After installation, you need to configure your application properly.
Step 1: Access Laravel Dashboard
- Go to Websites & Domains
- Find your Laravel domain
- Click Manage Laravel Application
You'll see the Laravel management dashboard with several tabs:
- Information - Overview and quick actions
- Environment - Edit
.envfile - Artisan - Run Laravel Artisan commands
- Composer - Manage PHP dependencies
- NPM - Manage JavaScript dependencies
- Deployment - Configure Git deployments
- Scheduled Tasks - View Laravel scheduled jobs
- Logs - View application logs
Step 2: Create and Configure Database
Laravel applications typically need a database.
Create Database
- From the Laravel Information dashboard, click Manage domain
- Click Databases
- Click Add Database
- Enter database details:
- Database name: e.g.,
myapp_db - Database user: e.g.,
myapp_user - Password: Create a strong password
- Database name: e.g.,
- Click OK
Remember these credentials - you'll need them for the next step.
Step 3: Configure Environment Variables
Laravel uses the .env file for configuration. Edit it in Plesk:
- Go back to Manage Laravel Application
- Click the Environment tab
- Click Edit on the
.envfile
Update the following values:
APP_NAME="My Laravel App"
APP_ENV=production
APP_DEBUG=false
APP_URL=https://yourdomain.com
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=myapp_db
DB_USERNAME=myapp_user
DB_PASSWORD=your_database_password
Important settings:
APP_ENV:
- Use
localfor development - Use
productionfor live sites
APP_DEBUG:
- Set to
truefor development (shows detailed errors) - Set to
falsefor production (hides sensitive information)
APP_KEY:
- Should be automatically generated
- If missing, generate it using Artisan (see below)
Database settings:
- Use the credentials from Step 2
- Click Save when done
Step 4: Generate Application Key (If Needed)
If your .env file doesn't have an APP_KEY:
- Go to Artisan tab
- Find and run the
key:generatecommand - This will add a secure key to your
.envfile
Step 5: Run Database Migrations
Create your database tables:
- Go to Artisan tab
- Find the
migratecommand - Click Run
- Wait for migrations to complete
What this does:
- Creates all database tables
- Sets up the schema for your application
If you need to seed data:
- Run
db:seedcommand - Or run
migrate:fresh --seedto reset and seed
Managing Your Laravel Application
Run Artisan Commands
Artisan is Laravel's command-line tool. In Plesk, you can run Artisan commands without SSH:
- Go to Artisan tab
- Select a command from the dropdown:
cache:clear- Clear application cacheconfig:cache- Cache configurationroute:list- List all routesmigrate- Run migrationsdb:seed- Seed databasequeue:work- Process queue jobsstorage:link- Create symbolic link for storage
- Add any parameters if needed
- Click Run
Custom commands:
- Enter custom Artisan commands in the text field
- Example:
make:controller UserController
Manage Composer Dependencies
When you update your composer.json file:
- Go to Composer tab
- Select a command:
install- Install dependenciesupdate- Update dependenciesdump-autoload- Regenerate autoload files
- Click Run
Common use cases:
- After pulling code updates
- When adding new packages
- After changing namespace
Manage NPM Dependencies
For frontend assets:
- Go to NPM tab
- Run commands:
npm install- Install packagesnpm run dev- Build for developmentnpm run prod- Build for productionnpm run build- Compile assets
View Scheduled Tasks
If your Laravel app uses task scheduling:
- Go to Scheduled Tasks tab
- View all scheduled jobs
- See when they run and their status
Note: The Laravel scheduler requires a cron job. Plesk usually sets this up automatically.
View Application Logs
To troubleshoot or monitor your application:
- Go to Logs tab (or click Logs button on domain)
- View Laravel application logs
- Filter by log level (error, warning, info)
- Download logs if needed
Log location:
- Laravel logs are typically in
storage/logs/laravel.log
Deploy from Git Repository
Keep your Laravel application updated with Git.
Step 1: Configure Deployment
- Go to Deployment tab
- Enter your Git repository URL
- If private repository:
- Add SSH key or
- Enter username/password
- Select branch (usually
mainormaster)
Step 2: Configure Deployment Script
Plesk will run these commands after pulling code:
Default deployment script:
composer install --no-dev
php artisan migrate --force
php artisan config:cache
php artisan route:cache
php artisan view:cache
You can customize this script:
- Click Edit Deployment Script
- Add or modify commands
- Click Save
Common additions:
npm install
npm run prod
php artisan queue:restart
Step 3: Deploy Updates
To update your application:
- Click Update button
- Plesk will:
- Pull latest code from Git
- Run Composer install
- Run migrations
- Clear and cache configs
- View deployment logs to verify success
Automatic deployments:
- Configure webhooks in your Git provider
- Plesk can auto-deploy on Git push
Optimize Your Laravel Application
Cache Configuration for Production
- Go to Artisan tab
- Run these commands in order:
config:cache- Cache configuration filesroute:cache- Cache routesview:cache- Cache Blade viewsevent:cache- Cache events
When to cache:
- After deploying to production
- After changing config files
- For better performance
Clear cache when:
- After code changes
- If seeing stale data
- During development
Storage Link
If your app uses public storage:
- Go to Artisan tab
- Run
storage:linkcommand - This creates a symbolic link from
public/storagetostorage/app/public
Queue Workers
If using Laravel queues:
- Set up queue workers in Plesk
- Run
queue:workcommand - Configure supervisor or use Plesk's process manager
Secure Your Laravel Application
Enable SSL Certificate
- Go to Websites & Domains
- Find your domain
- Click SSL/TLS Certificates
- Install Let's Encrypt certificate (free)
- Enable Redirect from HTTP to HTTPS
Security Best Practices
Production .env settings:
APP_ENV=production
APP_DEBUG=false
File permissions:
- Plesk sets these automatically
- Storage and cache folders should be writable
Hide sensitive files:
.envfile should not be publicly accessible- Plesk configures this automatically
Troubleshooting
White Screen or 500 Error
Solutions:
- Check Logs tab for error details
- Verify
.envfile is configured correctly - Run
php artisan config:clear - Check file permissions
- Enable debug temporarily:
APP_DEBUG=true
Database Connection Error
Solutions:
- Verify database credentials in
.env - Check database exists
- Test database connection in Plesk
- Verify
DB_HOSTislocalhost
Page Not Found (404) for Routes
Solutions:
- Check
.htaccessfile exists inpublic/ - Run
php artisan route:cache - Clear route cache:
php artisan route:clear - Verify document root points to
public/folder
Changes Not Appearing
Solutions:
- Clear caches:
php artisan cache:clearphp artisan config:clearphp artisan view:clear
- Restart application
- Clear browser cache
Composer/NPM Commands Fail
Solutions:
- Check PHP version compatibility
- Verify Composer is installed
- Check for syntax errors in
composer.json - Try running with
--no-scriptsflag
Best Practices
Development vs Production
Development:
APP_ENV=local
APP_DEBUG=true
- More verbose errors
- Hot reload for changes
- Detailed logging
Production:
APP_ENV=production
APP_DEBUG=false
- Cache configurations
- Hide error details
- Minimal logging
Regular Maintenance
- Update dependencies regularly:
- Run
composer updateperiodically - Test in staging first
- Run
- Monitor logs:
- Check error logs daily
- Set up log rotation
- Backup database:
- Use Plesk backup tools
- Schedule automatic backups
- Keep Laravel updated:
- Follow Laravel upgrade guides
- Test in development first
Performance Tips
- Use caching:
- Cache configs, routes, and views
- Use Redis for session/cache
- Optimize database:
- Use indexes
- Optimize queries with eager loading
- Use queue for heavy tasks:
- Email sending
- Image processing
- API calls
Summary
To host a Laravel application on Plesk:
- Create Laravel site from Add Domain menu
- Configure database and update
.envfile - Run migrations using Artisan commands
- Deploy from Git (optional) for easy updates
- Cache configs for production performance
- Enable SSL for security
- Monitor logs for issues
Your Laravel application is now live and ready to use!
Additional Features
- Laravel Horizon - Monitor queues (install separately)
- Laravel Telescope - Debug tool (development only)
- Task Scheduler - Automatic via Plesk cron
- Multiple apps - Host multiple Laravel apps on one server
Laravel Toolkit makes hosting Laravel applications simple and efficient!


















