My goal is to setup a GNU/Linux VM with Ubuntu 20.04 LTS, PHP8, Nginx and MySql to serve a Laravel 8 Application. For the Web Server I’m going to use Nginx so I will need php-fpm.

But before to automate a process, or a setup, or a workflow, I think we need to figure out what’s going on under the hood.

If you selected SSH key Auth method instead of login/password, when you created your droplet, I suggest you to create an SSH alias in your machine in order to have a shortcut for defining the “ssh” user name, the IP address and the key to use to access to your VM.

Now let’s focus on the Nginx configuration, we can start from the default configuration for Nginx and then we will customize it: Edit your new file following this example: Then, you need to create a symbolic link in order to activate the new configuration (take a look sites-available VS. sites-enabled): If you want to check the syntax of your configuration: To restart Nginx and load your new configuration: We are going to install MySql server 8: during the execution of this script, it will ask you to type the root database password.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners