Skip to content

Linux VPS & VPS Windows Setup Guide | NetCloud24 Laravel Framework on Debian 11

Netcloud24
Cloud Infrastructure Expert
NetCloud24 Expert Guides Open the dedicated video page

Video transcript: NetCloud24 Expert Guides. Practical knowledge for a reliable cloud. Cloud and VPS expertise, security, performance, and step-by-step tutorials. Learn, deploy, and keep building with NetCloud24.

 

 

Laravel is a popular PHP framework that makes web application development easy and enjoyable. This guide will walk you through the steps to install Laravel on a fresh Debian 11 server.

Step 1: Update Your System

Before starting the installation, ensure your system is up to date:

sudo apt update && sudo apt upgrade -y

Step 2: Install PHP and Required Extensions

Laravel requires PHP 7.4 or higher. Install PHP and the necessary extensions:

sudo apt install php php-cli php-mbstring php-xml php-curl php-zip php-gd php-mysql -y

Step 3: Install Composer

Composer is a dependency manager for PHP. Install it using the following commands:

Visual overview of Linux VPS & VPS Windows Setup Guide | NetCloud24 Laravel Framework on Debian 11
Visual overview: Linux VPS & VPS Windows Setup Guide | NetCloud24 Laravel Framework on Debian 11
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

Step 4: Install Laravel

Now you can install Laravel. Navigate to your web server’s root directory (usually /var/www/html) and create a new Laravel project:

cd /var/www/html
composer create-project --prefer-dist laravel/laravel myproject

Step 5: Set Permissions

Set the necessary permissions for the Laravel directory:

sudo chown -R www-data:www-data /var/www/html/myproject
sudo chmod -R 755 /var/www/html/myproject

Step 6: Configure Your Web Server

If you are using Apache, create a new configuration file:

sudo nano /etc/apache2/sites-available/myproject.conf

Add the following configuration:

<VirtualHost *:80>
    ServerName your_domain.com
    DocumentRoot /var/www/html/myproject/public

    <Directory /var/www/html/myproject/public>
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/myproject-error.log
    CustomLog ${APACHE_LOG_DIR}/myproject-access.log combined
</VirtualHost>

Enable the new site and the rewrite module, then restart Apache:

Key topics covered in Linux VPS & VPS Windows Setup Guide | NetCloud24 Laravel Framework on Debian 11
Key topics covered in this NetCloud24 guide.
sudo a2ensite myproject
sudo a2enmod rewrite
sudo systemctl restart apache2

Step 7: Access Your Laravel Application

Open your web browser and navigate to http://your_domain.com to see your Laravel application in action!

Conclusion

You have successfully installed the Laravel framework on Debian 11. This framework will help you build modern web applications quickly and efficiently.

If you’re looking for a reliable hosting solution for your Laravel applications, consider using . With Windows VPS, you can efficiently host your applications and ensure high performance. Whether you need or Windows VPSVirtual Private Servers, you’ll find a solution that fits your requirements.

For larger deployments or enterprise needs, explore Windows VPS or Virtual Private Server Hosting Windows. Whether you’re located in the UK, Italy, or elsewhere, Microsoft SQL VPS Windows and UK VPS Windows offer reliable hosting options. Visit Windows VPS Hosting UK to discover the best hosting solutions for your needs.

Linux VPS & VPS Windows Setup Guide | NetCloud24 Laravel Framework on Debian 11
Linux VPS & VPS Windows Setup Guide | NetCloud24 Laravel Framework on Debian 11
Explore more

More on this topic

Netcloud24
Netcloud24
Cloud Infrastructure Expert · NetCloud24

Comments are closed.