Black Friday

Up to 80% off web hosting and WordPress plans until 30 NovemberUp to 80% off

See plans
HOSTING

Deploying a Laravel app

Last updated

IN SHORT

Flashcloud hosts Laravel applications on its standard PHP stack. There is no one-click installer. You configure your PHP version, push your files via Git or SFTP, connect a local MySQL database in your .env file, and point your domain document root to the public subfolder to keep files secure.

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 Version 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 MySQL 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

Is there a one-click installer for Laravel?

No, there is no one-click installer for Laravel. You deploy it manually by selecting your PHP version, uploading your files, creating a MySQL database, and configuring your .env file.

Which PHP version should I choose?

Select the version your release requires between PHP 7.4 and 8.3. Version 8.3 is the default, and any switch in your hosting portal applies in seconds without a restart.

What do I use for DB_HOST in my .env file?

Set DB_HOST to localhost. Your Laravel application and the MySQL database run on the same server.

Why do I have to point my domain to the public folder?

The web server must serve the public subfolder to keep sensitive files like .env outside the web root. This prevents visitors from accessing your environment settings and core app files directly.

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.