One Framework a Day keeps the Boredom Away: Laravel

Welcome to this new edition of One Framework a Day keeps the Boredom Away. In this series I will show you how to deploy a particular framework on Clever Cloud every day until I want to go back to boredom. Today it's about Laravel.

In each post of this series we'll see how to deploy a particular framework on Clever Cloud. Today we are taking a look at Laravel.

If you want to tag along, make sure you have git, a Clever Cloud account and that you have installed our CLI Clever-Tools.

What is Laravel?

Laravel is a free, open-source PHP web framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller (MVC) architectural pattern.

To go a bit further the basics, I have deployed this URL shortener application called Polr. It's actualy written with Lumen, a Laravel micro-framework.


Here are the necessary steps to configure your Polr application:

  • Clone the backend: git clone
  • Get in the project: cd polr
  • Create the PHP application: clever create --type php polr
  • Create the MySQL addon: clever addon create mysql-addon --plan dev polr-mysql
  • Link the database to the application: clever service link-addon polr-mysql
  • Add your domain: clever domain add
  • Copy the default configuration: cp .env.setup .env

Then you need to setup the default webroot. We don't support environment variable for this yet, so you will have to create a php.json file under a clevercloud directory:

mkdir clevercloud vim clevercloud/php.json

  "deploy": {
    "webroot": "/public"

Now commit all your changes, run clever deploy than clever open. You will be taken straight to the setup wizard of Polr. Go through all the steps, yes even the database configuration, because the setup will write ot the DB at the end. It will also overwrite .env. Problem is we use immutable infrastructure so all the changes written on that file will be lost at reboot. And reboot can happen for many reasons. Best way to manage this is to use clever ssh to log on the machine and copy the content of the now changed .env file to your own version of the file.

All the fields in this file can be remove and replaced by environment variables. You can also use pre-existing variables. In my case I have configured the database part like this:


Feel free to remove any fields you want to setup as an environment variable as they will be picked up automatically too.

The other option you have would have been to know exactly all the configuration variables needed, set them all, than ssh on the machine and use the artisan CLI to seed the database. Which is to me more cumbersome.

Whatever solution you choose, take a look at their installation guide. This will give you a good idea of all the things that are managed automatically by Clever Cloud 🙂


À lire également

Deploy llama, mistral, openchat or your own model on Clever Cloud

If AI has been in the news recently, it's mainly through large language models (LLMs), which require substantial computing power for training or inference. Thus, it's common to see developers using them via turnkey APIs, as we did in a previous article. But this is changing thanks to more open and efficient models and tools, which you can easily deploy on Clever Cloud.

Our consortium, InfrateX, wins Simpl

The InfrateX Consortium, led by Sopra Steria with NTT Data and including Clever Cloud as a member, has won the significant contract Simpl.
Company Press

Our end-of-year events

The end of the year is already shaping up to be full of events, trade…