Laravel Forge

Once a server is finished provisioning, you will receive an e-mail with your database password. However, you will not be able to connect to your database via Navicat or Sequel Pro using the server's public IP. For added security, you may only connect to the database via a SSH tunnel. Both Navicat and Sequel Pro support connecting to database via SSH.

First, add an SSH key to your server. Next, configure your database client to connect to the server using the SSH key. Example settings can be seen below.

2653

2654

Once a server is finished provisioning, you will receive an e-mail with your database password. However, you will not be able to connect to your database via Navicat or Sequel Pro using the server's public IP. For added security, you may only connect to the database via a SSH tunnel. Both Navicat and Sequel Pro support connecting to database via SSH.

First, add an SSH key to your server. Next, configure your database client to connect to the server using the SSH key. Example settings can be seen below.

2655

By default, Forge created servers do not allow SSH access via passwords. You must add an SSH key to the server via the server control panel or your account profile. It is strongly recommended that your local SSH keys also be protected with a strong password. To generate a new key, issue the following command on your terminal:

ssh-keygen -t rsa -C "your_email@example.com"

To generate a key on Windows, you should install Git and generate the SSH key from the "Git Bash" terminal.

Once the key has been generated, add the public key to Forge via the SSH Keys tab of the server management page. The public key filename will contain the ".pub" suffix.

After adding the key, you can use the following command to connect to your servers:

ssh forge@your-ip-address -i ~/.ssh/your-key

For more convenient access, add your Forge server to your SSH config file, which, on Mac / Linux hosts, is located at ~/.ssh/config:

Host forge
Hostname 173.111.137.176
User forge
IdentityFile=/Users/sally/.ssh/id_rsa

Once the server has been added to your SSH config, you may connect to the server simply by executing the "ssh forge" command from your terminal.

You can archive a server by clicking the archive button at the lower right portion of the server management page. When a server is archived, Forge removes its own SSH keys from the servers, thereby revoking all Forge access to the server. To reconnect an archived server to Forge, navigate to the "Archived Servers" portion of your account profile, where you can copy a reconnect command to run on your server.

Push to deploy is not available on archived servers.

The "Networking" tab of the server management pane allows you to configure other servers that should be accessible by the current server. For example, if you want to allow the server being managed to connect to another one of your servers, simply check the checkbox for the server you want to access. After you have selected your servers, click "Update Network". The proper firewall rules will be added to the selected servers automatically.

The "Networking" tab also allows you to add or remove custom firewall rules for your server. For most applications, you will not need to change these settings away from their defaults. If you are using a server solely as a database server, you may wish to stop Nginx from the "Stop" dropdown at the bottom right of the server management window. Once you have stopped Nginx, you can delete the firewall rules for ports 80 and 443.

The "Scheduler" tab of the server management page allows you to configure scheduled PHP commands are Artisan tasks. Simply select how often the command should be executed, and Forge will configure a "Cron job" to run the command at the necessary interval. When configuring a command, be sure to use the full path to Artisan, such as:

php /home/forge/domain.com/artisan task:name

You may also view the log for your scheduled jobs from the "Scheduler pane".

When you choose the "Provision As Load Balancer" option when creating a server, that server may be used to distribute traffic to other servers on the same provider and region.

Once the balancing server is created, you may add sites to it as you would a typical application server. When managing a load balancer's site from the Forge UI, you are able to select which servers the load balancer should distribute traffic to.

Load balancing servers use Nginx as their underlying load balancer.

The Forge IP addresses you should whitelist are:

45.55.52.11

104.236.229.125

104.236.3.83

Every Forge server includes all of the goodies you need to build robust Laravel applications, including:

  • Ubuntu 14.04
  • Nginx > 1.9
  • PHP 7.0
  • MySQL & Postgres
  • Redis
  • Memcached
  • Beanstalk
  • Node

To configure an SSL certificate for your site, visit the "Certificates" pane of your site. From here, you will create a CSR (Certificate Signing Request). Once you have the request has been created, you may view the CSR by clicking the "View" button. Once you have the CSR, you may purchase a certificate from a certificate vendor like Namecheap or Hover.

After getting the final certificate from your vendor, you may copy and paste the certificate into the "Install Certificate" modal window. Once the certificate has been installed, click the "Activate" button to activate SSL for the site.

When creating your site, only enter the "root" domain into the "domain" text box. In other words, this box should only contain something like "foo.com", even if you are planning to support wildcards sub-domains.

To enable wildcard domains, active the "Allow Wildcard Sub-Domains" checkbox when creating the site. This will configure Nginx to respond to both the root domain and any wildcard sub-domains.

To automatically pull in fresh code from your repository, click the "Enable Quick Deploy" button on the "Repository" pane. This will configure a Github / Bitbucket service hook on your repository that informs Forge when new code has been pushed to the repository. When new code is pushed, Forge will initate the deployment process for your site.

You may configure the deployment script that is run by "Quick Deploy" by clicking the "Edit Deployment Script" button on the "Repository" pane. Once you are done editing the script, you may save your changes. Forge will automatically use your custom, modified script to deploy the site.

Of course, if you do not wish to use "Quick Deploy", you may use another deployment tool like Laravel Envoy to deploy your code.

From the "Sites" tabe of the server management pane, you may click the "Edit" (pencil) icon to manage a site. The "Repository" tab will be the default tab of the site management pane. From this tab you may enter the Github or Bitbucket repository you wish to install to the site. This should follow the format "username/repository". So, if your Github / Bitbucket username is "sally" and your repository is "website", you would enter "sally/website" into the textbox. You may also enter a branch you wish to deploy to the site. By default, this is set to "master".

After a site has been installed, you may enable "Quick Deploy" to continue to deploy the site each time new code is pushed to the repository.

Sites may be uninstalled using the "Uninstall Repository" button at the bottom of the "Repository" tab. This will remove the installed repository and revert the site back to the default PHP "info" page that was installed when the site was initially created.