در حال بارگذاری ...

Signing Up for Forge0:01

Okay, in this episode, we're gonna sign up for Forge and spin up our first server using Laravel VPS. So let's go to Forges website and click deploy server and type in our basic information. Okay? And by default, it creates an organization for us with our same name. So I'll just let my organization be Matt St. Staffer for now, and we're gonna set up a server provider. We could choose other server providers like Digital Ocean, but we're gonna set those up in later videos right now.

We could choose other server providers like Digital Ocean, but we're gonna set those up in later videos right now. Let's use the easiest onboarding server provider, which is Laravel VPS. And if you're not familiar, Laravel VPS is a server provider, just like Digital Ocean or OD, or AWS. As a server provider. It means that Laravel Forge, unlike in previous versions where all it did was manage your servers at other providers, they now also have the ability for you

where all it did was manage your servers at other providers, they now also have the ability for you to use their own server. So Laravel VPS requires you to sign up to no other services. You don't have to bring a digital Ocean account and a Laravel Forge account. You can just do everything straight through Laravel. And just like most of these tools, it's not gonna keep you from doing what you're used to or if you're familiar with,

it's not gonna keep you from doing what you're used to or if you're familiar with, but it is if you don't want to have to deal with it. Or in my case, if you want your clients to not have to deal with spinning up multiple accounts, you just spin up a Laravel Forge account and there you go. You're able to create servers right now, by default, forge assumes that we're going to deploy our code from some form of Git source control provider.

Connecting Git and Plan1:18

to deploy our code from some form of Git source control provider. I use GitHub. I think you should as well, but if not, you've got O other options here. So I'm going to authenticate it against my GitHub account. Okay. And now we're going to choose our subscription plan. There's a lot of different options, but because I wanna show all of the features we could potentially use in Forge, I'm gonna choose business,

of the features we could potentially use in Forge, I'm gonna choose business, which gives a few additional options, including sharing servers with teammates, database backups, and server monitoring. I would say if you're just getting started and you're willing to drive just one server, check out the $12 per month hobby plan. The majority of folks are gonna use the growth plan, and folks who need the best

Creating First Server1:50

The majority of folks are gonna use the growth plan, and folks who need the best of the best options are gonna choose the business plan off screen. I'm gonna fill out all of my personal contact information and payment information and then we'll be right back. Okay? And now it is time to create our first server, and this is the wizard walking us through the server creation process. But you could do this as a normal part

through the server creation process. But you could do this as a normal part of using Forge once you're actually spun up in the first place. So we're gonna create our first server, and you can use these auto-generated names if you want. I'm actually gonna name it after a specific project, let's call it Oregon Trail Staging. We are gonna choose that layer of LVPS provider. Later we'll do a video about Digital

Choosing Server Options2:23

We are gonna choose that layer of LVPS provider. Later we'll do a video about Digital Ocean and other providers. So you have a few things that you're picking here. You're picking the type of server, it's region, it's private network, it's size, and then some advanced settings. So let's go through each of those one at a time. So for the type, there's a wonderful document in the Laravel Docs that shows you a breakdown of what each

So for the type, there's a wonderful document in the Laravel Docs that shows you a breakdown of what each of these server types offers for you. By default, the vast majority of Laravel apps are just going to be app server because it gives you basically everything. You also might consider a load balance or server. And at some point you might get to the point where you need a standalone database cache worker or milli search server. But again, most servers are just gonna be the app server.

worker or milli search server. But again, most servers are just gonna be the app server. You can pick your region. These regions are gonna be different depending on your server provider, but these are the regions that are available in Laravel VPS with your private network. We'll go into this later in other videos, but for now, just stick with the default. And then you can choose the size of server. Right now we're just gonna go for a small server.

And then you can choose the size of server. Right now we're just gonna go for a small server. We can click on the advanced settings. Laravel VPS has a more limited subset of configurations that you can have for these. If you're dealing with other server providers like Digital Ocean, you'll get more options. Laravel VPS generally just provides the best than the latest. You got different versions of PHP,

best than the latest. You got different versions of PHP, different database providers, and you can choose whether or not to add your service SSH key to source control providers. What this does is it takes the SSH key that identifies that server and it'll add it, for example, to your GitHub account, which means now, uh, you don't have to manually configure every single site being able to talk to your GitHub account, but any site on

Downloading Server Credentials3:46

to manually configure every single site being able to talk to your GitHub account, but any site on that server will just be able to send data back and forth. And now let's create our server. So as soon as you finish creating your server, you want to download these credentials. This pseudo password is the master password to your server. And without it, you're not gonna be able to make some very important changes. And this database password you can get later,

to make some very important changes. And this database password you can get later, but it's still valuable to have. So click download as text and it allows you to download the credentials in a text file that you can save in some important safe location. Once you're done, you can say, I've stored these credentials, and now we are on the server dashboard. Many of the sections of server dashboard we will cover in

Touring Dashboard and Terminal4:21

and now we are on the server dashboard. Many of the sections of server dashboard we will cover in more depth and later videos, but you can at least see you've got a list of your sites, a list of your databases, your background processes, your scheduled jobs, and you can notice that there's two out of the box that are just keeping your server up to date your backups and any activity that you've taken. You've also got some other information over here, including

and any activity that you've taken. You've also got some other information over here, including what type of server it is, your database type region, all those things that we chose when we were spinning up the server and your public IP address for the server, which you'll need for pointing domains to it. And some VPC, which is private network stuff that we'll talk about in later videos. There are also a lot of individual tabs that allow you to go into de greater detail in configuring your sites.

There are also a lot of individual tabs that allow you to go into de greater detail in configuring your sites. Again, those will be covered in later videos. And finally, the settings. Now even many of these settings will cover in greater detail in later videos, but I do wanna point out the basic settings. We've got the name of the server, we've got the size of the server, it's time zone, some organizational details that we'll look into later.

of the server, it's time zone, some organizational details that we'll look into later. And then we have our server public key and our Forge public key. So the Forge public key is placed on our server to allow Forge to talk to our server. And our server public key is often given to our source control provider to make sure that they can talk to each other as well. And then finally, you can do dangerous actions like

that they can talk to each other as well. And then finally, you can do dangerous actions like resetting your pseudo password if you lost it, transferring this to another user, and then deleting the server if you need. Now, if we go back to the overview in the dashboard, there's also these three dots here. And these give us actions we can take on each of our servers. We can restart various services, we can stop some services,

take on each of our servers. We can restart various services, we can stop some services, we can reboot the server. We can also refresh the status, which is especially important if you're dealing with a non layer of LVPS server because in those worlds, forge is really just making SSH and API calls to your external service provider. So if anything gets out of sync, you click this button, it just says, Hey, digital Ocean or OD

So if anything gets out of sync, you click this button, it just says, Hey, digital Ocean or OD or AWS, am I still correctly up to date on the status of this server? And then finally, I wanna point out that Laravel VPS specifically has this launch terminal button, and it's here because if you use a different server provider, they'll usually have the ability for in their dashboard for you to SSH directly into a, uh,

they'll usually have the ability for in their dashboard for you to SSH directly into a, uh, in-app terminal in case you have any issues SSHing into your server. But because Laravel VPS is provided by Laravel, it doesn't have a separate dashboard somewhere. This is the dashboard. So they want to add that feature for us. So just as if we were using a digital Ocean

So they want to add that feature for us. So just as if we were using a digital Ocean server, we can also do that here. So if you click on Launch Terminal, we are now directly in that server and we can actually take action as a server just like we were SS HD in in our own terminal software.

دوست دارید گاهی خبرهای Laracasts را ایمیل کنیم؟