---
title: How to Use Vultr's Laravel Marketplace Application
url: https://docs.vultr.com/how-to-use-vultr-s-laravel-marketplace-application
description: Learn how to deploy, configure, and optimize Laravel applications using Vultr's Marketplace for faster development and seamless hosting on their cloud infrastructure.
publish_date: 2024-07-26T13:03:06.298956Z
last_updated: 2026-04-15T00:00:00.077250Z
author: Abhinav Shaurya Agarwal
header_image: https://assets.vultrdevrel.com/docs-main-doc-assets-1/1879/e97a0aa9-6e29-40ed-ba92-c0cb7dfc39f9.png
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt

Laravel is a popular, open-source PHP web framework designed for building modern web applications with elegant syntax. It follows the Model-View-Controller (MVC) architectural pattern and provides powerful features like Eloquent ORM, Blade templating, built-in authentication, and comprehensive tooling for database migrations, task scheduling, and API development. The Vultr Marketplace provides a pre-configured Laravel environment with the complete LAMP stack, enabling quick deployment and setup on a Vultr server.

This guide explains deploying and using [Vultr's Laravel Marketplace Application](https://www.vultr.com/marketplace/apps/laravel). You will deploy an instance, configure DNS and SSL, connect to a Vultr Managed Database, explore Laravel features, and implement security best practices for deployment.

## Deploy Vultr's Laravel Marketplace Application

1. Log in to your [Vultr Console](https://console.vultr.com/) and click the **Deploy Server** button.

1. Select your preferred server type.

1. Choose a server location.

1. Select a server plan with at least **2GB RAM** and **2 CPU cores** for production workloads.

1. Click the **Configure** button to proceed.

1. Under **Marketplace Apps**, search for `Laravel` and select it as the Marketplace Application.

1. Select the **Limited Login** option from the **Additional Features** section to create a limited user with sudo access.

1. Review your configurations and click the **Deploy Now** button to start deployment.

    > [!NOTE]
    > It may take up to 10 minutes for your server to finish installing Laravel and the LAMP stack.

1. After the instance shows the status of Running, navigate to the **Server Overview** page and copy the SSH connection details.

## Initial Setup and Configuration

After deployment, configure DNS, verify the installation, and secure your Laravel application with SSL/TLS before exposing it to production traffic.

1. Create a [DNS A record](https://docs.vultr.com/products/network/dns/provisioning) pointing to your server's IP address, such as `laravel.example.com`.

1. Connect to your Vultr server instance over [SSH](https://docs.vultr.com/how-to-use-ssh-with-vultr-servers) using the connection details from the Server Overview page.

### Verify Laravel Installation

1. Check the Apache web server status.

    ```console
    $ sudo systemctl status apache2
    ```

    The service should show as `active (running)`.

1. Navigate to the Laravel project directory.

    ```console
    $ cd /var/www/html/my-laravel-app
    ```

1. Verify Laravel installation and check the version.

    ```console
    $ php artisan --version
    ```

    Output:

    ```
    Laravel Framework 12.34.0
    ```

1. Test the application by accessing `http://laravel.example.com` in a web browser. You should see the default Laravel welcome page.

### Configure Firewall Security

Secure your server by configuring the firewall to allow only necessary traffic before enabling SSL.

1. Allow SSH connections.

    ```console
    $ sudo ufw allow OpenSSH
    ```

1. Allow HTTP and HTTPS traffic for Apache and Certbot.

    ```console
    $ sudo ufw allow "Apache Full"
    ```

1. Enable the firewall.

    ```console
    $ sudo ufw enable
    ```

1. Verify firewall status.

    ```console
    $ sudo ufw status
    ```

### Secure Laravel with SSL/TLS

Protect your Laravel application with HTTPS using Let's Encrypt certificates via Certbot.

1. Install Certbot and the Apache plugin.

    ```console
    $ sudo apt install certbot python3-certbot-apache -y
    ```

1. Request an SSL certificate for your domain.

    ```console
    $ sudo certbot --apache -d laravel.example.com
    ```

    Follow the prompts and select the option to redirect HTTP traffic to HTTPS when asked.

1. Verify SSL certificate auto-renewal.

    ```console
    $ sudo certbot renew --dry-run
    ```

1. Access your Laravel application securely at `https://laravel.example.com`.

## Configure Laravel Application

Set up your Laravel application environment, configure the database connection, and prepare for deployment.

### Update Environment Configuration

1. Navigate to the Laravel project directory.

    ```console
    $ cd /var/www/html/my-laravel-app
    ```

1. Edit the `.env` file.

    ```console
    $ nano .env
    ```

    ```ini
    APP_NAME="My Laravel App"
    APP_ENV=production
    APP_DEBUG=false
    APP_URL=https://laravel.example.com
    ```

    Set `APP_DEBUG=false` to prevent sensitive information leakage.

    Save and close the file.

### Set Proper Permissions

1. Set ownership to the web server user.

    ```console
    $ sudo chown -R www-data:www-data /var/www/html/my-laravel-app
    ```

1. Set safe file permissions (644 for files, 755 for directories).

    ```console
    $ sudo find /var/www/html/my-laravel-app -type f -exec chmod 644 {} \;
    $ sudo find /var/www/html/my-laravel-app -type d -exec chmod 755 {} \;
    ```

1. Set writable permissions for storage and cache directories.

    ```console
    $ sudo chmod -R 775 /var/www/html/my-laravel-app/storage
    $ sudo chmod -R 775 /var/www/html/my-laravel-app/bootstrap/cache
    ```

1. Create a symbolic link for public storage.

    ```console
    $ cd /var/www/html/my-laravel-app
    $ php artisan storage:link
    ```

    This allows uploaded files and images to be publicly accessible.

### Configure Apache Virtual Host

1. Edit the Apache configuration file for your Laravel application.

    ```console
    $ sudo nano /etc/apache2/sites-available/laravel.conf
    ```

    ```ini
    <VirtualHost *:80>
        ServerName laravel.example.com
        ServerAdmin admin@laravel.example.com
        DocumentRoot /var/www/html/my-laravel-app/public

        <Directory /var/www/html/my-laravel-app/public>
            Options -Indexes +FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>

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

    Replace `laravel.example.com` with your domain name.

1. Disable the default site and enable Laravel site.

    ```console
    $ sudo a2dissite 000-default.conf
    $ sudo a2ensite laravel.conf
    $ sudo a2enmod rewrite
    ```

1. Test Apache configuration.

    ```console
    $ sudo apache2ctl configtest
    ```

    Output:

    ```
    Syntax OK
    ```

1. Reload Apache to apply changes.

    ```console
    $ sudo systemctl reload apache2
    ```

## Connect to Vultr Managed Database

Enhance your Laravel application's reliability and scalability by connecting to a Vultr Managed Database for MySQL. This provides automatic backups, monitoring, and maintenance.

1. Deploy a [Vultr Managed Database for MySQL](https://console.vultr.com//databases/) from the Vultr Console.

1. From the Managed Database dashboard, note the following connection details:

    * Host
    * Port
    * Database name
    * Username
    * Password

1. Edit the Laravel `.env` file.

    ```console
    $ nano /var/www/html/my-laravel-app/.env
    ```

    ```ini
    DB_CONNECTION=mysql
    DB_HOST=your-managed-db-host.vultr.com
    DB_PORT=16751
    DB_DATABASE=defaultdb
    DB_USERNAME=vultradmin
    DB_PASSWORD=your_secure_password
    ```

    Save and close the file.

1. Update Laravel's database configuration to require SSL connections.

    ```console
    $ nano /var/www/html/my-laravel-app/config/database.php
    ```

    Locate the `mysql` configuration array and add SSL settings.

    ```php
    'mysql' => [
        'driver' => 'mysql',
        'url' => env('DATABASE_URL'),
        'host' => env('DB_HOST', '127.0.0.1'),
        'port' => env('DB_PORT', '3306'),
        'database' => env('DB_DATABASE', 'forge'),
        'username' => env('DB_USERNAME', 'forge'),
        'password' => env('DB_PASSWORD', ''),
        'unix_socket' => env('DB_SOCKET', ''),
        'charset' => 'utf8mb4',
        'collation' => 'utf8mb4_unicode_ci',
        'prefix' => '',
        'prefix_indexes' => true,
        'strict' => true,
        'engine' => null,
        'options' => extension_loaded('pdo_mysql') ? array_filter([
            PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
            PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false,
        ]) : [],
    ],
    ```

    Save and close the file.

1. Test the database connection.

    ```console
    $ php artisan migrate:status
    ```

    If the connection is successful, you'll see the migration table status.

1. Run database migrations to create tables.

    ```console
    $ php artisan migrate
    ```

1. (Optional) Seed the database with initial data.

    ```console
    $ php artisan db:seed
    ```

## Explore Laravel Features

Laravel provides a rich set of features for building modern web applications. This section demonstrates core functionality.

### Artisan CLI Commands

Artisan is Laravel's command-line interface for managing your application.

1. List all available Artisan commands.

    ```console
    $ php artisan list
    ```

1. Create a new controller.

    ```console
    $ php artisan make:controller ProductController
    ```

1. Create a new model with migration.

    ```console
    $ php artisan make:model Product -m
    ```

1. Clear application cache.

    ```console
    $ php artisan cache:clear
    $ php artisan config:clear
    $ php artisan route:clear
    $ php artisan view:clear
    ```

### Task Scheduling

Laravel's task scheduler allows you to manage scheduled tasks within your application.

1. Edit the server's crontab.

    ```console
    $ sudo crontab -e -u www-data
    ```

    ```ini
    * * * * * cd /var/www/html/my-laravel-app && php artisan schedule:run >> /dev/null 2>&1
    ```

    This runs Laravel's task scheduler every minute.

1. Define scheduled tasks in `app/Console/Kernel.php`.

### Queue Workers

For handling background jobs, configure Laravel's queue system.

1. Update the `.env` file to use the database queue driver.

    ```console
    $ nano /var/www/html/my-laravel-app/.env
    ```

    ```ini
    QUEUE_CONNECTION=database
    ```

    Save and close the file.

1. Create the jobs table.

    ```console
    $ php artisan queue:table
    $ php artisan migrate
    ```

1. Start a queue worker.

    ```console
    $ php artisan queue:work --tries=3
    ```

1. Set up Supervisor to keep the queue worker running.

    ```console
    $ sudo apt install supervisor -y
    ```

1. Create a Supervisor configuration file for the Laravel queue worker.

    ```console
    $ sudo nano /etc/supervisor/conf.d/laravel-worker.conf
    ```

    ```ini
    [program:laravel-worker]
    process_name=%(program_name)s_%(process_num)02d
    command=php /var/www/html/my-laravel-app/artisan queue:work --sleep=3 --tries=3 --max-time=3600
    autostart=true
    autorestart=true
    stopasgroup=true
    killasgroup=true
    user=www-data
    numprocs=1
    redirect_stderr=true
    stdout_logfile=/var/www/html/my-laravel-app/storage/logs/worker.log
    stopwaitsecs=3600
    ```

    Save and close the file.

1. Start the Supervisor worker.

    ```console
    $ sudo supervisorctl reread
    $ sudo supervisorctl update
    $ sudo supervisorctl start laravel-worker:*
    ```

1. Check the worker status.

    ```console
    $ sudo supervisorctl status
    ```

## Best Practices and Configuration

Implement these recommendations to ensure your Laravel application runs securely and efficiently.

### Enable Production Optimizations

1. Cache configuration files for faster loading.

    ```console
    $ php artisan config:cache
    ```

1. Cache routes for better performance.

    ```console
    $ php artisan route:cache
    ```

1. Cache views to reduce compilation overhead.

    ```console
    $ php artisan view:cache
    ```

1. Optimize Composer autoloader.

    ```console
    $ composer install --optimize-autoloader --no-dev
    ```

### Security Hardening

1. Ensure the `.env` file is not accessible via the web.

    ```console
    $ sudo chmod 600 /var/www/html/my-laravel-app/.env
    ```

1. Disable directory listing in Apache (already configured in virtual host with `-Indexes`).

1. Keep Laravel and dependencies updated.

    ```console
    $ composer update
    $ php artisan migrate
    ```

1. Implement rate limiting for API routes in `app/Http/Kernel.php`.

### Monitoring and Logging

1. Configure log channels in `config/logging.php`.

1. View Laravel logs.

    ```console
    $ tail -f /var/www/html/my-laravel-app/storage/logs/laravel.log
    ```

1. View Apache error logs.

    ```console
    $ sudo tail -f /var/log/apache2/laravel-error.log
    ```

1. Monitor application performance with Laravel Telescope (for development).

    ```console
    $ composer require laravel/telescope --dev
    $ php artisan telescope:install
    $ php artisan migrate
    ```

## Troubleshooting

This section covers common issues and diagnostic commands to help resolve problems with your Laravel application.

### Check Service Status

1. Verify Apache is running.

    ```console
    $ sudo systemctl status apache2
    ```

1. Check MySQL service (if using local MySQL).

    ```console
    $ sudo systemctl status mysql
    ```

1. View recent Apache error logs.

    ```console
    $ sudo tail -50 /var/log/apache2/error.log
    ```

### Common Issues

#### 500 Internal Server Error

1. Check Laravel logs for detailed error messages.

    ```console
    $ tail -f /var/www/html/my-laravel-app/storage/logs/laravel.log
    ```

1. Ensure proper permissions.

    ```console
    $ sudo chown -R www-data:www-data /var/www/html/my-laravel-app
    $ sudo chmod -R 775 /var/www/html/my-laravel-app/storage
    ```

1. Clear all caches.

    ```console
    $ php artisan cache:clear
    $ php artisan config:clear
    $ php artisan route:clear
    ```

#### Database Connection Issues

1. Open Tinker to test the database connection.

    ```console
    $ php artisan tinker
    ```

1. In the Tinker prompt, run:

    ```sql
    > DB::connection()->getPdo();
    ```

1. Verify database credentials in `.env` file.

1. Check if the Managed Database allows connections from your server's IP.

#### Permission Denied Errors

1. Fix ownership and 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
    $ sudo chmod -R 775 /var/www/html/my-laravel-app/storage
    $ sudo chmod -R 775 /var/www/html/my-laravel-app/bootstrap/cache
    ```

## Use Cases

Laravel excels in various real-world application scenarios:

* **E-commerce Platforms**: Build scalable online stores with Laravel's Eloquent ORM, payment gateway integrations, and inventory management capabilities.
* **SaaS Applications**: Develop multi-tenant SaaS platforms with Laravel's authentication, authorization, and subscription billing features.
* **Content Management Systems**: Create custom CMS solutions with Laravel's flexible routing, Blade templating, and media management.
* **RESTful APIs**: Build robust APIs for mobile and web applications with Laravel's API resources, authentication, and rate limiting.
* **Real-time Applications**: Implement real-time features like chat, notifications, and live updates using Laravel Echo and WebSockets.
* **Enterprise Applications**: Develop complex business applications with Laravel's comprehensive tooling, testing capabilities, and maintainable code structure.

## Conclusion

In this guide, you deployed Vultr's Laravel Marketplace Application with a complete LAMP stack. You configured DNS, secured the application with SSL/TLS, connected to a Vultr Managed Database for enhanced reliability, and implemented best practices including caching, security hardening, and monitoring. With Laravel's powerful features and Vultr's infrastructure, you can build and deploy scalable, modern web applications efficiently.
