Guides 17 min read ·
Laravel Hosting in India: How to Deploy Laravel on Shared Hosting, cPanel or a VPS (2026)
How to deploy Laravel 13 in 2026: shared hosting and cPanel, a step-by-step Ubuntu VPS setup, Vercel and Laravel Cloud options, and fixes for 500 or 404 errors.
To deploy a Laravel project you need PHP 8.3 or newer (for Laravel 13), Composer, a database, a web server whose document root is the project's public folder, and a cron job for the scheduler. Ordinary shared hosting runs many Laravel apps well if you get the public folder, the scheduler and the queue right. Choose a VPS when your app is queue-heavy, needs Redis or Horizon, uses WebSockets through Reverb, or gets enough traffic to need CPU of its own.
This guide uses Laravel 13 (13.43, released 17 November 2026), PHP 8.3 from Ubuntu 24.04, Nginx, MySQL 8.0 and Composer 2.11, as of November 2026.
Do you need a VPS for Laravel, or is shared hosting enough?
Laravel's deployment guide asks for little: PHP 8.3 or higher with common extensions, a web server that sends every request to public/index.php, and write access to storage and bootstrap/cache. The differences show up in work that happens outside a web request:
| What your app needs | HostEthical web hosting | Cloud VPS |
|---|---|---|
| PHP 8.3+, Composer, MySQL | Yes: PHP 8.2 to 8.5, chosen per website | Yes, any version you install |
| Scheduler | Run for you on one-click installs; cron jobs you add run every 5 minutes at most | Cron every minute, as Laravel expects |
| Queue workers | Batches started by cron | Permanent workers under Supervisor |
| Redis, Horizon, Reverb, Octane | No | Yes |
| Outgoing email | Email API only (SMTP ports blocked) | An email API is still simplest |
| Simultaneous PHP requests | 2 to 6 PHP workers, by plan | Limited by your CPU and RAM |
| Root access, Docker | No | Yes |
A company site, blog, admin panel or booking app with modest traffic usually fits shared hosting. Move to a VPS when jobs must run within seconds or requests start queueing behind the plan's PHP workers (more in VPS vs shared hosting).
Where can you deploy Laravel: shared hosting, Laravel Cloud, Forge, Vercel or a VPS?
| Option | What you get | Cost (November 2026) |
|---|---|---|
| HostEthical web hosting | Managed PHP hosting with one-click Laravel, SSH and Git deploys | From ₹99 a month, or about ₹82.50 a month when billed yearly |
| Laravel Cloud | Laravel's fully managed platform; apps can scale to zero and wake in a median of 500 ms | Starter US$5 a month plus usage (US$5 of usage included, first month free); Growth US$20. No India region; nearest is Singapore |
| Laravel Forge | A panel that sets up and manages servers from a cloud provider or Forge's own Laravel VPS | Hobby US$12 a month, Growth US$19, Business US$39, plus the server |
| Vercel | Laravel in a Docker container, run as a function (beta) | Free Hobby plan for personal, non-commercial use only |
| Cloud VPS | Your own Linux server with root access | From ₹860 a month, or about ₹774.17 a month when billed yearly |
If you never want to touch a server, Laravel Cloud is a fair choice: it runs queues and the scheduler for you and deploys without downtime. Forge suits developers who want their own servers without typing every command. Both bill in US dollars by card: at ₹92.75 to the dollar, Cloud Starter is about ₹464 and Forge Hobby about ₹1,113 a month, before usage or the server.
Can you deploy Laravel on Vercel?
Partly. PHP isn't one of Vercel's official runtimes, and the community vercel-php runtime in older tutorials "is not supported by Vercel"; its repository was archived on 29 October 2026. Vercel's own Laravel guide (September 2026) runs Laravel with FrankenPHP in a Docker image on the Container Runtime, in beta on all plans. It warns that queue workers and the scheduler "assume the container stays active", that the file system isn't durable, so uploads need object storage, and that migrations run as a separate step. Idle containers scale down after 5 minutes. That works for a stateless API with an external database; an app with uploads, queues and scheduled tasks is simpler on a server.
Can you deploy Laravel for free?
For learning, yes, with catches. Laravel Cloud's first month on Starter is free, then it costs US$5 a month plus usage. Vercel's Hobby plan is free, but its terms allow only personal or non-commercial use. For client or business sites, budget for paid hosting. Our monthly web hosting plans include a free first month on orders by 7 January 2027; for practice servers, see free VPS options in India.
How to deploy Laravel on shared hosting or cPanel
These steps are for HostEthical web hosting; the same ideas apply to any cPanel host.
1. Install with one click, or bring your own project
One-click Laravel installs Laravel 13 into a laravel/ folder inside your website's folder, points the document root at laravel/public, creates a database and writes .env with the database settings, a fresh APP_KEY, APP_ENV=production and APP_DEBUG=false. It needs PHP 8.3 or newer on the website; pick 8.4 or 8.5 if you can, because PHP 8.3 now gets security fixes only. For an existing project, use Git deploys (on every push), clone it over SSH, or upload it by SFTP. SSH is key-only, on port 2222, with the username and host shown in your dashboard; port 22 is for SFTP only.
2. Install dependencies and fill in .env
vendor/ and .env stay out of Git, so for your own project create them over SSH (one-click installs already have them). The shell opens in the sites/ folder and has PHP 8.3 as its default php, plus Composer, git, Node 20 and the mysql client:
cd example.in/your-app # your website's folder, then the project
php -v # 8.3, the shell's default
composer install --no-dev --optimize-autoloader
cp .env.example .env
php artisan key:generate # writes APP_KEY into .env
# now set the values below in .env (File Manager or SFTP)
php artisan migrate --force
php artisan storage:link
php artisan optimize
APP_ENV=production
APP_DEBUG=false
APP_URL=https://example.in
# database details from your hosting dashboard
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=your_database
DB_USERNAME=your_db_user
DB_PASSWORD=your_db_password
With APP_DEBUG=true, error pages can expose secrets, so keep it false. --force skips the production prompt for migrations, and storage:link links public/storage to storage/app/public for uploads. optimize caches config, events, routes and views; cached config ignores .env, so run it again after every .env change. If you develop on PHP 8.4 or newer, set config.platform.php to 8.3 in composer.json, or your lock file may pull in Symfony 8 packages that won't install on 8.3. For Vite assets, run npm ci && npm run build (Laravel 13's Vite 8 needs Node 20.19 or newer) or upload a locally built public/build.
With Git deploys, the first deploy clones your repository into an empty folder, and later deploys run git fetch and git reset --hard to your branch. Files Git doesn't track, such as .env, vendor/ and uploads, are kept; edits to tracked files on the server are overwritten. To repeat the build steps on every deploy, commit a .hostethical-deploy.sh file at the root of the repository. It runs as your hosting user after each deploy, with a 10-minute limit:
#!/bin/sh
set -e
cd "$(dirname "$0")" # the repository folder
composer install --no-dev --optimize-autoloader --no-interaction
[ -f .env ] || exit 0 # first deploy: create .env over SSH, then deploy again
php artisan migrate --force
php artisan optimize
# npm ci && npm run build # uncomment unless you commit public/build
3. Point the document root at the public folder
Laravel's docs warn that serving the project root "will expose many sensitive configuration files", including .env. One-click installs already point the document root at laravel/public. For a project of your own, the simplest route is to run the one-click install first and then replace the contents of its laravel/ folder with your code over SFTP or SSH, keeping its .env: the document root already points at laravel/public. Never put a Laravel project in public_html (the default web root, and the folder Git deploys suggest). If you need a different folder, ask support. On cPanel, Domains lets you change a domain's document root through Manage. Don't move index.php up a level or copy the whole project into public_html.
4. Check the scheduler, or add it as a cron job
One-click installs already run Laravel's scheduler from a server-level cron entry. It doesn't appear in your list of cron jobs, so don't add a second schedule:run job, or due tasks would run twice.
For a project you upload, add it yourself. Laravel expects schedule:run every minute, but cron jobs you add run at most every 5 minutes. Paths start from your home folder:
*/5 * * * * cd sites/example.in/your-app && php artisan schedule:run >> /dev/null 2>&1
schedule:run starts only tasks that are due at that moment, and */5 fires at :00, :05, :10 and so on. So everyMinute() tasks run every 5 minutes, tasks due between those marks, such as hourlyAt(17) or dailyAt('09:07'), never run, and sub-minute tasks run only in the minute cron fires. Keep schedules at everyFiveMinutes() or slower, at times like 02:00 or 09:15. Cron runs on Indian time, but Laravel reads schedule times in the app's timezone, UTC by default, unless you set schedule_timezone in config/app.php. If something must run every minute, use a VPS.
5. Run queued jobs without a permanent worker
Shared hosting doesn't allow a queue:work process that runs forever. New Laravel apps already use the database queue driver, so let cron start a worker that empties the queue and exits:
*/5 * * * * cd sites/example.in/laravel && php artisan queue:work --stop-when-empty --max-time=240 >> /dev/null 2>&1
Use your own project folder in place of laravel if you uploaded it. Per the queue docs, --stop-when-empty exits once all jobs are done and --max-time=240 stops it after 4 minutes, so one run ends before the next starts. Our cron also skips a run while the previous one is still going and stops any run after 15 minutes. Jobs may wait up to 5 minutes, fine for emails and reports. For a small app, QUEUE_CONNECTION=sync runs jobs immediately inside the request instead, at the cost of a slower response.
6. Send email through an API, not SMTP
Outgoing SMTP ports (25, 465, 587 and 2525) are blocked on our hosting servers to stop spam, and PHP's mail() sends nothing (here's why hosts block SMTP). Laravel's default MAIL_MAILER=log only writes emails to a log. Laravel's mail docs recommend API drivers and include Mailgun, Postmark, Resend, Amazon SES and Cloudflare, with Brevo available through Symfony's transport. With Resend:
composer require resend/resend-php
# then in .env
MAIL_MAILER=resend
RESEND_API_KEY=re_your_api_key
MAIL_FROM_ADDRESS="hello@example.in"
MAIL_FROM_NAME="${APP_NAME}"
Run php artisan optimize again and verify your domain with the provider (why emails go to spam).
How to deploy Laravel on a VPS (Ubuntu 24.04), step by step
These steps take an app from Git to https://example.in on a fresh Ubuntu 24.04 server. Point the domain's A record at the server (see DNS records explained) and create a sudo user with SSH keys as in how to set up a VPS; the examples call it deploy. Prefer containers? See Docker on a VPS.
1. Install Nginx, PHP 8.3 and the extensions Laravel needs
sudo apt update
sudo apt install -y nginx git unzip \
php8.3-fpm php8.3-cli php8.3-mysql php8.3-mbstring php8.3-xml \
php8.3-curl php8.3-zip php8.3-bcmath php8.3-intl
php -v
Ubuntu 24.04's php package is PHP 8.3, Laravel 13's minimum; php8.3-common comes with it and covers ctype, fileinfo, PDO and tokenizer. For newer PHP, choose Ubuntu 26.04 LTS when ordering (its php package is 8.5; replace 8.3 with 8.5 below), or use Ondřej Surý's packages, now at packages.sury.org because ppa:ondrej/php is frozen.
2. Install Composer
Ubuntu's composer package is the older 2.7.1, so use the official installer with its checksum check (adapted from Composer's docs):
cd ~
EXPECTED="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
[ "$EXPECTED" = "$ACTUAL" ] && php composer-setup.php --quiet
rm composer-setup.php
sudo mv composer.phar /usr/local/bin/composer
composer --version
3. Create the database
sudo apt install -y mysql-server
sudo mysql
CREATE DATABASE myapp CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'myapp'@'localhost' IDENTIFIED BY 'a-long-random-password';
GRANT ALL PRIVILEGES ON myapp.* TO 'myapp'@'localhost';
EXIT;
That's MySQL 8.0 on Ubuntu 24.04. For PostgreSQL 16, install postgresql php8.3-pgsql, run sudo -u postgres createuser --pwprompt myapp and sudo -u postgres createdb --owner=myapp myapp, and set DB_CONNECTION=pgsql with port 5432.
4. Clone the app and configure it
sudo mkdir -p /var/www/myapp
sudo chown deploy:deploy /var/www/myapp
git clone https://github.com/your-name/myapp.git /var/www/myapp
cd /var/www/myapp
composer install --no-dev --optimize-autoloader
cp .env.example .env
chmod 600 .env
php artisan key:generate
nano .env # as in the shared hosting step, with DB_HOST=127.0.0.1
php artisan migrate --force
php artisan storage:link
php artisan optimize
For Vite assets, install Node.js as in our Node.js hosting guide and run npm ci && npm run build, or build in CI and upload public/build.
5. Run PHP as your deploy user
PHP must be able to write to storage and bootstrap/cache. A PHP-FPM pool running as deploy means web requests, Artisan, cron and workers all create files as one user, so they never fight over storage/logs/laravel.log. Create /etc/php/8.3/fpm/pool.d/myapp.conf:
[myapp]
user = deploy
group = deploy
listen = /run/php/php8.3-fpm-myapp.sock
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
sudo systemctl restart php8.3-fpm
listen.owner lets Nginx (www-data) use the socket. pm.max_children caps simultaneous PHP requests (PHP's default is 5); adjust it once you know how much memory each PHP process uses.
6. Configure Nginx
Create /etc/nginx/sites-available/myapp, based on Laravel's recommended config:
server {
listen 80;
listen [::]:80;
server_name example.in www.example.in;
root /var/www/myapp/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 ~ ^/index\.php(/|$) {
fastcgi_pass unix:/run/php/php8.3-fpm-myapp.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_buffer_size 32k;
fastcgi_buffers 8 32k;
fastcgi_busy_buffers_size 64k;
fastcgi_hide_header X-Powered-By;
}
location ~ \.php$ {
return 404;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
sudo ln -s /etc/nginx/sites-available/myapp /etc/nginx/sites-enabled/
sudo rm /etc/nginx/sites-enabled/default
sudo nginx -t
sudo systemctl reload nginx
7. Turn on HTTPS and the firewall
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d example.in -d www.example.in
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
Let's Encrypt certificates last 90 days, or 64 days for those issued from 10 February 2027, and certbot's systemd timer renews them automatically. Allow SSH before enabling ufw, and keep MySQL's port 3306 closed.
8. Start queue workers with Supervisor and add the scheduler
sudo apt install -y supervisor
sudo nano /etc/supervisor/conf.d/laravel-worker.conf
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/myapp/artisan queue:work --sleep=3 --tries=3 --max-time=3600
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=deploy
numprocs=2
redirect_stderr=true
stdout_logfile=/var/www/myapp/storage/logs/worker.log
stopwaitsecs=3600
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start "laravel-worker:*"
crontab -e # as deploy, then add this line:
* * * * * cd /var/www/myapp && php artisan schedule:run >> /dev/null 2>&1
This is Laravel's Supervisor example with two workers; stopwaitsecs must exceed your longest job. A systemd unit works too (see our Telegram bot guide). For Redis, install redis-server php8.3-redis and set QUEUE_CONNECTION=redis; Horizon requires Redis. Reverb runs as another Supervisor program (php artisan reverb:start, port 8080 by default) behind an Nginx proxy.
How do you redeploy Laravel without downtime?
Save this as deploy.sh and run it for each release:
#!/usr/bin/env bash
set -e
cd /var/www/myapp
php artisan down --render="errors::503" --refresh=15
git pull origin main
composer install --no-dev --optimize-autoloader --no-interaction
php artisan migrate --force
php artisan optimize
php artisan reload # restarts queue workers and Reverb on the new code
php artisan up
--render pre-renders the 503 page so visitors don't hit errors while Composer swaps files (see Laravel's maintenance mode docs), and queued jobs pause until up. If a step fails, set -e stops the script with the site still in maintenance mode: fix it, then run php artisan up. Expect a few seconds of downtime per deploy. For none, each release must be built in its own folder and switched live in one step; Forge includes zero-downtime deployments, and Laravel Cloud handles them for you.
Why does my deployed Laravel app show a 500 error, a 404 or mixed content?
Check storage/logs/laravel.log first.
- 500, "No application encryption key has been specified." Run
php artisan key:generate, thenphp artisan optimize. Never change the key on a live app: per Laravel's encryption docs, everyone is logged out and data encrypted with the old key can't be decrypted. - 500, "could not be opened in append mode: Failed to open stream: Permission denied". PHP can't write to
storage. Make the user PHP runs as ownstorageandbootstrap/cache; above, that'ssudo chown -R deploy:deploy storage bootstrap/cache. - Changes to .env don't take effect. Config is cached; run
php artisan optimize. - 500, "Vite manifest not found". Build the front end or upload
public/build. - 404 or 403 on the home page, or URLs that only work with
/public/. The document root is the project folder. Point it atpublic. - Only the home page works. On Nginx, the
try_files ... /index.php?$query_stringline is missing. - Mixed content,
http://links or redirect loops behind Cloudflare or a load balancer. The proxy forwards plain HTTP, so Laravel buildshttp://URLs. Trust the proxy inbootstrap/app.phpas the requests docs show (use'*'only if all traffic arrives through it), and setAPP_URLto thehttps://address. Without a proxy, Nginx already tells PHP the request is HTTPS.
// bootstrap/app.php
->withMiddleware(function (Middleware $middleware): void {
$middleware->trustProxies(at: '*'); // or the proxy's IP addresses
})
Running Laravel on HostEthical
Most Laravel sites can start on web hosting, from ₹99 a month, or about ₹82.50 a month when billed yearly: one-click Laravel, PHP 8.2 to 8.5, SSH with Git and Composer, free SSL and nightly backups. Lite and Starter host one website with 2 PHP workers; Business hosts 3 websites with 3 workers, and Pro 5 with 6, for a busier app or several client sites.
Choose a Cloud VPS for an every-minute scheduler, permanent workers, Redis, Horizon, Reverb, Octane, Docker or root. It's unmanaged KVM with a dedicated IPv4 and SSD storage and is built automatically after payment, usually in 5 to 15 minutes. You pay in rupees by UPI or binance Pay (USDT), at the same price on renewal.
| Plan | vCPU | RAM | Storage | Paid monthly | Paid up front, per month | At renewal |
|---|---|---|---|---|---|---|
| VPS Starter | 4 cores | 8 GB | 100 GB SSD | ₹860 | ₹774.17 (yearly) | Same price |
| VPS Pro | 6 cores | 12 GB | 200 GB SSD | ₹1,170 | ₹1,053.33 (yearly) | Same price |
| VPS Max | 8 cores | 24 GB | 300 GB SSD | ₹2,190 | ₹1,971.67 (yearly) | Same price |
VPS Starter's 4 vCPU and 8 GB RAM is plenty for one Laravel app with MySQL, Redis, a few workers and Reverb. Go to Pro or Max for several apps, a large database held in memory, or heavy video, PDF or image jobs. For a product with paying customers, see our SaaS hosting guide.
Choose Mumbai if your users are in India: requests travel less distance and data stays in India, for ₹380 a month more than Germany (more in our Mumbai VPS guide). You can also register your domain with us, point it with our nameservers and DNS editor, and add business email.
Frequently asked questions
Can I host a Laravel app on HostEthical web hosting?
Yes. One-click Laravel installs Laravel 13 with its own database, a ready .env file and the scheduler already running (it needs PHP 8.3 or newer), or you can deploy your own project with Git deploys or over SSH, where Composer is available. Cron jobs you add run at most every 5 minutes, there is no Redis or permanent queue worker, and email must go through an email API because SMTP ports are blocked. For Redis, Horizon, Reverb or an every-minute scheduler under your own control, use a Cloud VPS.
Which PHP version should I use for Laravel 13?
Laravel 13, released on 17 March 2026, needs PHP 8.3 or newer and supports PHP 8.3 to 8.5. As of November 2026, PHP 8.3 receives security fixes only (until 31 December 2027), PHP 8.4 has active support until 31 December 2026 and PHP 8.5 until 31 December 2027. PHP 8.6 was released on 19 November 2026, but Laravel's support table still lists 8.5 as the newest supported version, so test before you switch.
Do I need Laravel Forge or Laravel Cloud to deploy Laravel?
No. Laravel runs on any server with PHP, Composer, a database and a web server pointed at the public folder, as this guide shows. As of November 2026, Forge costs from US$12 a month plus the server and automates server set-up, while Laravel Cloud starts at US$5 a month plus usage and runs everything for you, though it has no India region. They are worth paying for if your time costs more than the fees.
Should I use MySQL or PostgreSQL for Laravel?
Both are fully supported, and new Laravel apps start on SQLite until you change DB_CONNECTION in .env. MySQL is what most shared hosting offers, including ours, which gives you a MySQL-compatible database managed in phpMyAdmin. Laravel 13's vector search needs PostgreSQL with pgvector or MariaDB 11.7 or later, not MySQL, so on a VPS pick PostgreSQL if you plan to use it.
Can I deploy Laravel with Docker?
Yes, on a VPS. Laravel Sail is Docker for local development, so for production you build your own image, for example with FrankenPHP, which Laravel's deployment docs list as a way to serve Laravel, or use a self-hosted panel such as Coolify or Dokploy. Shared hosting does not run Docker, and a plain Nginx and PHP-FPM set-up is simpler for a single app.