How to Use Vultr's Laravel Marketplace Application
![How to Use Vultr's Laravel Marketplace Application header image](https://docs.vultr.com/public/doc-assets/new/how-to-use-vultr-s-laravel-marketplace-application/8d9d853e597256bb.png)
Introduction
Laravel is a popular, open-source PHP web framework designed to make web application development more accessible and efficient. It follows the Model-View-Controller (MVC) architectural pattern and provides an elegant syntax that simplifies common tasks like routing, authentication, and caching. Laravel is known for its robust features, such as an ORM (Eloquent), a powerful templating engine (Blade), and comprehensive tooling for tasks like database migrations and testing. It also includes built-in support for task scheduling, queuing, and RESTful APIs, making it a versatile choice for building modern web applications.
This article explains how to use Vultr's Laravel Marketplace Application. You will apply an SSL certificate to an example application. And connect Vultr Managed Database as a storage solution.
Deploy Laravel Marketplace Application on Vultr
Login to your Vultr Customer Portal and click the Deploy Server button.
Select Optimized Cloud Compute as a server type.
Choose a nearby server location amongst the 32 global locations.
Select Laravel as the Marketplace Application.
Select a server size as per requirements.
Choose any Additional Features as per requirements.
Click the Deploy Now button to start the instance deployment.
Once the instance is deployed go to the server details and copy the SSH details.
Configure Vultr DNS
Navigate to the Products page.
From the side menu, expand the Network dropdown, and select DNS.
Click the Add Domain button in the center.
Follow the setup procedure to add your domain name by selecting the IP address of your server.
Set the following hostnames as your domain's primary and secondary nameservers with your domain registrar:
ns1.vultr.com
ns2.vultr.com
Deploy a Laravel Application
Navigate into the Laravel project directory.
console$ cd /var/www/html/my-laravel-app
Install Certbot to secure the application with SSL.
console$ sudo apt install certbot && python3-certbot-apache -y
Request an SSL certificate for your domain.
console$ sudo certbot --apache -d your_domain.com
Update database configuration in
config/database.php
.phpCopy'mysql' => [ // ... other configurations ... 'sslmode' => 'require', ],
Optional: Deploy a Vultr Managed Database and connect it with the Laravel application.
Open
.env
file.console$ nano .env
Update
.env
file with Vultr Managed Database credentials.DB_CONNECTION=mysql DB_HOST=your_vultr_db_host DB_PORT=your_vultr_db_port DB_DATABASE=defaultdb DB_USERNAME=your_vultr_db_username DB_PASSWORD=your_vultr_db_password
Database details can be retrieved from the Vultr Customer Portal.
Save and close the file.
Setup firewall rules and allow incoming connections.
console$ sudo ufw allow OpenSSH && sudo ufw allow 'Apache Full'
Set proper permissions.
console$ sudo chown -R www-data:www-data /var/www/html/my-laravel-app && sudo chmod -R 755 /var/www/html/my-laravel-app/storage
Run migrations.
console$ php artisan migrate
Benefits of Laravel Marketplace Application
Complete LAMP stack: Comes with Laravel 11.11.1, Apache 2.4.58, MySQL 8.0.37, and PHP 8.3.6 pre-installed and configured, providing a fully functional web development environment out of the box.
Security-Ready: Includes Certbot for easy SSL certificate installation, enhancing application security with HTTPS encryption.
Development Tools: Pre-installed Composer 2.7.7 for dependency management, and a pre-configured Laravel project structure in
/var/www/html/my-laravel-app
for immediate development.Optimized Configuration: Apache virtual host files are pre-configured and stored in
/etc/apache2/sites-available/
, streamlining the setup process for hosting Laravel applications.Latest Framework Features: Includes Laravel's robust ecosystem with features like Eloquent ORM, Blade Templating, Artisan CLI, task scheduling, and real-time event broadcasting capabilities.
Conclusion
In this article, you deployed Vultr's Laravel Marketplace Application. With the pre-installed tools it becomes easier to setup and host a new Laravel Application or migrate and host an existing one.