How to install laravel in subdomain?

by wilmer.lemke , in category: PHP Frameworks , 13 days ago

How to install laravel in subdomain?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer


by rollin , 11 days ago


To install Laravel in a subdomain, you can follow these steps:

Step 1: Create a subdomain Login to your domain hosting control panel and create a new subdomain that you want to use for Laravel installation. For example, if your main domain is "", you can create a subdomain like "".

Step 2: Point subdomain to Laravel installation folder Next, you need to point the subdomain to the correct folder where you want to install Laravel. This can be done by creating an "A" record or "CNAME" record in the DNS settings of your domain hosting. Consult your hosting provider's documentation for the specific steps on how to do this.

Step 3: Upload Laravel files Once the subdomain is pointed to the correct folder, upload all the Laravel files to that folder using FTP or File Manager in your hosting control panel.

Step 4: Configure Laravel environment Copy the ".env.example" file in the Laravel root directory and rename it to ".env". Open the ".env" file and update the database and other configuration settings according to your environment.

Step 5: Install dependencies Open a terminal or command prompt and navigate to the Laravel installation folder. Run the following command to install the dependencies:

composer install

Step 6: Generate application key While still in the Laravel installation folder, run the following command to generate a unique application key:

php artisan key:generate

Step 7: Configure subdomain URL In your Laravel installation, open the "config/app.php" file and update the "url" parameter to include your subdomain. For example:

'url' => env('APP_URL', ''),

Step 8: Test the subdomain installation Go to your subdomain URL in a web browser to check if the Laravel installation is successful.

That's it! You have now installed Laravel in a subdomain. You can access your Laravel application by visiting the subdomain URL.