Web hosting is something that many agencies and freelancers don’t give a whole lot of thought to. They just use whomever they’ve had a long-standing relationship with, and call it a day.
However, choosing the right host—and the right type of host—can be crucial to the success of a project. And the hosting world has changed a whole lot in the past few years, so let’s dive in.
A web host is simply a server where you put the project you developed, so that the world can access it in all of its glory.
Web hosting is one of the bullet points I mentioned in the Frontend Dev Best Practices for 2017 article, so it should be no surprise we’re going in deep! There are several types of hosting available:
- Shared Hosting - your website sits on a server with a bunch of other websites, managed by the hosting company. It’s akin to renting an apartment: inexpensive, but cramped, and your neighbors can impact your quality of life in a big way, especially if the walls are thin.
- Managed Hosting - your website sits on a server that an IT company (or a guy with a beard) owns and administers for you. This is like living in a condominium in that it’s typically a step up from renting an apartment, but you still don’t own the land you live on.
- VPS Hosting - your website sits on a virtual server that you own and can do whatever you like with. This is analogous to owning your own house. Wanna paint the walls pink? Go ahead, it’s yours.
I’m going to try to convince you that it’s very likely that VPS Hosting is what you should be using. But first, some background.
Shared hosting is something I simply don’t recommend at all these days. Technology has progressed such that the primary benefit of shared hosting—that it’s cheap—has been eroded by the inexorable progress of technology.
Shared hosting became a thing because servers were expensive back in the day. Many companies couldn’t justify the expense of their own server, so boutique businesses sprung up where they’d create an account for you on their server, and let you put your website on it.
I’ve lived through many horror stories of someone else’s poorly implemented website on a shared host bringing down my client’s website. It’s awful.
I have a friend & colleague who has the best shared hosting deal you could imagine: it’s entirely free for his company website. That’s because he brings his clients to the hosting company.
However, there is a distinct difference between the price of something, and the cost of something. The number of hours he has agonized over the problems arising from this boutique shared hosting has made it clear that his hosting is anything but free.
And the cost of creating erratically or poorly performing websites for your clients cannot be understated. See the A Pretty Website Isn’t Enough article for details on web performance.
I just refuse work if the client has their website hosted on GoDaddy or HostGator shared hosting. It’s the webdev equivalent of unsafe working conditions. It always ends in tears.
So let’s just forget about shared hosting. It’s the worst solution to website hosting for just about every circumstance.
Managed hosting can be more attractive. After all, you’re a designer or developer, not a Unix guru who relishes in writing shell scripts. You want to design the website, hand it off to the client, and not deal with the gory bits of setting up and maintaining a server.
There are a variety of levels of managed hosting, but in general, the idea is that you buy virtual server, but someone else manages it for you. The upsides are obvious, in that your client has someone else to call if something goes wrong with the server—though they will probably still call you anyway.
The downsides are that you are paying for this setup and support. You’ll end up with less server for your money each month, because some of your money goes towards support, whether you use it or not.
Additionally, you don’t own the server.
Let’s say you want to install jpegoptim & optipng as per the Creating Optimized Images in Craft CMS article, to create awesomely optimized images for your client. Well, you can’t.
You need to file a support ticket to have someone do it for you. Usually they will, but depending on the software they officially support, sometimes they won’t.
I realize that to some people, filing a support ticket and letting someone else handle it sounds like a good thing. And it can be. But not when you’re twiddling your thumbs waiting for it to be addressed before you can get to work.
The fact that you filed a support ticket doesn’t prevent your client from blaming you when the website is down.
You are also at the mercy of the IT company that manages your server for the “stack” that they provide. For instance, when PHP 7 was released in Q4 2016, it was a watershed release for PHP. It literally doubled the speed for PHP applications across the board. And yet many managed hosting environments were very slow to roll it out.
Some managed hosts still don’t offer PHP 7 (which I consider to be mandatory for any website running PHP apps), or they offer it, but in “beta”.
In my years of administering variety of web servers, by far the most problems have arisen from boutique hosting environments using a deprecated stack that results in poor performance (or just plain non-performance). It gets worse when someone else is maintaining this for you, and you have no say in what is offered to you.
You are also often stuck using antiquated CPanel software to administer your server. Which inevitably leads to filing a support ticket when it can’t do what you need.
Finally, most managed hosts also have a limited geographic area where they host websites. Typically they offer just one location where your server physically exists, which makes it less than ideal when you work with clients from all over the country—or all over the world.
There are some good managed hosts out there, to be sure. FortRabbit is one; ArcusTech is another. However, there are some very large and well known managed hosts that are downright horrible… and grossly overpriced.
The final type of hosting we’re going to discuss is the one I think is best for most clients, and most agencies/freelancers: VPS hosting.
With fantastic companies like Linode, Digital Ocean, Vultr, and Amazon AWS you can spin up a new server running a modern stack with just a few clicks. And it’s yours. You can do whatever you want with it.
For a comparison of these services, check out:
- $5 Showdown: Linode vs. DigitalOcean vs. Amazon Lightsail vs. Vultr
- $10 Showdown: Linode vs. DigitalOcean vs. Amazon Lightsail
- 8GB Showdown: Linode vs DigitalOcean vs Amazon Lightsail vs Vultr
- Cloud Hosting Showdown – DigitalOcean vs AWS vs VULTR vs Linode vs Azure
- Or compare them head to head here: VPS Benchmarks
You also get to pick where in the world the server is physically located, keeping it close to your clients (or their customers):
All of the aforementioned VPS hosts provide monitoring features, load balancing, automated snapshot backups, and more.
“But I don’t want to administer a server,” you say. I don’t want you to, either. Linode, Digital Ocean, Vultr, and Amazon AWS are great on their own if you’re a Unix beast. If you’re not, I get it. You don’t want to be that guy or gal. Let me introduce you to Forge and ServerPilot.io.
Both Forge and ServerPilot.io are server provisioning tools. They can be used with any server running Ubuntu 16.04 (that’s a Linux distribution) from any of the aforementioned VPS hosting companies, and they take the pain out of setting up and maintaining servers.
Here’s what you can do with these server provisioning tools:
- Click a button to create a new server, configured with a modern, performant stack
- Click a button to create a new website on your server (make as many as you want!)
- Click a button to upgrade or downgrade your server plan at any time
- Click a button to create a completely free, auto-renewing SSL certificate for your website via LetsEncrypt
- If you enable https by installing an SSL certificate, you automatically get http2 as well (2 features 1 click)
- Click a button to link your GitHub or Beanstalk (or whatever) git repo to the website
- Click a button to set it to auto-deploy changes you make when you push to various git repo branches
- Security updates will be installed for you automatically; no fuss, no muss
- The stack installed is secure by design; best practices like requiring SSH keys are implemented by default
This all lets you have a workflow as described in the Database & Asset Syncing Between Environments in Craft CMS article:
Make your changes in local dev, push to your git repo, and it’s automatically deployed to whatever server you want. As a bonus, you now have a revisioned backup of your website that you can use to roll back changes if needs be.
You have the ability to spin up servers at will, configure them with a couple of clicks, and get back to working on your project. But with a workflow that allows you to do your job more efficiently, and more reliably. And without waiting for someone to get to your support ticket.
And if you end up needing to, you can ssh in and install whatever you want on your VPS.
If you land a new client in Singapore, no problem. Spin up a VPS located physically in Singapore, and get to work.
The reason this all works is because Forge and ServerPilot.io have created a carefully crafted recipe for setting up and configuring these servers in a secure & performant way. Then they’ve combined it with a very easy to use, modern web UI that I promise you will enjoy using.
It really is that good.
So which should you choose? They are both great services; ServerPilot.io uses an Apache <-> Nginx setup so you can still use your .htaccess files and such, and it lets you pick from various PHP versions to run, so it’s the safe choice. ServerPilot.io also has a completely free tier, which doesn’t include the SSL certificates and a few other nicities, but otherwise works great.
Forge is somewhat more developer-oriented, in that it comes with an SSH keys manager, free SSL certificates are an automatic part of the package, it runs the high performance Nginx webserver, and allows you to grant access (or be granted access) to manage other people’s Forge servers without needing their credentials, which is fantastic for client work.
Both provide a very easy to use web-based UI for server management, and Forge even has a public API for doing such things. If you do use Forge, and have a Mac, check out the very cool F-Bar app for managing Forge servers right from your menu bar.
There are other fantastic features that they both offer, but hopefully I’ve given you enough of a taste to give ’em a whirl.
You can’t go wrong with either choice. So worth it.
So What Are The Downsides?
So what are the downsides to spinning up your own VPS? There are two primary ones:
- Email - Neither Forge nor ServerPilot.io provide email. You can configure them to, but I recommend against it. Instead, set them up with a Google for Business email account, or use their domain registrar’s email if their needs are simple (most domain registrars offer 5 free email addresses with each domain).
- Support - All of the aforementioned VPS hosting companies offer support, but they do not offer the kind of support you get from managed hosting. In my experience, it hasn’t mattered. A modern, deterministic VPS setup has far fewer issues than shared / boutique hosting, and the tools that Forge & ServerPilot.io provide are usually sufficient in any event.
CloudWays: A Third Option
An interesting, and relatively new hosting service that you might check out is CloudWays. It’s a provisioning service just like Forge and ServerPilot.io, and using it can you similarly spin up servers all over the world via DigitalOcean, Vultr, Amazon, and more… but with a twist.
It’s managed hosting, so you also get 24/7 support. So in some ways, it’s the best of both worlds: you get the benefits of a modern stack, globally deployable with a few clicks, but you also get support.
This can be a nice option for clients who demand 24/7 support, or if you’re concerned about having to provide support to clients yourself.