Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

CESolomon's avatar

From project to deployment (and maintenance)?

Maybe I have missed it, but I looked all around the content and could not find anything like this.

Ok....so I created my Laravel+Inertia+Vue app with a MySQL database backend (insert whatever DB you like there). Now the fun part....deplolying it and making it "live" for users.

To that end, I have not seen any series on this that covers...

  • getting your application ready for deployment (build and bundle)
  • 3rd party considerations (what if you are using other services like Stripe or such?)
  • moving to your host server (assuming a "production" server but this could be "staging" also)
  • moving your database to your host server (with or without existing data such as master data or some legacy data)
  • turning "on" your "live" application
  • what happens when you need to fix bugs or add features (ie. deploy updates)?
  • basic app/site maintenance AFTER it is "live"

Did I miss it or does nothing like this exist on Laracasts? TIA!

0 likes
2 replies
LaryAI's avatar
Level 58

Certainly! Here’s a step-by-step solution that addresses your questions about deploying and maintaining a Laravel + Inertia + Vue app with a MySQL backend. While Laracasts has many series on deployment and best practices, there isn’t a single series that covers the entire end-to-end process in one place. Here’s a practical guide to help you:


1. Getting Your Application Ready for Deployment (Build and Bundle)

  • Environment Configuration:
    Set your .env variables for production (e.g., APP_ENV=production, APP_DEBUG=false, correct DB credentials, etc.).
  • Build Assets:
    Run your frontend build process to compile and minify assets:
    npm install
    npm run build
    
  • Optimize Laravel:
    Run Laravel’s optimization commands:
    php artisan config:cache
    php artisan route:cache
    php artisan view:cache
    

2. 3rd Party Considerations (e.g., Stripe, Mail, etc.)

  • Environment Variables:
    Ensure all 3rd party service keys (Stripe, Mailgun, etc.) are set in your production .env file.
  • Testing:
    Test integrations in a staging environment before going live.

3. Moving to Your Host Server

  • Code Deployment:
    You can use Git, SFTP, or deployment tools (like Envoyer, Forge, Deployer, GitHub Actions, etc.) to move your code to the server.
  • Dependencies:
    On the server, run:
    composer install --optimize-autoloader --no-dev
    npm ci --production
    
  • Permissions:
    Set correct permissions for storage and bootstrap/cache directories.

4. Moving Your Database

  • Export/Import:
    Use mysqldump to export your local database and import it on your production server:
    mysqldump -u username -p database_name > backup.sql
    mysql -u username -p production_db < backup.sql
    
  • Migrations/Seeders:
    Alternatively, use Laravel migrations and seeders for structure and master data:
    php artisan migrate --force
    php artisan db:seed --force
    

5. Turning "On" Your "Live" Application

  • Web Server Configuration:
    Point your web server (Nginx/Apache) to the public directory.
  • SSL:
    Set up SSL (Let’s Encrypt is free and easy).
  • Queue/Cache:
    Start any necessary queue workers and cache systems.

6. Deploying Updates (Bug Fixes, Features)

  • Zero Downtime Deployment:
    Use tools like Envoyer or Deployer for zero-downtime deployments.
  • Manual Steps:
    For small projects, you can pull changes, run migrations, and rebuild assets:
    git pull origin main
    composer install --optimize-autoloader --no-dev
    php artisan migrate --force
    npm run build
    php artisan config:cache
    

7. Basic App/Site Maintenance After It Is "Live"

  • Backups:
    Schedule regular backups of your database and important files.
  • Monitoring:
    Use tools like Laravel Telescope, Sentry, or Bugsnag for error monitoring.
  • Updates:
    Keep dependencies up to date and regularly patch security vulnerabilities.
  • Logs:
    Monitor logs for errors (storage/logs/laravel.log).

Further Learning


Summary:
While there isn’t a single Laracasts series that covers every step from project to deployment and maintenance, the above workflow should help you get your app live and keep it running smoothly. Each step can be explored in more detail via Laracasts and the official Laravel documentation.

If you have specific questions about any step, feel free to ask!

Glukinho's avatar

Have a public accessible server (VPS), install there a web server, PHP of your version, DB server.

Have a domain, point a domain name to your public IP address.

Obtain a letsencrypt HTTPS certificate.

Deploy your code (probably with git, checkout HEAD of master branch) to some folder, point your web server to laravel's index.php.

Run migrations. Prepare and seed to DB some initial data your app needs from the beginning.

Tune .env file with production values.

Start queue workers (if you have queues). Make sure the worker starts after server reboot.

Basic maintenance and monitoring:

  • free space on filesystem
  • certificate renewal
  • site is alive and responding (utilize laravel embedded /up health route)
  • queue workers are alive, queues are actually processed

To update your app, basically you should have a dev git branch, do your coding & tests, after the update is ready you merge dev to master and deploy master to your server same way as at the beginning.

These are general steps.

Please or to participate in this conversation.