Quick answer: To host a Laravel website on shared hosting, build the project on your own computer with production dependencies, upload it to a folder outside the public web root, make the host serve only Laravel’s public folder, create a MySQL database, fill in the .env file, run your migrations and switch on SSL. Then test every page.
Knowing how to host a Laravel website on shared hosting saves you from paying for a server you do not need yet. A brochure site, a small booking tool or an internal dashboard built in Laravel usually runs comfortably on a shared plan, as long as you set it up the way the framework expects. This guide walks through each step, the order that avoids broken deploys, and the mistakes worth skipping. If you are still deciding what kind of account you need, start with our explainer on what shared hosting is and who it suits.
Can you host a Laravel website on shared hosting?
Yes. Laravel is a PHP application, and shared hosting runs PHP. What matters is that the server meets Laravel’s PHP version and extension requirements and that you can point the web root at the right folder.
Shared hosting fits Laravel projects that serve web pages and handle modest traffic: company sites, client portals, small APIs and admin panels. It is a weaker fit for apps that depend on long-running queue workers, WebSockets or heavy background processing, because shared accounts are not designed for processes that never stop. If your app needs those, a VPS is the better home.
What you need before you start
Get these ready before you upload anything. Missing one of them halfway through is how a quick deploy turns into an evening of guessing.
- A hosting account where you can choose the PHP version and create a MySQL database.
- A domain pointed at that hosting. Our guide on how to point a domain to your hosting covers the DNS side.
- Your Laravel project working locally, with its database migrations up to date.
- A way to upload files, such as the control panel’s file manager or an FTP client.
- The required PHP version. Check the server requirements in the Laravel deployment documentation for your Laravel version (last checked 24 October 2026). The current release asks for PHP 8.3 or newer plus a list of common extensions.
Step 1: Prepare a production build on your computer
Do the build work locally, so the server only receives finished files. That way you never depend on tools being available on the hosting account.
- Install production dependencies only:
composer install --no-dev --optimize-autoloader. Composer’s command-line documentation explains both flags (last checked 24 October 2026). - If the project has a front end built with Vite, run
npm run buildso the compiled assets land inpublic/build. - Delete local-only files from the copy you will upload: your local
.env,node_modules, log files and anything instorage/framework/cache. - Zip the project. One archive uploads faster and more reliably than thousands of small files.
If your hosting plan gives you command-line access, you can run these commands on the server instead. The local route works either way, which is why it is worth learning first.
Step 2: Upload the project outside the public folder
Upload and extract the archive in a folder next to your public web root, not inside it. For example, if your web root is public_html, put the project in a sibling folder such as laravel-app.
This is the step that matters most for security. Laravel’s own documentation warns against serving the application from the project root, because that exposes files like .env, which holds your database password and app key. Only the contents of the public folder should ever be reachable from a browser.
Step 3: Make the web root point to Laravel’s public folder
The web server should send every request to public/index.php. On shared hosting there are two common ways to get there.
Option A: change the document root. If your control panel lets you set the document root for a domain, point it at laravel-app/public. This is the cleanest setup, because nothing in the project has to change.
Option B: copy the public folder’s contents into the web root. If you cannot change the document root, copy everything inside laravel-app/public, including the hidden .htaccess file, into public_html. Then open public_html/index.php and update the two paths that load vendor/autoload.php and bootstrap/app.php so they point to ../laravel-app/ instead of ../. The application code still lives outside the web root, so nothing sensitive is exposed.
With Option B, remember that every future front-end build has to be copied into public_html again. It is easy to forget, and the symptom is a site that looks unstyled after an update.
Step 4: Create the database and fill in the .env file
Create a MySQL database and a database user in your control panel, give that user full rights on the database, and note the host name, database name, user name and password.
Next, create a .env file in laravel-app. Copy .env.example as a starting point and set at least these values:
APP_ENV=productionandAPP_DEBUG=false. Leaving debug on shows error details, and sometimes secrets, to anyone who triggers an error.APP_URLset to your full https address.APP_KEY. Generate one locally withphp artisan key:generate --showand paste the result in.- The
DB_values from the database you just created. - Your mail settings, if the app sends email.
To load your tables, either run your migrations from a machine that can reach the database, or export the database from your local copy and import it with phpMyAdmin. For a first deploy, the import is often the simplest route.
Step 5: Fix permissions, storage and SSL
Laravel needs to write to two folders: storage and bootstrap/cache. Make sure the web server can write to both through your file manager’s permission settings. Most “500 error” reports on a fresh Laravel deploy come down to this.
If your app serves uploaded files from storage/app/public, it needs the link that php artisan storage:link normally creates. Without command-line access, a common workaround is a small one-off route or script that creates the link, which you remove straight after. Laravel’s filesystem documentation describes what the link points to (last checked 24 October 2026).
Finally, switch on SSL for the domain and confirm that APP_URL uses https. Mixed http and https URLs are a common cause of broken forms and assets.
Step 6: Test before you announce it
Open the site in a private browser window and work through it like a visitor would. Load the home page and a few inner pages, submit every form, log in and out, upload a file if the app allows it, and check that emails arrive.
If something fails, look in storage/logs/laravel.log first. It almost always names the real problem, whether that is a missing PHP extension, a wrong database password or a folder Laravel cannot write to.
Common mistakes when hosting Laravel on shared hosting
Most failed Laravel deploys on shared hosting come from a short list of avoidable slips. Here are the ones to check first.
| Mistake | What happens | Fix |
|---|---|---|
Whole project uploaded into public_html |
.env and source files can be downloaded |
Move the app outside the web root (Step 2) |
APP_DEBUG=true on the live site |
Error pages reveal internal details | Set it to false and clear the config cache |
| Wrong PHP version selected | Blank page or a Composer platform error | Match the version your Laravel release requires |
.htaccess not copied |
Every page except the home page returns 404 | Copy the hidden file from public |
| Storage not writable | 500 errors and no log entries | Fix permissions on storage and bootstrap/cache |
Writing Laravel well in the first place also makes it easier to host. My notes on Laravel architecture best practices are worth a read if your app is growing, and my piece on why and how to upgrade your PHP version explains why the PHP version you pick on the host matters for security.
Hosting your Laravel site with ResellerBytes
ResellerBytes sells shared hosting on three plans: Starter, Business and Pro. On every plan you choose your PHP version from the control panel, create MySQL databases and manage them with phpMyAdmin, and get free SSL on every site. Starter covers one website, Business up to three and Pro up to ten, which suits a Laravel app sitting alongside a marketing site or a client project or two.
Already running your Laravel site with another host? We include free website migration, so we can move your files and databases for you. If you would rather understand the moving process first, our guide to migrating a website to a new host covers the order of steps that avoids downtime.
Frequently asked questions
Do I need a VPS to host Laravel?
No. Many Laravel websites run on shared hosting without trouble. Move to a VPS when the app needs always-on queue workers, WebSockets, custom server software or more resources than a shared plan offers.
Can I host Laravel on shared hosting without SSH?
Yes. Build the project locally with Composer, upload the finished files including the vendor folder, import the database with phpMyAdmin and set permissions through the file manager. Command-line access is convenient but not essential.
Where should the Laravel files go on shared hosting?
Keep the project in a folder outside the public web root and expose only the contents of its public folder. Never place the whole project inside public_html.
How do I run the Laravel scheduler on shared hosting?
If your control panel offers cron jobs, add one that runs php artisan schedule:run every minute from your project folder. Check your host’s documentation for the exact PHP path to use.
Which PHP version does Laravel need?
It depends on the Laravel release. Check the server requirements in the official deployment documentation for your version, then select a matching PHP version in your hosting control panel before you upload.
Share this content:
