Forge Subscription Plans 0:00To provision servers with Laravel Forge, we need two things. The first is an active Forge account, which I've gone ahead and created here already. And the second is an active subscription. We can manage our subscription by clicking on our name and going down to Billing. You can see that I'm already subscribed to the business plan, but we can change our plan at any time by clicking the Change Subscription Plan button. And now we can see the different options available to us. Forge offers three different pricing points, Hobby, Growth, and Business, and we can toggle whether we want to pay monthly or yearly. Let's run through these quickly.and we can toggle whether we want to pay monthly or yearly. Let's run through these quickly. The Hobby plan allows us to provision a single server, and we can run an unlimited number of sites on it. We can also deploy each of those sites an unlimited amount of times. The Growth plan allows us to provision an unlimited number of servers, and each of those servers, again, can have an unlimited number of sites, and those sites can be deployed an unlimited number of times. And then finally, the Business plan. Again, we can provision an unlimited number of servers,And then finally, the Business plan. Again, we can provision an unlimited number of servers, and again, those servers can have an unlimited number of sites and deployments, but we also have a few additional features. The first is database backups, which allows us to create automated backups of our database. And then we can choose to install a server monitoring agent onto our server. This will allow us to be notified when our server's resources hit a defined threshold. And then we can also share our servers with our teammates using a feature called Circles. And finally, the Business plan also offers a priority support level. For now, I'll keep my original plan. Connecting Server Provider 1:35And finally, the Business plan also offers a priority support level. For now, I'll keep my original plan. Okay, now that we have an active subscription, we can go ahead and click on the Create Server button. You'll notice that when Forge opens up this modal, that the first five options, DigitalOcean, Linode, AWS, Vulture, and Hetzner Cloud are disabled. The reason for this is that we haven't yet configured our server providers. There's two ways we can do that. We can click on the Manage Providers button here, or we can select the provider of our choice. In this case, we're going to provision a server with Hetzner Cloud. And you'll notice when Forge redirects us to the new provider form,In this case, we're going to provision a server with Hetzner Cloud. And you'll notice when Forge redirects us to the new provider form, it's already selected the Hetzner Cloud option. And when you're creating a new provider, Forge is asking for two bits of information, the profile name and the API key. The profile name is just a way for you as the user of Forge to identify the token, because you can have more than one of the same provider. In this case, we're just going to call it Personal. And I already have the API key in my clipboard, so I'll paste that in. Now when we click Add, Forge is going to validate those detailsAnd I already have the API key in my clipboard, so I'll paste that in. Now when we click Add, Forge is going to validate those details and provide us with some information if that fails. But in this case, it's successful. So we have the ID of our provider, which we can use for API requests, the profile name, the provider type, and whether it's currently in use, which it isn't because we haven't provisioned any servers yet. Now that we've configured our server provider, let's head back to the Forge dashboard and click on Create Server once more. This time, we'll see that Hetzner Cloud is enabled. Configuring Server Settings 3:09let's head back to the Forge dashboard and click on Create Server once more. This time, we'll see that Hetzner Cloud is enabled. When we click this, Forge is going to show us a form that we can fill in to select the server type, provide all the details of that server, and finally, we can create it. We'll run through these quickly and revisit them in a future episode. With Forge, we can provision different types of server, app, web, worker, database, cache, melee search, load balancers. In this case, we're going to stick with app server that includes PHP, Nginx, Database, Redis, and memcached.In this case, we're going to stick with app server that includes PHP, Nginx, Database, Redis, and memcached. Pretty much everything you need for a self-contained application. Next, Forge will want us to provide a name, although it will randomly generate a name for us. DeepSound is the perfect name for this server. Every server provider will have its own set of regions that we can select from. In this case, Falkenstein is perfect. The same is true for the server size. Each server provider will have its own offerings of resources.The same is true for the server size. Each server provider will have its own offerings of resources. In this case, we're going to stick with the CX11, which contains 2GB of RAM, 1 CPU, and 20GB SSD. We can choose which version of PHP to install. Anywhere from 5.6 to the latest version, 8.1. 8.1 is perfect. And finally, because we're provisioning an app server, we can choose a database to install on our server. It's important to know that some server providers,we can choose a database to install on our server. It's important to know that some server providers, such as AWS and DigitalOcean, have the ability to create a managed database. When you're using Forge, that is not what's going to be created. Instead, Forge will actually install the service that we select here on our server. In this case, we're going to select MySQL 8. Because we're installing a database, Forge has already created a database called Forge, but we're free to change that.Forge has already created a database called Forge, but we're free to change that. We could call it Demo, or App, or Forge. Okay, so provisioning a server typically takes 10 to 15 minutes, depending on the provider, the region, the type of server, and the amount of resources it has, and also the network that it's on. I'm going to go ahead and click on the Create Server button, and through the magic of movie editing, we're going to jump straight into our server. And just like that, our server has been created. Default Site Overview 5:20we're going to jump straight into our server. And just like that, our server has been created. Now, Forge has taken us directly into the server panel here, where we can create a new site. But if we scroll down a little bit further, we can see active sites, which will show us a list of all of the sites installed on our server. You'll notice here that there is a default domain. Forge will install a default site for any app or web server. And the default site is what's used when your server is accessed over its IP address. Forge will install a temporary application that shows you how to install your project,And the default site is what's used when your server is accessed over its IP address. Forge will install a temporary application that shows you how to install your project, set up your domain, and configure your DNS records. For now, we'll click into the default domain, where Forge will show us the Git repository, WordPress, and phpMyAdmin options. WordPress and phpMyAdmin just allow us to install these applications really quickly. But for now, we're going to focus on Git repository. You'll see here that we haven't yet configured our source control provider, and so Forge is only allowing us to install with a custom provider. We can fix this by going to our account settings Deploying From GitHub 6:19and so Forge is only allowing us to install with a custom provider. We can fix this by going to our account settings and connecting to GitHub, GitLab, GitLab Self Hosted, or Bitbucket. I'm going to use GitHub. Okay, once that's done, we'll go back to our site, default on DeepSound, and go back to the Git repository setting. GitHub is now selected. And in this example, I'm just going to install Laravel Laravel. So the repository name is just the name that it matches on your source control provider, unless you're using the custom provider, you don't need to provide the whole URL.So the repository name is just the name that it matches on your source control provider, unless you're using the custom provider, you don't need to provide the whole URL. Because we've supplied a repository, and we're using the first-party integration, Forge is going to pull all of the available branches. Since our server has installed php 8.1, we'll install Laravel 9.x. And we want to make sure that Install Composer Dependencies is checked. Before we click the Install Repository button here, I want to mention a somewhat overlooked feature of Forge. When installing a repository from a Laravel application, Forge will helpfully copy over any .env.example files that exist in the project's root,When installing a repository from a Laravel application, Forge will helpfully copy over any .env.example files that exist in the project's root, and it will copy that content into the .env file, and automatically update some of those environment variables, such as dbhost, dbuser, etc., and so that we can get on and deploy our application really quickly. So let's go ahead and install the repository. Typically, this will take a minute or two, but of course it depends on the size of the server, the repository, and the number of dependencies that your application is also installing.but of course it depends on the size of the server, the repository, and the number of dependencies that your application is also installing. And with that, our first site has been deployed. Let's go back to our site's IP address and give that a refresh. And you can see here that Forge has now replaced that temporary site with our Laravel application. Nice, but how did this actually deploy? Well, Forge has created what it calls a deploy script, and it tells your server exactly which commands to run when deploying. Deploy scripts are an important part of Forge and can look pretty overwhelming. But don't worry, we'll take a deep dive into exactly how all this works later. Deploy Script and Env 8:16Deploy scripts are an important part of Forge and can look pretty overwhelming. But don't worry, we'll take a deep dive into exactly how all this works later. For now, we can see it's performing a few key actions. We're pulling our changes, we're installing dependencies, we're reloading PHP, and then we are running our migrations. Since we don't need any migrations at this point, we can comment this out and click Update. Finally, let's take a quick look at the Environment tab here. Forge shows us the contents of the .env file directly from our application, which we can modify and save right here without needing to SSH in or connect via SFTP and make manual adjustments.which we can modify and save right here without needing to SSH in or connect via SFTP and make manual adjustments. We can change the application name, Lara Casts, and go down to here and click Save. Once saved, we can go back to our Application tab and click Deploy Now. Nice, everything deployed successfully. Wow, that was a whirlwind of a tour of just some of Forge's features. Let's take a second to recap what we've done here. We started by connecting to our server provider, Hetzner. We provisioned an app server which installs Nginx, PHP. We chose to install MySQL and Redis.We provisioned an app server which installs Nginx, PHP. We chose to install MySQL and Redis. Then we changed our default site to deploy our own Laravel code. Don't worry if this felt overwhelming. We're going to go over all of this in much more detail over the next several episodes. I'll see you in the next one.