This tutorial demonstrates how to clone a Laravel application from GitHub, GitLab, or Bitbucket and get it up and running on an Ubuntu server. You’ll learn how to clone the repo (SSH or HTTPS), install dependencies, configure environment variables, run migrations, set file permissions, and perform the basic Nginx + PHP-FPM setup. The steps work for Laravel 6 through Laravel 11 — I’ll note where versions can differ. Follow along and you’ll have your Laravel app up and serving requests in no time.
*Git: Git is a version control system that tracks source code changes during software development. Make sure Git is installed on your system. You can download Git from https://git-scm.com/ and follow the installation instructions for your operating system.
*PHP: Laravel requires PHP to be installed on your system. You need PHP version 7.3 or higher. You can check your PHP version by running php -v in your terminal.
*Composer: Composer is a dependency manager for PHP and is used to install Laravel and its dependencies. You can download Composer from https://getcomposer.org/ and follow the installation instructions for your operating system.
*Web Server: You'll need a web server to serve your Laravel application. While Laravel comes with a built-in development server, it's recommended that Apache or Nginx be used for production deployments.
*Database: If the cloned project uses a database, make sure you have the required database management system (e.g., MySQL, PostgreSQL, SQLite) installed on your system.
Steps to Clone and Set Up the Project
1. Clone the Project
Open your terminal or command prompt and navigate to the directory where you want to store the project. Then run: