In this useful article, I guide you on how to Deploy PHP & Laravel Website on HestiaCP (Step-by-Step Guide). If you are a developer or website owner looking for an easy and efficient way to host a PHP or Laravel website, Hestia Control Panel (HestiaCP) is one of the best free options.
It offers a clean dashboard, strong security, and full server management features like web hosting, email, databases, SSL, and DNS. In this guide, we will walk you through the complete process of deploying a PHP or Laravel website on HestiaCP.
Why Choose HestiaCP for PHP & Laravel Hosting?
HestiaCP is a free and open-source control panel designed for VPS hosting. It supports multiple PHP versions and provides easy management of:
- Nginx + Apache
- PHP-FPM
- MySQL / MariaDB
- SSL (Let’s Encrypt)
- FTP & SFTP
- DNS and Mail
If you want a fast, secure, and user-friendly environment for Laravel or PHP, HestiaCP is an excellent choice. For a more detailed article, read also this article install Hestia CPanel on VPS.
Prerequisites Before Deploying Laravel
Before deploying your PHP or Laravel website, make sure you have:
- A VPS server with HestiaCP installed
- Root access to the server
- A registered domain name
- SSH access
- PHP 8.x installed (recommended)
- Composer installed (for Laravel)
- Database (MySQL/MariaDB)
Watch Video Support - Deploying PHP & Laravel on HestiaCP
Step 1: Add Your Domain in HestiaCP
1. Log in to your HestiaCP dashboard:
https://YOUR_SERVER_IP:8083
2. Go to WEB → Add Domain and enter your domain name:
Domain: yourdomain.com
Web Template: default
3. PHP Version: PHP 8.2 (recommended)
Click Save.
Step 2: Create a Database for Laravel
Laravel requires a database. Create a new database in HestiaCP:
1. Go to DB → Add Database.
2. Enter the database name, username, and password.
3. Save the database
You will use these details in the .env file later.
Step 3: Upload Your Laravel Project
There are two common methods to upload Laravel:
Method 1: Upload via FTP
1. Go to WEB → yourdomain.com → F.TP.
2. Create an FTP user
3. Use FileZilla to upload your Laravel files to:
/home/admin/web/yourdomain.com/public_html
Method 2: Upload via Git (Recommended)
If you have your project on GitHub:
1. Connect via SSH
2. Go to the domain folder:
cd /home/admin/web/yourdomain.com/public_html
3. Clone the repo:
git clone https://github.com/yourusername/yourlaravelproject.git
Step 4: Install Composer Dependencies
1. After uploading, install Laravel dependencies using Composer:
cd /home/admin/web/yourdomain.com/public_html composer install
2. This will download all required packages.
Step 5: Set Correct Folder Permissions
Laravel needs proper folder permissions for:
- storage
- bootstrap/cache
Run:
chmod -R 775 storage chmod -R 775 bootstrap/cache chown -R admin: a dmin storage bootstrap/cache
Step 6: Configure Environment (.env)
Open your .env file and configure:
APP_NAME=Laravel APP_ENV=production APP_DEBUG=false APP_URL=https://yourdomain.com DB_CONNECTION=mysql DB_HOST=localhost DB_PORT=3306 DB_DATABASE=your_db_name DB_USERNAME=your_db_user DB_PASSWORD=your_db_password
Save the file.
Step 7: Generate Application Key
Run:
php artisan key: generate
This will generate your application key and save it in .env.
Step 8: Run Laravel Migrations
To create database tables, run:
php artisan migrate
If you face errors, make sure the database credentials are correct.
Step 9: Configure Web Server (Nginx + Apache)
HestiaCP uses Nginx as a reverse proxy and Apache as a backend. For Laravel, we need to make sure the document root points to the public folder.
Go to:
WEB → yourdomain.com → Configure → Web Template
Make sure the root directory is:
/home/admin/web/yourdomain.com/public_html/public
If it is not, update it.
Step 10: Install SSL (Let’s Encrypt)
SSL is important for security and SEO. In HestiaCP:
1. Go to WEB → yourdomain.com → SSL.
2. Enable Let’s Encrypt
3. Click Save
Now your website will run on HTTPS.
Step 11: Clear Cache and Optimize
Run these commands for performance:
php artisan config:c ache php artisan route:c ache php artisan view:c ache
This optimizes Laravel for production.
Step 12: Test Your Website
Open your browser and visit:
https://yourdomain.com
If everything is configured correctly, your Laravel website should be live.
Conclusion
Deploying a PHP or Laravel website on HestiaCP is simple and fast. HestiaCP provides a clean interface, multiple PHP versions, built-in SSL, database management, and strong security features. Whether you are hosting a small PHP website or a large Laravel application, HestiaCP is a great choice for VPS hosting. For more articles and the best blog posts, visit our website, WebDecky.



💬 Comments
This is a nice post, I like it.