Andrew Welch · Insights · #devops #hosting #vps

Published , updated · 5 min read ·


Please consider 🎗 sponsoring me 🎗 to keep writing articles like this.

How Agencies & Freelancers Should Do Web Hosting

Web­sites are use­less with­out a web­serv­er host­ing it. Yet web host­ing is often an after­thought. It should­n’t be.

Web Host Server

Web host­ing is some­thing that many agen­cies and free­lancers don’t give a whole lot of thought to. They just use whomev­er they’ve had a long-stand­ing rela­tion­ship with, and call it a day.

How­ev­er, choos­ing the right host — and the right type of host — can be cru­cial to the suc­cess of a project. And the host­ing 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 host­ing is one of the bul­let points I men­tioned in the Fron­tend Dev Best Prac­tices for 2017 arti­cle, so it should be no sur­prise we’re going in deep! There are sev­er­al types of host­ing available:

  • Shared Host­ing — your web­site sits on a serv­er with a bunch of oth­er web­sites, man­aged by the host­ing com­pa­ny. It’s akin to rent­ing an apart­ment: inex­pen­sive, but cramped, and your neigh­bors can impact your qual­i­ty of life in a big way, espe­cial­ly if the walls are thin.
  • Man­aged Host­ing — your web­site sits on a serv­er that an IT com­pa­ny (or a guy with a beard) owns and admin­is­ters for you. This is like liv­ing in a con­do­mini­um in that it’s typ­i­cal­ly a step up from rent­ing an apart­ment, but you still don’t own the land you live on.
  • VPS Host­ing — your web­site sits on a vir­tu­al serv­er that you own and can do what­ev­er you like with. This is anal­o­gous to own­ing your own house. Wan­na paint the walls pink? Go ahead, it’s yours.

I’m going to try to con­vince you that it’s very like­ly that VPS Host­ing is what you should be using. But first, some background.

Link Shared Hosting

Shared host­ing is some­thing I sim­ply don’t rec­om­mend at all these days. Tech­nol­o­gy has pro­gressed such that the pri­ma­ry ben­e­fit of shared host­ing — that it’s cheap — has been erod­ed by the inex­orable progress of technology.

Shared host­ing became a thing because servers were expen­sive back in the day. Many com­pa­nies could­n’t jus­ti­fy the expense of their own serv­er, so bou­tique busi­ness­es sprung up where they’d cre­ate an account for you on their serv­er, and let you put your web­site 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 & col­league who has the best shared host­ing deal you could imag­ine: it’s entire­ly free for his com­pa­ny web­site. That’s because he brings his clients to the host­ing company.

How­ev­er, there is a dis­tinct dif­fer­ence between the price of some­thing, and the cost of some­thing. The num­ber of hours he has ago­nized over the prob­lems aris­ing from this bou­tique shared host­ing has made it clear that his host­ing is any­thing but free.

And the cost of cre­at­ing errat­i­cal­ly or poor­ly per­form­ing web­sites for your clients can­not be under­stat­ed. See the A Pret­ty Web­site Isn’t Enough arti­cle for details on web performance.

I just refuse work if the client has their web­site host­ed on GoDad­dy or Host­Ga­tor shared host­ing. It’s the web­dev equiv­a­lent of unsafe work­ing con­di­tions. It always ends in tears.

So let’s just for­get about shared host­ing. It’s the worst solu­tion to web­site host­ing for just about every circumstance.

Link Managed Hosting

Man­aged host­ing can be more attrac­tive. After all, you’re a design­er or devel­op­er, not a Unix guru who rel­ish­es in writ­ing shell scripts. You want to design the web­site, hand it off to the client, and not deal with the gory bits of set­ting up and main­tain­ing a server.

There are a vari­ety of lev­els of man­aged host­ing, but in gen­er­al, the idea is that you buy a vir­tu­al serv­er, but some­one else man­ages it for you. The upsides are obvi­ous, in that your client has some­one else to call if some­thing goes wrong with the serv­er — though they will prob­a­bly still call you anyway.

The down­sides are that you are pay­ing for this set­up and sup­port. You’ll end up with less serv­er for your mon­ey each month, because some of your mon­ey goes towards sup­port, 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 Cre­at­ing Opti­mized Images in Craft CMS arti­cle, to cre­ate awe­some­ly opti­mized images for your client. Well, you can’t.

You need to file a sup­port tick­et to have some­one do it for you. Usu­al­ly they will, but depend­ing on the soft­ware they offi­cial­ly sup­port, some­times they won’t.

I real­ize that to some peo­ple, fil­ing a sup­port tick­et and let­ting some­one else han­dle it sounds like a good thing. And it can be. But not when you’re twid­dling your thumbs wait­ing 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 mer­cy of the IT com­pa­ny that man­ages your serv­er for the stack” that they pro­vide. For instance, when PHP 7 was released in Q4 2016, it was a water­shed release for PHP. It lit­er­al­ly dou­bled the speed for PHP appli­ca­tions across the board. And yet many man­aged host­ing envi­ron­ments were very slow to roll it out.

Some man­aged hosts still don’t offer PHP 7 (which I con­sid­er to be manda­to­ry for any web­site run­ning PHP apps), or they offer it, but in beta”.

In my years of admin­is­ter­ing vari­ety of web servers, by far the most prob­lems have arisen from bou­tique host­ing envi­ron­ments using a dep­re­cat­ed stack that results in poor per­for­mance (or just plain non-per­for­mance). It gets worse when some­one else is main­tain­ing 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.

Final­ly, most man­aged hosts also have a lim­it­ed geo­graph­ic area where they host web­sites. Typ­i­cal­ly they offer just one loca­tion where your serv­er phys­i­cal­ly exists, which makes it less than ide­al when you work with clients from all over the coun­try — or all over the world.

There are some good man­aged hosts out there, to be sure. For­tRa­b­bit is one; ArcusTech is anoth­er. How­ev­er, there are some very large and well known man­aged hosts that are down­right hor­ri­ble… and gross­ly overpriced.

Link VPS Hosting

The final type of host­ing we’re going to dis­cuss is the one I think is best for most clients, and most agencies/​freelancers: VPS hosting.

With fan­tas­tic com­pa­nies like Lin­ode, Dig­i­tal Ocean, Vul­tr, and Ama­zon AWS you can spin up a new serv­er run­ning a mod­ern stack with just a few clicks. And it’s yours. You can do what­ev­er you want with it.

For a com­par­i­son of these ser­vices, check out:

You also get to pick where in the world the serv­er is phys­i­cal­ly locat­ed, keep­ing it close to your clients (or their customers):

Vps Locations

Vul­tr Locations

All of the afore­men­tioned VPS hosts pro­vide mon­i­tor­ing fea­tures, load bal­anc­ing, auto­mat­ed snap­shot back­ups, and more.

But I don’t want to admin­is­ter a serv­er,” you say. I don’t want you to, either. Lin­ode, Dig­i­tal Ocean, Vul­tr, and Ama­zon 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 intro­duce you to Lar­avel Forge, Ploi​.io, Server​Pi​lot​.io, and Run​Cloud​.io.

Lar­avel Forge, Ploi​.io, Server​Pi​lot​.io and Run​Cloud​.io are serv­er pro­vi­sion­ing tools. They can be used with any serv­er run­ning Ubun­tu 16.04 (that’s a Lin­ux dis­tri­b­u­tion) from any of the afore­men­tioned VPS host­ing com­pa­nies, and they take the pain out of set­ting up and main­tain­ing servers.

Keep Calm And Let The Sysadmin Hanlde It

Here’s what you can do with these serv­er pro­vi­sion­ing tools:

  • Click a but­ton to cre­ate a new serv­er, con­fig­ured with a mod­ern, per­for­mant stack
  • Click a but­ton to cre­ate a new web­site on your serv­er (make as many as you want!)
  • Click a but­ton to upgrade or down­grade your serv­er plan at any time
  • Click a but­ton to cre­ate a com­plete­ly free, auto-renew­ing SSL cer­tifi­cate for your web­site via LetsEn­crypt
  • If you enable https by installing an SSL cer­tifi­cate, you auto­mat­i­cal­ly get http2 as well (2 fea­tures 1 click)
  • Click a but­ton to link your GitHub or Beanstalk (or what­ev­er) git repo to the website
  • Click a but­ton to set it to auto-deploy changes you make when you push to var­i­ous git repo branches
  • Secu­ri­ty updates will be installed for you auto­mat­i­cal­ly; no fuss, no muss
  • The stack installed is secure by design; best prac­tices like requir­ing SSH keys are imple­ment­ed by default

This all lets you have a work­flow as described in the Data­base & Asset Sync­ing Between Envi­ron­ments in Craft CMS article:

Code Flow

Make your changes in local dev, push to your git repo, and it’s auto­mat­i­cal­ly deployed to what­ev­er serv­er you want. As a bonus, you now have a revi­sioned back­up of your web­site that you can use to roll back changes if needs be. For more on back­ups, check out the Mit­i­gat­ing Dis­as­ter via Web­site Back­ups article.

You have the abil­i­ty to spin up servers at will, con­fig­ure them with a cou­ple of clicks, and get back to work­ing on your project. But with a work­flow that allows you to do your job more effi­cient­ly, and more reli­ably. And with­out wait­ing for some­one to get to your sup­port ticket.

And if you end up need­ing to, you can ssh in and install what­ev­er 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 rea­son this all works is because Lar­avel Forge, Ploi​.io, Server​Pi​lot​.io and Run​Cloud​.io have cre­at­ed a care­ful­ly craft­ed recipe for set­ting up and con­fig­ur­ing these servers in a secure & per­for­mant way. Then they’ve com­bined it with a very easy to use, mod­ern web UI that I promise you will enjoy using.

It real­ly is that good.

Victory Silhouette

So which should you choose? I have expe­ri­ence with Lar­avel Forge, Ploi​.io, and Server​Pi​lot​.io, but not Run​Cloud​.io as it is a rel­a­tive new­com­er. Still, I have heard fan­tas­tic things about Run​Cloud​.io, so def­i­nite­ly put it on your list to check out.

As for Lar­avel Forge, Ploi​.io, and Server​Pi​lot​.io, they are both excel­lent ser­vices; Server​Pi​lot​.io uses an Apache <-> Nginx set­up so you can still use your .htaccess files and such, and it lets you pick from var­i­ous PHP ver­sions to run, so it’s the safe choice. Server​Pi​lot​.io also has a com­plete­ly free tier, which does­n’t include the SSL cer­tifi­cates and a few oth­er nic­i­ties, but oth­er­wise works great.

Lar­avel Forge is some­what more devel­op­er-ori­ent­ed, in that it comes with an SSH keys man­ag­er, free SSL cer­tifi­cates are an auto­mat­ic part of the pack­age, it runs the high per­for­mance Nginx web­serv­er, and allows you to grant access (or be grant­ed access) to man­age oth­er peo­ple’s Forge servers with­out need­ing their cre­den­tials, which is fan­tas­tic for client work.

Ploi is very sim­i­lar to Lar­avel Forge, but offers a bit more in terms of han­dling the atom­ic deploy­ments for you, rather than depend­ing on anoth­er tool like Lar­avel Envoyer.

I per­son­al­ly pre­fer Forge because I pre­fer Nginx as a web­serv­er and just like the method­ol­o­gy it uses, and the built-in deploy­ments from git repos is a huge plus for me. How­ev­er, Server​Pi​lot​.io is sol­id as well… and Ploi is becom­ing more and more popular.

Both pro­vide a very easy to use web-based UI for serv­er man­age­ment, and Forge even has a pub­lic API for doing such things. If you do use Forge, and have a Mac, check out the very cool F‑Bar app for man­ag­ing Forge servers right from your menu bar.

There are oth­er fan­tas­tic fea­tures that they both offer, but hope­ful­ly I’ve giv­en you enough of a taste to give em a whirl.

You can’t go wrong with either choice. So worth it.

Link So What Are The Downsides?

So what are the down­sides to spin­ning up your own VPS? There are two pri­ma­ry ones:

  1. Email — Nei­ther Forge nor Server​Pi​lot​.io pro­vide email. You can con­fig­ure them to, but I rec­om­mend against it. Instead, set them up with a Google for Busi­ness email account, or use their domain reg­is­trar’s email if their needs are sim­ple (most domain reg­is­trars offer 5 free email address­es with each domain).
  2. Sup­port — All of the afore­men­tioned VPS host­ing com­pa­nies offer sup­port, but they do not offer the kind of sup­port you get from man­aged host­ing. In my expe­ri­ence, it has­n’t mat­tered. A mod­ern, deter­min­is­tic VPS set­up has far few­er issues than shared / bou­tique host­ing, and the tools that Forge & Server​Pi​lot​.io pro­vide are usu­al­ly suf­fi­cient in any event.

Link CloudWays: A Third Option

An inter­est­ing, and rel­a­tive­ly new host­ing ser­vice that you might check out is Cloud­Ways. It’s a pro­vi­sion­ing ser­vice just like Forge and Server​Pi​lot​.io, and using it can you sim­i­lar­ly spin up servers all over the world via Dig­i­talO­cean, Vul­tr, Ama­zon, and more… but with a twist.

It’s man­aged host­ing, so you also get 247 sup­port. So in some ways, it’s the best of both worlds: you get the ben­e­fits of a mod­ern stack, glob­al­ly deploy­able with a few clicks, but you also get support.

This can be a nice option for clients who demand 247 sup­port, or if you’re con­cerned about hav­ing to pro­vide sup­port to clients yourself.