Laravel 8.0 on Digital Ocean
Tags: laravel, laravelhosting, webhosting, webdev
Published: 2022-06-07 12:01:38

## Table of Content
- What is Laravel?
- What are the benefits of Laravel 8.0? 
- How to Install Laravel 8.0 on Digital Ocean?
- Problems you might face while installing Laravel 8.0
- Conclusion

## What is Laravel?
Taylor Otwell introduced [Laravel](https://laravel.com/), a free, open-source PHP web framework for developing web applications that follow the model–view–controller (MVC) architectural pattern.
Laravel has a modular packaging system with dedicated dependency management, many ways to access relational databases, utilities to help with application deployment and maintenance, and a syntactic sugar perspective.

## What are the benefits of Laravel 8.0? 
The main benefit is that it is well documented compared to other frameworks. If you are new to the framework, you can get started by following the documentation. If you are a seasoned developer, you can easily upgrade from Laravel 7.0 to Laravel 8.0. 
In addition to that, the framework is easily customizable, and you can use the custom configuration feature to change the default settings. 
Also, you can use the Laravel Mix to compile SASS files, and it comes with built-in authentication and authorization, database migrations, localization, caching, and many other functionalities.

## How to Install Laravel 8.0 on Digital Ocean?
You may find a range of 1-Click Applications to install on your servers and Kubernetes clusters on DigitalOcean's Marketplace.
A Laravel image was recently listed on DigitalOcean. 
The following image is presently available on the DigitalOcean Marketplace:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mo9yv77uwu0o7njmb1bd.jpg)
A preconfigured LEMP stack and a certbot are included in the image. The following software stack is included with the image:

- Laravel 7.20.0
- Nginx 1.18.0
- MySQL server 8.0.20
- PHP 7.4.3
- Certbot 0.40.0
- Composer 1.10.1

To use the image, go to the 1-Select Laravel application page and click the Create Laravel Droplet button:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xr1drx0j3dsvf3o9eloi.png)
Then follow the steps and choose the details that are most important to you, such as:

- The diameter of the Droplet.
- Choose a location for your data center.
- Select your SSH credentials from the drop-down menu.
- Choose a hostname.
- Backups, in my opinion, should also be enabled.

Press the Create Droplet button after that. Then, in about 30 seconds, your [Laravel Hosting server](https://devrims.com/laravel-hosting/) will be up and running! Backups, in my opinion, should also be enabled.
Copy your IP address and SSH into the Droplet to complete the setup.
You'd be brought to an interactive menu where you'd be prompted to provide the following details:

```
Enter the name of your new Laravel site's domain.
(ex. example.org or test.example.org) do not include www or https/Domain/Subdomain name:
```

Type your domain name or subdomain name, such as laravel.bobbyiliev.com, into the box.

The following output will appear after that:

```
Configuring Laravel database details
Generating new Laravel App Key
Application key set successfully.
Next, you can configure LetsEncrypt to secure your new site.  
Before doing this, point your domain or subdomain to this server's IP address.  
You can also run LetsEncrypt certbot later with' certbot --nginx.' Then you will be asked if you want to use an SSL certificate to safeguard your Laravel installation:

Would you like to use LetsEncrypt (certbot) 
to configure SSL(https) for your new site? (y/n):
```

Make sure the DNS for your domain name or subdomain is set up. Before pressing y, make sure your A record points to the Droplet's IP address; otherwise, Let's Encrypt won't be able to validate your domain and won't be able to issue you a certificate.

If you don't want a certificate, type n and press enter.

It's as simple as that! Go to yourdomain.com in your browser to see a brand new installation!


## Problems you might face while installing Laravel 8.0
Laravel is a compelling PHP framework. It is used to build complex applications. So, it is important to install it in a secure environment. 
The best place is to install it on your computer. It is a very tricky process. You have to download the [Laravel Framework](https://github.com/laravel/framework), [composer](https://getcomposer.org/) and create localhost on your computer. But, it is a time-taking process. 
If you are a beginner and have no idea about the Laravel framework, it is better to go for the Digital Ocean. It is one of the best ways to install Laravel 8.0. If you are not a beginner, you can also use Digital Ocean. 

## Conclusion

We can have a fully functional LEMP server with Laravel deployed in less time, thanks to the Laravel 1-Click installation from the DigitalOcean Marketplace!