Laravel 11 uses Sanctum REST API Authentication
Hello dear,
In this tutorial, I will guide you on how to clone a Laravel project from GitHub, GitLab, or Bitbucket and set it up on an Ubuntu server from scratch. Whether you're working with Laravel 6, 7, 8, 9, 10, or 11, this guide will help you easily clone and configure your Laravel application.
Let's walk through the process and get your Laravel app running.

Prerequisites
Before cloning and setting up a Laravel project, ensure the following tools are installed on your system:
-
Git: A version control system for tracking code changes.
š Download Git and follow the installation instructions for your OS.
-
PHP: Laravel requires PHP 7.3 or higher.
š Check your version by running:
-
Composer: A dependency manager for PHP used to install Laravel packages.
š Download Composer and install it according to your OS.
-
Web Server: Apache or Nginx is recommended for production. Laravel includes a built-in development server for local testing.
-
Database: Install a supported database (e.g., MySQL, PostgreSQL, SQLite) depending on what the Laravel project requires.
-
Postman (Optional but recommended): An API platform to test and manage API requests.
š Download Postman
Steps to Clone and Set Up the Laravel Project
1. Clone the Project Repository
Open your terminal and navigate to the directory where you want to clone the project. Run:
Replace the URL above with your project repository if different.
2. Navigate to the Project Directory
3. Install Composer Dependencies
4. Set Up Environment File
Copy the example environment file:
Then open .env
and configure your database and environment settings.
5. Generate Application Key
6. Configure Database in .env
Update the database section of your .env
file:
7. Run Migrations
Create the necessary database tables:
8. Serve the Laravel Application
Start the local development server:
The app will be available at:
http://localhost:8000