Question

Deploying a decoupled application

I have an application which has a laravel backend and VUE js front end. I have just very new to digital ocean. would be great if you guys can help me out with hosting this application.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi there,

There are a couple of ways to do that:

  • Deploy both the Vue and the Laravel components on the same Droplet and use Nginx to proxy the traffic accordingly

What I could suggest is following the steps here on how to deploy Laravel on DigitalOcean:

https://www.digitalocean.com/community/tutorials/how-to-deploy-a-laravel-application-with-nginx-on-ubuntu-16-04

Then create a separate Nginx server block and add your Vue project there.

  • Deploy Laravel on one Droplet and the Vue frontend on a separate one

This option is quite similar, but you need to deploy a second Droplet with Nginx installed and upload your 2 components on the two separate Droplets.

In both cases, it is better if you have a domain name so that you could run your Laravel on a separate subdomain name like api.yoursite.com.

  • Use the new DigitalOcean App platform

Another option is to use the new DigitalOcean App platform so that you will not have to do any server configuration. Here is a quick demo on how to do that:

https://www.youtube.com/watch?v=1T3d7P_V2t4

The video should help you as it shows how to deploy Laravel with a separate frontend service. In the case of the video, it is a React app but the process should be the same for Vue.

Hope that this helps! Regards, Bobby