# Installing Laravel manually

> Install Laravel by hand over SSH when you need a specific version or a custom setup on your hosting account.

Source: https://helpcenter.ruachost.com/apps/manual-installations/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.

## Why Install Laravel Manually?

- Greater control over version selection.
- Works on unmanaged VPS or dedicated servers.
- Useful for developers who want custom setups.

## Steps to Install Laravel Manually

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:

     ```bash
     cd ~
     ```
   - Run the following command (replace `project` with your desired project name):

     ```bash
     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:

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

     ```bash
     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.

> **Note:**
- Laravel is compatible with all **ruachost.com** accounts.
- Always use strong admin and database passwords.
- Keep Laravel updated to prevent vulnerabilities.
- Consider enabling automatic backups for added protection.
- Repeat steps 4–6 if you modify any public site files in the project directory.
