Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Deploy to Staging Server: AWS and Laravel Forge

Premium
5 min read

The final step in this section is to actually show something to the client, so we need to deploy our project somewhere online.

At this point, we don't need a domain name, the goal is to allow the client to see the progress and click around.


Where/How We Will Deploy

We will deploy our project on a new AWS EC2 server instance, created via Laravel Forge.

Why AWS? For this specific course, I chose AWS over Digital Ocean or other providers, because it's the most useful in practice: AWS is a required skill in many Laravel job descriptions, so it would be beneficial for you to learn how to use it.

Why Laravel Forge? This one is debatable, but Forge is one of the fastest way to get from zero to a working server, without ever touching Terminal. If you want to save some money and have more time, you can build a server manually and configure it for Laravel projects, we have a separate course Deploy Laravel Project to AWS EC2: Step-By-Step

Notice: at the time of writing this, Laravel Cloud isn't officially released yet. Maybe will need to rewrite this in 2025.


Deployment: Create Server

To start, you need to create an account on AWS and on Laravel Forge, both will require credit cards. Unfortunately, there's no free option here.

On Laravel Forge, you need to add your AWS credentials, and then press Create Server. Select AWS in the list:

In here, we need to configure our server information: the most important things are:

  • Name: so you would recognize it later in the list
  • Server Size: t3.small is fine, at the moment price is $0.0208/hour, which is around $15/month. You may try a smaller size but with risk that it may not have enough resources.

Press Create Server. Then a Pop-Up will open up with Server Credentials. Save them somewhere safe!

After that, your server should be preparing:

Wait until this process is completed. You'll know as soon as you will see this page:


Creating a (Web)Site from GitHub on New Server

From here, for our testing purposes - we will click on...

The Full Lesson is Only for Premium Members

Want to access all of our courses? (31 h 16 min)

You also get:

55 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Comments & Discussion

CB
Caspar Bisschop ✓ Link copied!

"Wow, I really like this approach!

That said, as a solo worker, it does add quite a bit of extra effort for me.

However, when sharing it with another developer or the client, it would come across as highly professional."

P
pleveris ✓ Link copied!

Wow, how detailed! Appreciate, and already waiting for the next part! To be honest, the most interesting part for me it was lesson 9. I should really deepen my knowledge in this field :-)

S
Sisifo ✓ Link copied!

Hi!

Really thanks for the course, really needed and original at the same time.

I would like to propose two question for following Parts:

1.- Imagine we are talking of a pay web service... how to scale in users? Imagine we have a basic functional version, after probing it with our friends and family, how we start inviting people to use it? maybe first with invitation codes, later every user has some invitation codes to resend other users... and finally completely open the app. It can be interesting to understand how to manage this part, how to control the number of users, the size of the server, the step between "free access to beta testers" to a "paywall"... well... sumarizing: how to scale in profesional way from zero to alpha...

2.- Everythings works perfect. No update or refactor needed... then how often to perform a "composer update"? (maybe it is quite silly question... however I always ask myself...)

M
Modestas ✓ Link copied!

Hi,

  1. This is really a unique workflow that has multiple ways of dealing it. But in short, it's as simple as having a table with invitations and accepting that on the registration form. Of course, with multiple checks to see how many users are already in the system. But in any case, this is really niche and not a very wide-spread requirement, so we won't cover that, sorry. As for "free beta" to paid users - you can simply assign a "free plan" with access to everything to beta users. Then, once live - cancel it.
  2. Running composer update should be done as needed. But that "as needed" is dependant on your time. If you want, you can run it each day (given that you have a good test suite) - that should not cause any issues. Major updates on the other hand can be tricky and should be planned in advance :) But again, no set times on how often. We tend to run minor updates every few months (or sooner if there was a security path) and major updates - when new Laravel versions come out.

ps. For servers - that's a really hard topic to answer. Some applications can run with 5000 daily users on 5$ DO VPS, but others can't handle 50 users on the same VPS. So for the server we recommend you to track it's monitoring and see if there are spikes of load that are near 100%. If that's the case - upgrade the server :)

S
Sisifo ✓ Link copied!

Ok, Thanks for the reply, I understood.

R
Retzko ✓ Link copied!

Hi Polivas & Team - As a self-taught, solo, full-stack developer/founder, this course is exactly why I am a Premium member. My site started as bespoke PHP 5 codebase and is now Laravel 11 TALL stack with Livewire 3, deployed through Vapor running on AWS Lambda with GitHub backups using PhpStorm as my IDE, and supports over a thousand users. I’m confident that I’m doing the right things and am equally confident that I’m still NOT doing things right. My ignorance far surpasses my knowledge but trial-and-error has permitted me to build a tool that provides value and depth. I have followed you for many years because of your generous support of the Laravel community and these outstanding courses which simultaneously improve my knowledge-base and provide a constant challenge to level-up my professional skills. Thank you for your consistently great work and I'm looking forward to the release of the next two modules!

M
Modestas ✓ Link copied!

Hi! Thank you for the kind words!

It is often that we have to do "trial and error" approach to many things, but that's the way to learn! And that's why we love spreading our trials (and sometimes errors :) ).

ps. Impressive update from php 5 to the latest stuff!

PK
Povilas Korop ✓ Link copied!

Aww, thank you for the nice words, glad to be a part of your journey!