Have you tried putting your Laravel app online and ended up frustrated with errors, slow loading, or confusing steps?
You’re not alone. Many developers in Nigeria struggle with this, especially when working on small projects or side businesses with limited time and money.
You want your app to be live fast, but you don’t want to spend hours figuring out servers.
Shared hosting is the answer. It’s cheap, beginner-friendly, and perfect for small projects.
In this guide, you’ll learn how to deploy Laravel on shared hosting in simple steps.
By the end, your app will be live, fast, and ready for users. You’ll learn:
- What Laravel and shared hosting are
- Why shared hosting works well for small projects
- Step-by-step deployment using cPanel
- Common problems and how to fix them
- Tips to keep your app secure and running smoothly
Let’s get your project online.
What is Laravel?
Laravel is a free tool that helps you build websites and apps using PHP.
It takes care of many tasks that usually take a lot of time, like connecting to databases or handling user logins.
This means you can focus on building your app instead of worrying about small details.

Laravel uses a method called MVC to organize code:
- Model – manages your data
- View – controls what users see on the screen
- Controller – handles the app’s logic
This structure keeps your code clean, easy to understand, and simple to update.
Laravel also comes with helpful tools:
- Eloquent – makes database actions simple
- Blade – helps you design pages quickly
Taylor Otwell, Laravel’s creator, designed it to remove the hard parts of web development.
Many Nigerian developers love Laravel because it helps them build apps like online shops, school systems, or blogs quickly.
Important: Laravel needs PHP 8.2 or higher. Make sure your hosting plan supports it before you start.
What is Shared Hosting?
Shared hosting means your website shares a server with other websites.
Think of it like renting a desk in a big office, you each have your own space, but everyone uses the same building and facilities.
With shared hosting, you get tools like cPanel to manage files, emails, and databases.
The hosting company handles security, updates, and server maintenance, so you don’t have to worry about the technical side.
It’s also affordable. In Nigeria, shared hosting plans usually cost under ₦5,000 per month.
Our hosting at Truehost works perfectly with Laravel and even supports easy local payments like bank transfers or cards.
Here’s a simple comparison:
| Type | Cost (₦/mo) | Best For |
| Shared | 2,000–5,000 | Small sites |
| VPS | 10,000+ | Growing apps |
| Dedicated | 30,000+ | High traffic |
Shared hosting does have limits. Since resources are shared, heavy traffic can slow your site. But for most small Laravel apps, it’s more than enough.
Why Use Shared Hosting for Laravel?
Many people think Laravel needs a powerful, expensive server. That’s not true. Shared hosting is enough for small apps or new projects.
Here’s why it works well:
- Affordable: You don’t need a VPS. A simple ₦2,500/month plan can run many apps smoothly.
- Easy to Use: You can upload and manage your site using cPanel without needing command-line skills.
- Handles Small Traffic: If your site gets 1,000–5,000 visitors per month, shared hosting is enough.
The main limit is no full SSH access. But if you prepare your project on your computer first, this won’t be a problem.
Shared hosting gives you speed, savings, and simplicity, perfect for Nigerian freelancers, startups, and hobby projects.
Deploying Laravel on Shared Hosting
Getting your Laravel app live on shared hosting doesn’t have to be complicated.

If your project is ready, these steps take about 20–30 minutes. This guide assumes you’re using Laravel 12 and PHP 8.2+.
Before starting, test your app locally:
php artisan serve
If it works on your computer, you’re ready to move online.
1) Prepare and Compress Your Project
Open your Laravel project and make it ready for production. Run these commands:
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan key:generate (if you don’t have an app key)
Remove folders you don’t need on the server:
- node_modules
- .git
- .env
Next, create a ZIP file of your project to make uploading faster:
zip -r my-laravel-app.zip . -x “node_modules/*” “.git/*” “.env”
2) Upload to cPanel
- Log in to cPanel, then File Manager, then to public_html, and to Upload.
- Choose your ZIP file.
For large files, you can use FTP like FileZilla. After uploading, the ZIP should appear inside public_html.
3) Extract and Set Up Folder Structure
Extract your ZIP outside public_html for security, for example:
/home/username/laravel-app
Inside, you should see:
- app
- public
- storage
- vendor
- bootstrap
Now, link the public folder to public_html. This keeps your core files safe.
- If symlinks are allowed: create a symlink from public_html → /laravel-app/public.
- If not, copy the contents of public manually into public_html.
Set permissions:
- Folders: 755
- Files: 644
4) Configure index.php and Environment
Next, we need to make Laravel point to the right folders on your server.
Go to public_html/index.php (or your symlinked public folder) and update the paths for Laravel 10+:
require __DIR__.’/../laravel-app/vendor/autoload.php’;
$app = require_once __DIR__.’/../laravel-app/bootstrap/app.php’;
Replace ../laravel-app with the actual folder name you used on your server. This ensures Laravel can find its files.
Update the .env File
- Upload a copy of
.env.exampleand rename it .env. - Open it in File Manager and update:
APP_KEY=your-app-key
APP_ENV=production
APP_DEBUG=false
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=yourdb_laravel
DB_USERNAME=yourdb_user
DB_PASSWORD=yourstrongpass
If you don’t have SSH access, skip php artisan migrate for now. You can run migrations locally and import the SQL file into your hosting database.
Test Your Site
Visit your website URL.
- See the Laravel welcome page? Your paths work.
- Errors? Check logs in storage/logs for clues.
Updating index.php and .env correctly is key to a smooth Laravel deployment on shared hosting.
Our Truehost plans make this setup straightforward.
5) Set Up the Database
Laravel needs a database to store information like users, products, or posts.
Let’s set it up in cPanel.
- Create a Database and User
- Go to cPanel → MySQL Databases
- Create a new database
- Create a new user with a strong password
- Add the user to the database with full permissions
- Go to cPanel → MySQL Databases
- Import Your Local Database
- Export your local database via phpMyAdmin on your computer.
- In cPanel, go to phpMyAdmin, select your new database, and import the SQL file.
- Export your local database via phpMyAdmin on your computer.
- Update Your .env File
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=yourdb_laravel
DB_USERNAME=yourdb_user
DB_PASSWORD=yourstrongpass
- Run Migrations (Optional)
- If you have SSH access, you can run:
- If you have SSH access, you can run:
php artisan migrate
- If not, you already imported your database, so your app is ready.
Once the database is connected, your Laravel app can store and retrieve information smoothly.
6) Create a Symlink for the Storage Folder
Laravel stores user files, images, and cached data in the storage folder. You need to link it to your public folder so the app can access these files.
Option 1: If symlinks are allowed
- Link /laravel-app/storage/app/public → /public_html/storage
- This keeps files organized and secure.
Option 2: If symlinks are not allowed
- Add this to your .htaccess in public_html:
RewriteRule ^storage/(.*)$ ../laravel-app/storage/app/public/$1 [L]
Set Permissions:
- storage folder: 777
- This prevents upload errors and allows your app to save files.
With the storage folder linked correctly, your users can upload images, files, and other data without issues.
Key Factors to Note When Deploying on Shared Hosting

When deploying Laravel on shared hosting, a few things can make or break your setup. Keeping these in mind will save you time and headaches:
- PHP Version
- Laravel 12 needs PHP 8.2 or higher.
- You can check or change this in cPanel, then MultiPHP Manager.
- Laravel 12 needs PHP 8.2 or higher.
- Performance
- Enable OPcache in cPanel to make your pages load faster.
- Caching routes, views, and configuration files also helps your site respond quickly.
- Enable OPcache in cPanel to make your pages load faster.
- Security
- Protect sensitive files like .env by blocking access:
- Protect sensitive files like .env by blocking access:
<Files .env>
Deny from all
</Files>
- Keep permissions correct (folders 755, files 644) to prevent unauthorized access.
By following these tips, your Laravel app will run smoothly, securely, and efficiently on shared hosting.
Common Issues and How to Fix Them
Even with careful setup, some problems can pop up when deploying Laravel on shared hosting.
Here’s how to handle the most common ones:
| Problem | Cause | Fix |
| 500 Error | Wrong permissions | Set folders to 755 and files to 644 |
| Missing routes | No .htaccess | Add the correct rewrite rules |
| Slow site | Cache issues | Clear cache (php artisan cache:clear) |
| Database errors | Wrong .env | Check DB credentials and settings |
Other Tips:
- If your hosting doesn’t support Composer, install dependencies locally and upload the vendor folder.
- If your site grows beyond 5,000 visits per month, consider upgrading to a VPS plan for better performance.
Handling these common issues keeps your Laravel app running smoothly and your visitors happy.
Conclusion
Now you know how to deploy Laravel on shared hosting step by step. You’ve learned how to:
- Upload your files and set up your folders
- Configure index.php and .env
- Connect and import your database
- Link the storage folder for user files
- Fix common errors and improve performance
Your app is now live, ready for visitors, and secure.
Next steps:
- Monitor your site regularly
- Update your Laravel app often
- Backup your files and database
- Keep security in check
With these steps, even small projects and startups in Nigeria can run smoothly on shared hosting.
Our Truehost hosting plans offer full support tailored for Laravel apps, making deployment stress-free.
FAQs
Can I deploy Laravel 12 on shared hosting?
Yes! Just make sure your hosting supports PHP 8.2+ and MySQL 5.7+.
How much does hosting cost in Nigeria?
Most shared hosting plans cost between ₦2,000 and ₦5,000 per month.
Why do I get a 500 error after uploading?
Check your folder and file permissions. Folders should be 755, files 644. Also, make sure .htaccess has the correct rewrite rules.
What if I don’t have SSH access?
No worries. Run migrations locally on your computer, export the SQL file, and import it into your hosting database.
Symlink is not working, what should I do?
Copy the contents of the public folder manually into public_html.
Is shared hosting good for an online shop?
Yes, for small shops it works well. Make sure you enable SSL for security, which is available on all our hosting plans.
Domain NamesFind and register your ideal domain name instantly.
Web HostingEasy-to-use hosting powered by cPanel — ideal for managing websites in Nigeria.
Windows HostingRun .NET apps with Windows-optimized hosting
Affiliate ProgramMake money promoting our services
Reseller HostingMake money by reselling our hosting products under your own brand
.COM Domains
All DomainsExplore all supported tld domains in Nigeria
WhoisFind out who owns any domain, as well as verify your registration details
VPS Hosting in Nigeria
Dedicated ServersReimagine your site speed with your own complete server
SSLs




