Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Laravel 13 & Filament v3 Shared Hosting Deploy Guide

· 4 min read · Home Tech

In this article
  1. Background: Why Shared Hosting Is Tricky
  2. How It Works: The Three-Phase Deployment
  3. Choosing Your Hosting Setup
  4. Step-by-Step: Preparing Locally
  5. Running Artisan Commands Without SSH
  6. Common Problems and Fixes
  7. Security and Maintenance
  8. Frequently Asked Questions

This guide explains how to deploy a Laravel 13 application with Filament v3 to a typical shared hosting account without using a terminal or SSH. You will upload files via FTP, configure the public directory, set up the database, and run the necessary Laravel commands through a web-based PHP script.

Background: Why Shared Hosting Is Tricky

Shared hosting plans usually provide a control panel (cPanel, Plesk, etc.), FTP access, and a MySQL database, but they rarely offer SSH access. Laravel normally relies on Composer to install dependencies and Artisan to run commands like migrations and cache clearing. Without a terminal, you must prepare everything on your local machine, upload the finished project, and then trigger the required commands via a temporary PHP script that executes them through the web server.

How It Works: The Three-Phase Deployment

Deployment breaks down into three phases:

  1. Local preparation – You build the project on your computer, install all PHP dependencies, and configure the environment file.
  2. File upload – You transfer the entire project to the shared hosting account using FTP or the file manager in your control panel.
  3. Web-based setup – You create a small PHP script that runs the necessary Artisan commands (migrations, config cache, etc.) and then delete that script for security.

Choosing Your Hosting Setup

Most shared hosts expect your site to live in a folder like public_html or htdocs. Laravel’s entry point is the public folder, so you have two options:

  • Move Laravel’s public contents up – Upload the entire Laravel project into a subfolder (e.g., laravel_app) and copy the contents of public into public_html. Then edit public_html/index.php to point to the correct autoload and bootstrap paths.
  • Use a subdomain – Point a subdomain’s document root directly to the public folder. This is cleaner and avoids path issues, but not all hosts allow you to change the document root.

Step-by-Step: Preparing Locally

  1. Install PHP 8.2+ and Composer on your local machine.
  2. Create a new Laravel 13 project: composer create-project laravel/laravel myapp.
  3. Install Filament v3: composer require filament/filament:"^3.0" then run php artisan filament:install --panels.
  4. Configure your .env file with the database credentials you will use on the server.
  5. Run php artisan config:cache and php artisan route:cache locally to pre-cache configuration and routes.
  6. Upload the entire project (excluding node_modules and .git) to your hosting account via FTP.

Running Artisan Commands Without SSH

Create a file named deploy.php in the public root (or the Laravel root if the public folder is the document root) with the following content:

<?php
// deploy.php – run once then delete
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$kernel->handle(
    $input = new Symfony\Component\Console\Input\StringInput('migrate --force'),
    new Symfony\Component\Console\Output\BufferedOutput()
);
echo 'Done';

Upload this file to the Laravel root (where artisan resides) and access it via your browser. It will run the migration command. You can change the string to any Artisan command, such as config:cache or filament:optimize. After it runs, delete the file immediately.

Common Problems and Fixes

  • 404 or blank page – Usually a path issue. Ensure index.php in the public folder correctly points to the autoload and bootstrap files. If you moved public contents, update the paths.
  • Permission errors – Set storage and bootstrap/cache folders to writable (usually 755 or 775).
  • Filament assets not loading – Run php artisan filament:assets locally before uploading, or run it via the deploy script.
  • HTTPS redirect loop – Set APP_URL to your HTTPS domain and add URL::forceScheme('https') in a service provider if needed.

Security and Maintenance

Never leave the deploy script on the server. After running migrations, delete it. Also, make sure your .env file is not publicly accessible – Laravel’s default .htaccess usually blocks it, but verify. For updates, repeat the process: upload changed files, run migrations via a temporary script, and clear caches.

Frequently Asked Questions

Can I use Composer on shared hosting without SSH?

Some hosts offer a “Composer” button in the control panel that runs it for you. If not, you must install dependencies locally and upload the vendor folder. That works as long as the PHP version on the server matches or is newer than the one used locally.

Do I need to upload the node_modules folder?

No. Filament’s compiled assets are already in the public folder after you run php artisan filament:assets. The node_modules folder is only for development and can be excluded.

Why does my site show a 500 error after uploading?

This usually means a missing vendor dependency or incorrect file permissions. Check the Laravel log in storage/logs/laravel.log. If the log says a class is not found, re-upload the vendor folder. If it says “permission denied,” fix the storage folder permissions.

How do I update Filament on shared hosting?

Locally, run composer update filament/filament, then upload the changed files (especially vendor and any new assets). Run php artisan migrate --force via the deploy script if there are new migrations.

Is it safe to use a subdomain for Laravel instead of the main domain?

Yes, it is often safer because the document root points directly to the public folder, so no path manipulation is needed. Just create the subdomain in your control panel and set its document root to the public folder.

Can I use a database manager like phpMyAdmin to run migrations?

You can run raw SQL queries manually, but Laravel migrations are not simple SQL files. It is much easier to use the deploy script method described above.