DEV Community

loading...

Hosting a Full Stack Web App

stuartcreed profile image StuartCreed Updated on ・2 min read

AWS EC2 costs about £7 a month (without storage is it £3 with mount storage). It is a IAAS (Infrastructure As A Service). You can do anything you want with it but you have to set it up yourself (which is simpler than you would think with Apache and NGINX). You can get this for 12 months free, then you have to pay £7 a month (roughly) afterwards.

AWS Elastic Beanstalk cost the same as AWS EC2 (and possibly more if it adds additional services you do not normally use). It is a PAAS service (Platform As A Service) - so you upload your code and AWS works out what you need to deploy the App.

AWS Lightsail is the cheapest - costs £3.50 a month. It uses a "Light" version of EC2 and charges you more money for extras that you are less likely to use. It uses an Apache Server and already has a MERN environment set up for you ready to use. Simply put you index.html in the apache folder area and you will be able to view it via the public URL. You are limited and you cannot deviate out of your environment, but it easily caters for a MERN stack website. You can register with a domain and manage it easily on their. Think of AWS EC2 as a Morgage (you can do what you want), and AWS Lightsail as a Rental property - you are limited but you have what you need.

AWS Amplify costs the same as EC2, as like Elastic Beanstalk it works out what you need (PAAS) to run the app. I personally prefer Amplify as you can set up it up to build and deploy you REACT application in one command. Where as Elastic Beanstalk you have to build it yourself, zip the build file and manually upload it. There is a Elastic Beanstalk CLI but I have not tried it out yet.

Heroku is a PAAS like Elastic Beanstalk but uses Docker Containers to make it service cheaper. But there is a technological cost to set it up. The service costs £7 a month (for every website you deploy) but it is very easy to use and you can link it up to your github (like you can with Netlify), so that it automatically deploys inside the container every time you make a git commit. The free tier puts you App to sleep after an hour so is not much use. It also sorts out a SSL for you, which is an added bonus.

You cannot use AWS Lamdba to host webapps. Lambda allows you to run functions and is "serverless" and cheap, but it cannot host. Lambda functions can be invoked from other Web Applications though - which can be useful but I don't imagine it is used much for websites.

Discussion (0)

pic
Editor guide