title | author | format | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Laravel Deployment |
Vladimir Lelicanin - SAE Institute |
|
In this presentation, we'll discuss Laravel manual deployment and Laravel Forge - two ways to deploy Laravel applications.
To manually deploy a Laravel application, you need to:
- Manually upload/copy the code files to the production server
- Run
composer install
to install dependencies - Configure the environment variables
- Configure web server to serve
public/index.php
Copy the Laravel application files to the production server.
$ scp -r app_dir user@server:/path/
Install dependencies using Composer.
$ composer install --no-dev
Configure .env
file.
APP_NAME=Laravel
APP_ENV=production
...
Configure the web server. Below is an example Apache configuration.
<VirtualHost *:80>
DocumentRoot /path/public
<Directory /path/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
Laravel Forge is a server provisioning and deployment tool for Laravel applications. It simplifies the process of deploying the application by automating many of the steps.
- One-click server setup
- Automatic security updates
- Easy SSL certificate deployment
- Automatic daily backups
- Quick deployment of Laravel applications
- Integration with cloud hosting providers like DigitalOcean
The deployment process can be broken down into the following steps:
- Connect Forge to your Git repository
- Configure the server settings
- Create a site for your Laravel application
- Deploy the application
Assuming your Laravel application code is in a git repository, you can connect Forge to your repository with just a few clicks.
Once Forge is connected to your repository, you need to configure the server settings. Some of the settings include:
- Server size
- Database type and credentials
- Auto-deployment settings
- Web server software
After you've configured the server settings, you can create a site for your Laravel application. In the site settings, you can:
- Choose the PHP version
- Define environment variables
- Set up SSL certificate
Once everything is set up, deploying your Laravel application is as easy as clicking the "Deploy Now" button.
- Saves time and effort
- Secure and easy deployment
- Convenient integration with cloud hosting providers
- Easy scaling
- Takes care of server and maintenance tasks
- You can deploy Laravel applications manually or through Laravel Forge
- Laravel Forge is a more automated and secure way of deploying applications
- Laravel Forge saves time and maximizes productivity
- Laravel Documentation: https://laravel.com/docs
- Laravel Forge: https://forge.laravel.com/docs
- Laravel Forge FAQ: https://forge.laravel.com/faq