Install Laravel on my Linux VPS

Collapse

Unconfigured Ad Widget

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Rachel S
    Senior Member
    • Apr 2022
    • 138

    Install Laravel on my Linux VPS

    Hi everyone, I want to install Laravel on my Linux VPS manually. Any help or advice will be appreciated.
  • Clay Page
    Senior Member
    • Sep 2022
    • 100

    #2
    Here are the steps to follow:

    First, you need to log in to your VPS using SSH.


    Step 1. Update your system

    First, update your package list and upgrade installed packages to avoid compatibility issues:
    • sudo apt update && sudo apt upgrade -y
    Step 2. Install PHP and required extensions

    Laravel requires PHP, Composer, and a web server (Apache or Nginx). Install them with:
    • sudo apt install php php-cli php-mbstring php-xml php-bc math php-json php-common php-zip curl git unzip -y
    Step 3. Install ComposerStep 4. Install Laravel
    • composer create-project --prefer-dist laravel/laravel project-name
    Step 5. Set file permissions
    • sudo chown -R www-data:www-data /var/www/project-name && sudo chmod -R 775 /var/www/project-name/storage /var/www/project-name/bootstrap/cache
    Step 6. For Apache: Install Apache and enable mod_rewrite
    • sudo apt install apache2 && sudo a2enmod rewrite && sudo systemctl restart apache2
    Step 6. For Nginx: Install Nginx
    • sudo apt install nginx
    Step 7. Generate application key
    • php artisan key:generate
    Step 8. Create database (MySQL)
    • mysql -u root -p -e "CREATE DATABASE laravel_db;"

    By following these steps, laravel will be installed on your VPS, and you can start building your website or application.

    Comment

    Working...
    X