Skip to content

Installing Laravel manually

Laravel is a modern PHP framework designed for building robust web applications. While Softaculous can automate installation, you may sometimes need to install Laravel manually, for example, if you want a specific version or are working on an unmanaged server.

  • Greater control over version selection.
  • Works on unmanaged VPS or dedicated servers.
  • Useful for developers who want custom setups.
  1. Log in to Your Account via SSH.

    • Use an SSH client to connect to your hosting account.
  2. Install Laravel Using Composer.

    • Laravel uses Composer, a PHP dependency manager.

    • Navigate to your home directory:

      Terminal window
      cd ~
    • Run the following command (replace project with your desired project name):

      Terminal window
      composer create-project laravel/laravel project
    • This installs Laravel in /home/username/project.

  3. Set Up Artisan Alias (Optional).

    • Artisan is Laravel’s command‑line interface.

    • To run Artisan by simply typing artisan, add an alias:

      echo 'alias artisan="php /home/username/project/artisan"' >> ~/.bashrc
      source ~/.bashrc
  4. Make Laravel Publicly Accessible.

    • Copy the contents of the public directory to your public_html folder:

      Terminal window
      cp -r ~/project/public/* ~/public_html
    • Alternatively, copy to a subdirectory (e.g., public_html/laravel):

      Terminal window
      cp -r ~/project/public/* ~/public_html/laravel
    • In this case, your site will be accessible at http://example.com/laravel.

  5. Update index.php Paths.

    • Open public_html/index.php in a text editor.

    • Update the following lines to include the correct project directory:

      require __DIR__.'/../project/vendor/autoload.php';
      require __DIR__.'/../project/bootstrap/app.php';
  6. Verify Installation.

    • In your browser, go to http://example.com.
    • You should see the Laravel welcome page.