Get a free website with any plan

See how
HOSTING

Deploying a Laravel app

IN SHORT

Deploying a Laravel app on Flashcloud means setting the PHP version, uploading your code, creating a MySQL database, and configuring the .env file yourself: there's no one-click installer. The document root must point to Laravel's public/ folder for the app to work correctly.

Laravel is a PHP framework, so it runs on the same stack as any PHP site here. There is no one-click installer for Laravel: you set the PHP version, get your code onto the server, create a database, and configure the app's environment file. Here is the path end to end.

Set the PHP version

We support PHP 7.4 through 8.3, with 8.3 as the default. Pick the version your Laravel release targets:

  1. Go to Services → click hosting → the PHP tile.
  2. Choose the version for the domain.
  3. Save. The switch applies within seconds, no restart needed.

For the mechanics of switching versions and per-domain php.ini settings, see What PHP version should I use for WordPress (the version-switching steps are the same for any PHP app).

Get your code onto the server

Deploy your project from a repository or upload it with an FTP/SFTP client. Git is the natural fit for a framework project: see Deploying with Git. For manual uploads, see Uploading files to your hosting.

Create a MySQL database

Laravel needs a database. Create one and a user, then grant the user access:

  1. Go to Services → click your hosting → the Databases tile.
  2. Create a database, create a user, and add the user to the database with all privileges.

Full steps and connection details are in Creating MySQL databases. Keep the database name, username, and password handy for the next step.

Configure the environment file

Laravel reads its settings from a .env file in the project root. Set the database connection to match the database you created:

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=youraccount_dbname
DB_USERNAME=youraccount_dbuser
DB_PASSWORD=your-password-here

Use localhost as the host, because your app and the database run on the same server. Set APP_ENV=production and APP_DEBUG=false for a live site.

The public folder

Laravel expects the web server to serve its public/ subfolder, not the project root, so that files like .env stay out of the web root. The document root for your domain needs to point at public/ for the app to work correctly and safely. How to set a custom document root in the portal is flagged below for the portal team to confirm.

Common questions

Does Flashcloud have a one-click Laravel installer?

No. Laravel runs on the same PHP stack as any site here, but you set the PHP version, deploy your code, create the database, and configure the .env file manually.

What PHP version do I need for Laravel?

It depends on your Laravel release. Flashcloud supports PHP 7.4 through 8.3, with 8.3 as the default, and you pick the version for your domain under Services, hosting, the PHP tile.

How do I connect Laravel to its database?

Create a MySQL database and user under Services, hosting, the Databases tile, then set DB_HOST to localhost in your .env file since your app and database run on the same server.

Why does my Laravel site show an error or blank page after upload?

Your domain's document root probably points at the project root instead of the public/ folder. Laravel expects the web server to serve public/ directly so files like .env stay out of the web root.

Should I set APP_DEBUG to true on my live Laravel site?

No. Set APP_ENV=production and APP_DEBUG=false in your .env file once the site is live.

CAN'T FIND IT?

Real humans answer fast.

Hosting with us? Open a ticket and a real person replies - no scripts, no upsells. Still choosing a host? The same team is included with every plan, from day one.