DEV Community

Cover image for Manually installing Laravel on DigitalOcean
anmollohana
anmollohana

Posted on

Manually installing Laravel on DigitalOcean

The excellent PHP framework Laravel makes it simple to construct PHP applications.

Laravel had approximately 105 million installs, according to Packages, at the time this book was being written. Laravel may be set up in various ways on DigitalOcean or other cloud hosting services.

This tutorial will show you how to quickly and easily install Laravel on DigitalOcean!

If you don't have any technical knowledge, you shouldn't worry. You can finish the one-click installation with managed Laravel Hosting on an AWS server.

Installing Laravel on DigitalOcean

DigitalOcean has a Marketplace where you can find a variety of 1-Click Applications to install on your servers and Kubernetes clusters.

DigitalOcean recently received a listing for a Laravel image. On the DigitalOcean Marketplace, the image is currently available:

Image description

The image includes a preconfigured LEMP stack as well as a certbot. The image comes with the following software stack:
● 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

Go to the 1-Click Laravel application page and click the Create Laravel Droplet button to use the image:

Image description

Then follow the routine and select the details that best suit your needs, such as:
● The Droplet's diameter.
● Select a data center location.
● Select your SSH credentials.
● Select a hostname.
● Backups should also be enabled, in my opinion.

After that, press the Create Droplet button. Then your Laravel server will be up and running in around 30 seconds! Backups should also be enabled, in my opinion.

Copy your IP address and SSH to the Droplet to finish the setup.

You'd be taken to an interactive menu that asked for the following information:

Enter the domain name for your new Laravel site.
(ex. example.org or test.example.org) do not include www or http/s

Domain/Subdomain name:

Type your domain name or subdomain name there; for example, laravel.bobbyiliev.com.

Following that, you will see the following output:

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 your domain name or subdomain DNS is configured. Your A record points to the Droplet's IP address before pressing y; otherwise, Let's Encrypt will be unable to validate your domain and will not issue you a certificate.

Type n and hit enter if you do not want a certificate.

That is all there is to it! In your browser, go to yourdomain.com, and you will see a brand new installation!

Conclusion

Thanks to the Laravel 1-Click installation from the DigitalOcean Marketplace, we can deploy a fully functional LEMP server with Laravel in less time!

One of the most satisfying chores is putting your finished product or idea into production. Forge is a Laravel community tool that can be used with any PHP project. We use it at SnapShooter, and I always use it when giving advice.

Before examining AWS services for container-based scaling services, consider how much higher you can scale with DigitalOcean (Kubernetes at DigitalOcean is bridging this gap, but that is a topic for another day).

As you can see, setting up Laravel to forge is simple. Back then, I manually installed PHP and MySQL and spent hours getting things to work. With Laravel forge, the procedure is now fully automated, requiring only minor adjustments to make it work as intended.

Top comments (0)