hosting Laravel resources Tutorial Web Development

How to Build and Deploy a Laravel App to Sevalla

How to Build and Deploy a Laravel App to Sevalla
by Manish M. Shivanandhan | December 07, 2025

Laravel is one of the most popular PHP frameworks that helps us build web applications. It is clean, secure, and easy to learn. 

Laravel also provides tools for adding routes, authentication, and connecting to databases. It handles a lot of heavy lifting for us so that we don’t have to build everything from scratch. 

Sevalla is a PaaS platform that enables you to deploy any apps – including Laravel – without managing servers. When you combine Laravel and Sevalla, you can quickly build and deploy your applications without the need for complex server management.

In this tutorial, we will see how to build a simple Laravel Application and deploy it to the cloud using Sevalla.

What is Laravel

Laravel is a popular framework for building web applications using PHP. It is a toolbox that gives you the core components of a web application. 

Laravel components include authentication, routing, testing and many others. Laravel gives you features that handle most of the setup so that you can focus on building your application. 

Laravel follows the MVC pattern, which stands for Model View Controller. The model will handle the data and manage the database connections. The view handles the user interface. The controller handles all the logic and connects the model and the views. 

Laravel is preferred by beginners since it feels easy to start with. Experienced developers like it because it scales, stays secure, and supports large systems.

How to Install Laravel

Installing Laravel is easy. I will be installing it on Linux, but if you are on a different operating system, you can find the installation instructions here.

/bin/bash -c "$(curl -fsSL https://php.new/install/linux/8.4)

Once the script finishes, restart the terminal, and you should have Laravel CLI installed. You can test it by checking the version.

laravel --version

Laravel Version

Now, let’s create a new project using the CLI.

laravel new api-project

Laravel New

Laravel offers us a lot of customisations, but let’s use all the defaults for now. Once the setup is complete, you can cd into the project directory to see the project files.

To run the application, we use the command composer run dev . This will start the server and serve our application on port 8000. If you visit localhost:8000, you will see the Laravel home page up and running.

Laravel Installation

Great. Our project is now set up, and we have everything we need to start building with Laravel.
Adding an api endpoint
Let’s add a new api endpoint. The default / is serving the home page and is found under routes/web.php. Let’s add a new route
/hello to display “Hello from Laravel”.


Route::get('/hello', function () {
  return 'Hello from Laravel';
});

 

Laravel has a routing system in which Route::get means we are creating a GET request. If this url /hello is hit, it will run the function and execute the code.
This is the final routes/web.php


<?php

use Illuminate\Support\Facades\Route;

Route::get('/', function () {
   return view('welcome');
});

Route::get('/hello', function () {
   return 'Hello from Laravel';
});

 

Using use Illuminate\Support\Facades\Route; tells PHP we want to use the Route class from Laravel’s framework.

Now, let’s confirm if our new route works by going to localhost:3000/hello

Laravel Hello Owrld

What if we want to serve an HTML page for a route? We can use views.
Laravel uses Blade as its template engine. With Blade, you can add data to the page, run loops, conditions, layouts, etc.
Most importantly, you can build blade pages and reuse them whenever needed.
Go to resources/views folder and create a file called hello.blade.php. Let’s add a simple HTML view with h1 tags and wrap the Hello from Laravel inside of it.
This will be the hello.blade.php file.
<h1>Hello from Laravel</h1>
Now let’s update our route to serve the view instead of returning a simple text.


Route::get('/hello', function () {
  return view('hello');
});

 

Now let’s go to localhost:800/hello and see the html page rendered.

Laravel Hello

Great, we have learnt how to add basic routes to our Laravel project. Now let’s see how to deploy it to production.

Deploying to Sevalla

We need a server to deploy our application. We have options like AWS, Azure, Google Cloud or even any VPS solutions.

However, managing these servers on our own is a tedious task. As our application grows larger, it becomes increasingly difficult to scale, apply security patches, and so on. You will need the help of a DevOps to handle these for your application.

This is where Sevalla helps.

Sevalla is a PaaS provider designed for developers and teams shipping software. It offers application hosting, database, object storage, and static site hosting for your projects.

Sevalla

Similar to Laravel, Sevalla handles a lot of heavy lifting for your application. It enables easy deployments via GitHub and has an excellent interface to help you manage your cloud resources. 

Let’s first push our project to GitHub. You can also fork my repository.


git init
git add .
git commit -am "my first laravel route"
git remote add origin 
git push origin master

Log in to Sevalla and click on “Applications -> Create an application”. You will see the options to create a new application. 

Under the repositories section, choose the new repository we just created.

Sevalla - connect repository

Keep the rest of the options as the default unless you want to change the name of the application and choose a bigger server. Sevalla provides a $50 credit, which you can use to get started with your first deployments.. 

Now click “Create application”. Sevalla will pull the code from our repository.

Sevalla - create application

Sevalla now has access to our code. Before we deploy it, Sevalla will need some environment variables that are required for successful deployment. These are found in the .env file of your project. 

Pushing the environment variables to GitHub is not a secure practice. So we will directly upload the environment variables file to Sevalla. 

Before we upload the environment file, change the value for DB_CONNECTION to none. Since we are not using a database in our project, other values in the DB_CONNECTION variable will throw an error. Here is a sample env file for you to use in case you encounter issues. 

Got to the “environment variables” section and click “Add environment variables -> import .env”. You can then upload your .env file directly to Sevalla and see it as a list.

Sevalla variables

Once the deployment is complete, click on “View”. You will see a URL generated by Sevalla ending with sevalla.app. Go to /hello and you will see the view page we added in this tutorial. 

Congrats! You just deployed your Laravel app to production. You can now keep building more routes and push to GitHub. Sevalla will automatically pull your changes and deploy the code to production.

Conclusion

Laravel helps us write clean, structured code. It’s a framework designed to enable us to build scalable applications from the ground up. Sevalla takes care of server setup, hosting, management and scaling your application. 

With this flow, you can focus more on pushing features for your customers and less on managing infrastructure. As you continue building, you will see how Laravel’s scalable structure and Sevalla’s one-click deployments help us ship quality software for our customers.

Did you like this article? Share it with your friends:

Related articles

Introduction to CSS if Statements and Conditional Logic

Introduction to CSS if Statements and Conditional Logic

Conditional logic is a familiar concept to anyone who has written a programming language. Languages like JavaScript or Python use if/else statements to evaluate expressions and execute different blocks of code depending on whether the condition is true or false.

CSS Pulse Animation

CSS Pulse Animation

Enhance user engagement with a smooth pulse animation! This eye-catching effect is perfect for quickly grabbing attention and improving UI interaction. Learn how to implement it now!

Install Mistral AI on Linux

Install Mistral AI on Linux

Learn to install Mistral AI on Linux with this step-by-step guide. Ideal for beginners and advanced users.