How Laravel Forge Can Help You Run WordPress in the Cloud

petersuhmThis opinion piece was contributed by guest author Peter Suhm. Peter is a web developer from the Land of the Danes. He is the creator of WP Pusher and a huge travel addict, bringing his work along with him as he goes.
 


Laravel Forge is a server and application provisioning tool that was originally built to serve the Laravel PHP crowd. Recently, it has been made available to WordPress developers too, with the introduction of 1-click installs of WordPress on Digital Ocean, Linode and AWS cloud servers. In this post, I’ll give you a brief introduction to Laravel Forge and show you how you can use it to manage all of your WordPress installations in the cloud.

Laravel Forge is good news for WordPress developers

Because so many WordPress developers are used to managed hosting, the thought of running their own servers seem quite intimidating. That’s a shame with so many great cloud server companies offering virtual servers for very low costs. Unless your traffic is very heavy, a small ($5 to $10 per month) server can run quite a few WordPress websites. Laravel Forge takes care of provisioning your servers and can even setup your database and install WordPress for you. This makes cloud hosting much more available to WordPress developers at a low cost (Laravel Forge is $15 per month for unlimited servers), compared to many of the existing options.

Here are a few reasons why I think Laravel Forge is great for WordPress hosting:

  • Your servers are configured in a secure way by default, with SSH authentication, firewalls, automatic security updates and free SSL certificates from Let’s Encrypt
  • Your servers are going to be really fast with PHP 7
  • You can run a lot of WordPress installs on 1 single server *
  • You can scale your servers if you need more horse power *

* Goes for the cloud in general

Creating a new server

Here is how the “Create Server” screen looks in Forge:

If you use Digital Ocean, Forge can also create your servers. If you use another provider like Linode or AWS, Forge can only do the provisioning part.

For Digital Ocean servers, here are the options you can configure:

  • Which credentials to use, if you are managing multiple Digital Ocean accounts
  • The server name
  • The server size
  • The server region
  • The PHP version
  • The default database name

You can then choose to:

  • Configure the server as a load balancer (if you have really heavy traffic and is running WordPress across multiple servers)
  • Install MariaDB instead of MySQL, which is a drop-in, faster replacement
  • Enable weekly backups on Digital Ocean

When Laravel Forge is done with the provisioning, your server is ready to go.

Setting up a database

Once your server has been created, setting up a database for your WordPress installation is very easy. You can create the user at the same time you’re creating the database, or you can create the user afterwards.

Installing WordPress

Before you install WordPress, you need to create a new “site” on your server. You can just stick with the defaults:

For the “Root Domain”, you need to add the domain name of the site you are setting up. Remember that you need to add a DNS record for your domain that points to the IP address of your newly created server. If you are just testing, you can always add a record in your computer’s hosts file with a test domain that points to your server. Something like this:

# /etc/hosts

# Replace xx.xx.xx.xx with your server's IP address
xx.xx.xx.xx wordpress-forge.test

Once you click the “Add Site” button, you will see a spinning wheel while Forge is setting up your site’s nginx configuration.

When the installation is done, you need to click the “Manage” icon next to your site in order to install WordPress. The first screen you will be presented with gives you the option to install an “App” on your site. Click the “WordPress” button, select your database and user from the previous step and relax while Laravel Forge completes the installation. Fun fact: Laravel Forge is actually using WP-CLI to install WordPress on your server.

When the installation has completed, visit your site in a browser and you’ll be met with something familiar:

Setting up a free SSL certificate

Finally, you should set up SSL for your WordPress site. It’s more secure and Google likes it!

Head over on the “SSL” tab and click the “LetsEncrypt (Beta)” button. Click the “Obtain Certificate” button and wait while Forge creates and installs the certificate. Once the certificate is installed, click the “Activate” icon and voila! Your site is now all set up and secured with SSL.

That’s how easy it is to setup WordPress on a cloud server with Laravel Forge. I hope to see a lot of more products and tools like this that can help us building better, faster, and more secure WordPress websites. In fact, Laravel Forge was the original inspiration for my own product WP Pusher. I wanted to create a similar experience, but for WordPress plugins and themes instead.

Note on backups and security

Please note that even though Laravel Forge makes for a great starting point, ultimately you are the one in charge of the security of your servers. You should always try to educate yourself about security and have a backup strategy for your data.

10 Comments


  1. so … is that some kind of Managed Server-like thingy? Or do you still have to take care of all that nasty tidbits, like properly administrating firewall settings (eg. iptables) etc.?

    In the “Managed (Virtual) Server” case – great! I’m promoting that as well. It’s less expensive than a real server and everything is already taken care for. No more worries about obscure protection tools and ways, just get on with proper work and programming! :)

    In the other case: So you are an administrator as well, no? If its fun to you, think about lots of folks – like me – who hate having to figure out this stuff all the time. Esp. if its NOT your main job, but work on the sidelines. Time wasted, which could be used more efficiently, like with figuring out why that bloody calll to this or that API doesn’t return the full amount of data records, and so on.

    cu, w0lf.

    Report


    1. From the article: “Your servers are configured in a secure way by default, with SSH authentication, firewalls, automatic security updates and free SSL certificates from Let’s Encrypt” :)

      You are ultimately still the admin, but the server is provisioned for your and will be patched with security updates. But in the end it’s your server and you can do with it whatever you want.

      Hope it makes sense.

      Report


  2. I run my site on Laravel Forge and Linode. Works like a champ, never have had an issue. I don’t recommend this setup for just anyone though. You need to have some sysadmin skills otherwise you’ll be SOL if something goes wrong.

    Report


  3. As a long time and happy user of ServerPilot + DigitalOcean solution, this looks similar and cool. It worth a time to do some performance tests and compare these similar services. Will come back with my results if something interesting will show up ;)

    Report


  4. Why? Why is the $15 a recurring charge? I have a site on DigitalOcean with all the bells & whistles mentioned in the article. Granted it took me 2 aggravating days to get it setup via DO’s tutorials. At the time I might have been happy to pay a one time fee. However, since you learn by doing, I am now a proficient enough webmaster to do what took me 2 days in 2 hours. That effort would be totally whack though, because once you have a site setup you can take a snapshot of it and use that image whenever you want to roll out a production ready site in mere minutes.

    As far as digitalocean goes, unless Forge washes and waxes your car on a monthly basis I would think its usefulness is greatly diminished after one use. Or am I missing something?

    Report


    1. Laravel Forge have free trial. Do want you want when in trial mode. Then unsubscribe.

      Report


    2. As far as digitalocean goes, unless Forge washes and waxes your car on a monthly basis I would think its usefulness is greatly diminished after one use. Or am I missing something?

      Pretty much: if you’re looking for one-time use, then it’s worth learning how to do it yourself, or you could use something like ‘EasyEngine’, or a pre-configured image, for subsequent provisioning (because everyone should really learn how to do this themselves, if they’re going to do it at all).

      If, however, you’re managing more than one domain, WordPress install, SSL certificate, and so on, and know you’ll be managing more in the future, then that’s where something like this (or ServerPilot) might start to make sense. This is the situation I’m in, and the cost of the service (ServerPilot for me) is less than what I would be otherwise spending in time.

      Report


  5. A cloud server will cost about $10 a month or $120/yr. Forge will cost $15 x 12 = $180. Total is $300/yr?

    I guess for some folks this is money well spent but if you don’t have the tech ‘chops’ to spin up a Linode or D.O. server and install WP then perhaps you should not be doing it?

    It looks to me like Forge is a solution to a problem that very few people should have. You should not be running a cloud server if you don’t know how to run a cloud server. I think that for $300 a year you are best advised to get a commercial VPS or spend a bit more and get a professionally managed server.

    There are a zillion tutorials out there on how to properly install WP and manage a cloud server. It is better to learn how to do the necessary functions than to rely on a ‘black box’ to do it all for you.

    YMMV.

    Report

Comments are closed.