Configuring Laravel on our Server for Deploying a Laravel 5 App

Configuring Laravel on our Server for Deploying a Laravel 5 App



How to configure Laravel on your server and setting the correct permissions.
Read the Full Ultimate Guide here:

— DEALS —

I personally recommend Vultr for hosting your Virtual Private Server because of their speed and support. These servers are blazing fast and easy to set up. I will be using Vultr in these tutorials.

Get $20 free credit from Vultr:

Get $10 free credit from DigitalOcean:

— MORE FROM THIS SERIES —

Introduction:

Part 1 – Hosting and VPS Set-Up:

Part 2a – Installing LEMP Technology Stack:

Part 2b – Installing LAMP Technology Stack:
Coming Soon

Part 3 – Server-side Git Setup:

Part 4 – Configuring Laravel on our Server:

Full Playlist:

— DEVMARKETER INSIDER —

Subscribe to DevMarketer Insider – A weekly (once a week) email newsletter to fans that want to know everything that is happening with DevMarketer, including announcements and articles not published on this channel. No spam ever, I promise, unsubscribe anytime.

— FOLLOW ME —

Subscribe for New Releases!

Twitter –
(ask me questions!)

— QUESTIONS? —

Leave a comment below and I or someone else can help you.
For quick questions you may also want to ask me on Twitter, I respond almost immediately.

Email me [email protected]

Thanks for all your support!

39 thoughts on “Configuring Laravel on our Server for Deploying a Laravel 5 App

  1. Awesome for the first deploy app, how about after that the app always change by developer could you teach me how to update code to VPS ,thank you

  2. Hey Alex, realy great tutorial! Thynk u very much! Unfortunately I got some trouble here 27:06
    SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas

    sword: YES)
    Do enyone have eny idea, what to do?
    UPDATE: solved by adjusting the .env file and than run command 'php artisan config:cache'

  3. Alex, thank you so much for all tutorials!

    For those who are having the '500 server error', try to GRANT ALL PROVILEGES in mysql as it follows:

    Steps:
    1. open terminal
    2. mysql -u root -p (enter)
    3. enter your password
    4. use mysql;
    5. select user, host, plugin from mysql.user;
    6. update user set plugin='mysql_native_password' where user='root';
    7.GRANT ALL ON blog.* TO 'root'@'localhost';
    8.flush privileges;
    9. exit;
    10. service mysql restart

  4. I couldn't believe that I learned and could do it in practice so fast. One of the best tutorials I've ever seen. Thanks Alex!

  5. Hi,

    I really appreciate this tutorial. However, I encountered a problem during the process. I have set up the hooks as stated on this tutorial, but when I try to push my work to our server, it error out stating:

    [email protected]: Permission denied (publickey)

    I am expecting it to ask me for the password when I push my master branch to production. But here, it immediately error out.

    Just to note that when I SSH to our server, it always requires the .ppk file to access. I'm thinking that may be the cause, but I don't know how to handle it.

    Please help.

  6. I am not able to make the migrations because I am receiving "wrong credentials message" username, db and password are correct because I was able to connect to mysql and create database but host is wrong, anyone had that problem before? What should I use as host? Instance name and website ip are not working.

  7. thank for this awesome tutorials but i am getting this error This page isn’t working188.166.24.30 is currently unable to handle this request.
    HTTP ERROR 500 i follow u step by step
    plz help

  8. If you are getting the 500 Server Error:
    in you .env file, you probably have an option for APP_URL (you wont see this option in this video, because he's using an older version of Laravel)

    Make sure you change APP_URL=http://[your domain or ip address]

  9. If you get down to Step 14 and you're having an issue
    (you'll notice errors with the composer command, and your index.php will still be blank, instead of showing "Whoops, looks like something went wrong")

    It's probably because you're watching this video in 2020, using Laravel 7 and you are installing PHP 7.0 instead of 7.4
    So, I think that Laravel 7 requires any version of 7+ but I was still having problems with 7.0

    To fix this, enter:
    # php -v
    (This will show you the current version of PHP you have installed)
    # cd /etc/php
    # ls
    (This will list all versions you have installed. You'll probably just see "7.0")
    # apt-get purge 'php*'
    (This will delete any versions of php installed on the machine. If you cd back into /etc/php, you might still see '7.0' there. Most likely the folders are empty. You can cd into each folder, 'ls' to check the files, and 'rmdir FOLDERNAME' to remove any empty directories)
    # cd ~
    (Head back to the root directory)

    Make sure apt-get is up to date:
    # apt-get update

    Now, repeat Step 6 (Install PHP) and Step 7 (Configure PHP | Configure NGINX)
    The big difference here is that, instead of 7.0, you'll want to enter 7.4 (the latest version of php)
    Example:
    sudo apt-get install php7.4-fpm php7.4-mysql php7.4-mbstring

    When this is finished, check the php version again:
    # php -v
    (You should see Version 7.4)

    Continue completing the remaining procedures in Steps 6/7. Remember to substitute 7.0 with 7.4
    Example: sudo nano /etc/php/7.4/fpm/php.ini

    When you've got PHP reinstalled, you can get back to Step 14.
    Make sure you are NOT on the root user for this step. You should actually be on a different user. I don't really know why.
    (There is a pretty good guide on digital ocean if you need help setting up a new user: https://www.digitalocean.com/community/tutorials/how-to-create-a-sudo-user-on-ubuntu-quickstart)
    # ssh [email protected]
    [email protected]:~$
    $ cd /var/www/laravel
    $ composer install –no-dev

  10. I usually hate clicking affiliate links on videos like this because the creator is useless and just trying to make a quick buck. You on the other hand, are super knowledgable and actually know what you're doing. I will be clicking your affiliate link when I buy a server because it's how I'd like to show my appreciation for what you've done. Great stuff and thanks for not only explaining what to do, but also why we need to do it. Cheers

  11. Hello, how can i deploy multiple laravel site using this configuration ?
    Do you have any reference to do that, please. Thank you

  12. Put some metal as intro music. You know, after all the work you've put in creating this series, you could've just created a vagrant box and then package it and move the whole setup onto the VPS. Oh well …

  13. I have a domain set up for this project I am developing. Does it matter if I ssh into the server or the domain because have some issues with connecting into the domain.

  14. I'm getting this error, "This package requires php ^7.1.3 but your PHP version (7.0.32) does not satisfy that requirement." How do I update the php

  15. hey, i have deployed a laravel program to http://www.cheapairportcarslondon.co.uk/ its all connected upto autoloader and i dont get any errors but the plugin is not loading, its keep on saying loading? is it anything to do with ssh or terminal to make this work? because my other site is loading which is https://www.lavishairporttransfers.co.uk/ the app is taxi booking engine. Laravel app sitting on www.cheapairportcarslondon.co.uk/eto/ please advise. thank you

Leave a Reply

Your email address will not be published. Required fields are marked *