Until you started exploring web development, you may have never heard of the term “web hosting.” Or, if you did, you probably had no clue what’s involved in hosting a website or app. It’s an underappreciated part of how the internet works.
Everything you access on the internet, including podcasts, memes, blog posts, tweets, videos, images, and more, lives on a server or multiple servers that either a company or private individual pays for so that you can access this content.
Once you get past this simple description, web hosting can get complicated. There are many types of web hosting and ways to host web applications.
In this article and the video below, we’ll explore:
- What is web hosting?
- Types of web hosting
- Suggested hosting solutions for beginners
- Learning more about web development
Setting the scene
To get an idea of why web hosting is important, imagine that you’ve just developed a web application. It’s what Web Developers do, after all. Let’s say that it’s an app that allows users to save snippets of code along with related data to make flashcards that other users can use to teach themselves to write code.
Everything in your app is running fine locally. You have a great user interface using React or some other modern front-end framework. You also have a back-end service that works like a charm.
But there’s one problem with your app. It currently lives on your computer, and you want to share it with the rest of the world, but because you’re the only one who can access it right now, you’re the only user.
You can’t let the public access your computer to check out your shiny new application. Well, you could, but that would be reckless and unsafe.
What is web hosting?
This brings us to web hosting. Instead of hosting your application on your own computer and server, it’s much safer to deploy it to another server owned by a company that specializes in these things, called a web hosting provider.
If you’re like most people, you probably don’t want to go out and buy a bunch of servers, hook them up yourself, and deal with network setup and everything else related. Wouldn’t it be easier to rent a server from someone who’s done all the hard work for you?
A web host or hosting provider is a business that provides all the services needed by Web Developers to run their apps on the internet. When someone wants to view your website, all they have to do is type its domain name in a browser, and the servers provided by your web host will serve it up.
Some hosting companies will require that you have a domain that you own to host your site. Others will provide you with a sub-domain they own. If you need a domain, most web hosting providers will help you purchase one.
An important part of web hosting is making sure that you choose the right type of web hosting for your project. If you create a web application with a front end, a back end, and a database, you’ll need a different type of web hosting than you would for a static website.
When you find the right host, it’s also important to allocate the right amount of resources to your application so it doesn’t time out when traffic hits it. For hobby applications, you rarely have to worry about this. But, if your app will be getting thousands of visitors every hour, you’ll have to plan on having more resources available when you need them.
Types of web hosting
A couple of decades ago, there were only a few types of web hosting providers to choose from. But technology changed, and now there are a lot more choices.
The type of web host you choose depends on what you want to do and your technological skills. Some types of hosting require you to know a lot about the technology involved in serving your web application up to users. Other web hosts require little knowledge other than how to navigate around a user interface.
Website builders are online platforms that allow you to build a website quickly in the browser. They usually have a drag-and-drop type of interface you can use to arrange the elements on your pages and a selection of pre-built themes you can apply to your whole site with one click.
Some website builders you may have heard of include Wix and Squarespace. Hosted content management systems like WordPress.com could also be considered website builders because you don’t have to deal with all the technical details of deploying or installing WordPress.
You can choose from hundreds of themes and thousands of plugins to install from your browser to customize your site. You can also add new blog posts and pages that get stored in a database somewhere that you never have to worry about.
Many small businesses use website builders like Wix to build a presence for their company online. It’s simple and easy to build a basic site with no technical knowledge and is a great choice when you don’t have to update your website that often. But, for the most part, your content is static. You can add effects and other features, but each change requires logging in again and arranging things manually.
Website builders backed by content management systems like WordPress.com have one advantage over other website builders because you can add new content much quicker. You don’t have to create a whole new page on your website for every new piece of content you add. All you have to do is create a new post or page, which gets stored in a database, and that post will be dynamically rendered using the theme and plugins you’ve installed.
Another type of website builder is a static site generator. This type of website builder generates complete static HTML pages based on markdown files you edit.
Static site generators support custom themes that you create yourself or find online. When you run the build command, a static site generator will use the markdown files and your theme to generate your site.
While static site generators aren’t hosting, some web hosting options, like GitHub Pages, only support static hosting and use a static site generator to build your site.
Some popular website builders include:
- GitHub Pages: GitHub Pages provides you with the static website generator Jekyll to publish your site and will host it on one of their sub-domains or using your own domain.
- Wix: You can build your website using Wix’s online interface with drag-and-drop elements and an extensive selection of themes.
- WordPress.com: Here, you have all the power of WordPress’s themes and plugins to build your site, and you don’t have to worry about configuring a server or installing WordPress.
Shared web hosting
Shared hosting is a step up from a website builder. With this type of hosting, your application shares the same server with multiple other users, and the hosting provider takes care of all the server configurations.
Shared hosting providers have other services like email and databases that are also hosted on servers shared by other users. Usually, you can purchase a package with a monthly subscription that provides you with these services for one price.
If you’ve ever had roommates, you already have an idea of what this type of web hosting is. Just replace roommates with apps that other people have built.
When you use the shared hosting plan, you share a server with other people. So, essentially, you’re getting a portion of the resources the machine has to offer. Much like having roommates, this makes rent cheaper, but you have to share evenly. If someone else’s app starts consuming lots of resources, your app’s performance will suffer.
There can be many disadvantages to using shared web hosting. Your web applications’ performance will depend on the type of applications also hosted on the same server.
Sometimes you get lucky, and all of your shared hosting neighbors get very little traffic. Other times you aren’t as lucky, and one of the other users sharing your server hogs all the resources, and your site will take a while to load.
Other disadvantages of shared hosting include:
- Vulnerable to security issues. If one website on the server gets hacked, then your application is at risk. If the server itself gets hacked, then every website on the application goes down.
- There are limits on what you can install. If you’re building an application using PHP and MySQL, then shared hosting will work for you. But, if you want to use Python, Node.js, C#, Java, or another programming language for your app, then your options could be limited.
- You don’t have root access, so you’re stuck with how the hosting provider configured the server and cannot customize it.
- You get what you pay for, so the support you receive when you run into issues will be limited.
Most shared hosting providers also provide dedicated hosting.
Dedicated web hosting
Dedicated web hosting has a lot of advantages over shared hosting.
Dedicated web hosting is a hosting option where you rent a whole physical server from a hosting provider. No one will share your resources. You’ll get full control over your server and can install any software that it supports. You’ll also have root access, so you can configure the server in any way you want.
When you order a dedicated server, you’ll choose between having an unmanaged server where you handle all the changes needed on the server, or a managed server, where the hosting provider’s staff will manage the server.
When you order a dedicated host, it’s important to know what type of server you need first since you’re ordering an actual physical machine. You can usually choose the operating system the server will use, the amount of physical RAM, the type of CPU, the amount of physical storage, and other options.
In the past, many companies started with shared hosting and moved up to dedicated hosting when their traffic picked up. If the traffic load increased so much that one dedicated server wasn’t enough, they’d have to configure a load balancer and add more servers to handle the load. While this is still an option, many companies have opted to go with cloud hosting, which gives you this type of scaling capabilities without all the manual setup.
Some popular shared and dedicated web hosting providers include:
- HostGator: HostGator provides multiple types of shared and dedicated hosting packages.
- GoDaddy: GoDaddy will sell you the domain and offer both shared and dedicated hosting.
- InMotion: InMotion offers shared, dedicated, and WordPress-specific hosting.
Note that there are also virtual private servers (VPS). A VPS’ functionality lies somewhere between shared and dedicated web hosting. They’re generally more affordable than the latter, and they’re more reliable and secure than the former. They also provide users with root access, and they’re commonly used for game development.
Cloud hosting providers have data centers across the globe. All the services they provide are virtual, which means even the “hardware” you rent is software that can be configured, scaled, and backed up on the fly.
The worldwide servers allow you to spread your applications and data across multiple interconnected servers. This allows your users to access them from a server that’s closer to them with lower latency. Because cloud servers can scale dynamically, you always have just enough resources at hand.
Infrastructure as a Service (IaaS)
With IaaS, the cloud provider delivers your infrastructure over the internet. So all the networking, storage, servers, memory, and CPU you’ll use will be virtualized and highly scalable. You’ll still have to configure and maintain these resources, but you won’t have to worry about the underlying physical infrastructure.
Because everything is virtual, you can do all this maintenance and configuration through the browser or via the command line and make almost real-time changes to your infrastructure.
Popular IaaS providers include:
- Digital Ocean: A IaaS cloud provider that’s simpler to use than the big three cloud providers also in this list.
- Amazon Web Services: The first and most popular of all cloud providers.
- Google Cloud Platform: Google’s answer to IaaS.
- Microsoft Azure: Microsoft’s IaaS solution.
Platform as a Service (PaaS)
With PaaS, the cloud host delivers a framework for developers to build their applications on top of. Instead of worrying about setting up your servers and configuring your virtual machines properly, you only have to create your application, and the cloud provider takes care of the rest.
But, since you’re using a specialized framework when you go with PaaS, you’ll have to code your application according to the rules of the framework.
Popular PaaS providers include:
- Heroku: Heroku makes it easy to deploy Node.js, Ruby, Java, PHP, Python, Go, Scala, and Clojure applications with a few commands.
- Google App Engine: Google App Engine lets you build highly scalable applications on a fully managed serverless platform.
Function as a Service (FaaS)
With FaaS, you don’t deploy services to the cloud hosting provider, just functions. That means you don’t have to worry about configuring a server or configuring resources. You just choose the runtime you’ll be writing your code in and write functions to return the data you need.
When you use FaaS, the physical hardware, virtual machine operating systems, and web server software are all handled by your cloud service provider.
Popular FaaS providers include:
- Amazon Lambda: Amazon Lambda is the most popular FaaS provider.
- Azure Functions: Azure also provides FaaS.
- Cloud Functions: This is Google Cloud Platform’s FaaS offering.
Suggested hosting solutions for beginners
We just covered a lot, and you may feel a little overwhelmed, but we have a few suggestions if you’re just beginning with web development. The following web hosting providers should give you what you need to get started.
When choosing a web hosting provider, experiment with simple demo projects and see what works for you and what doesn’t. Always make sure you evaluate your options against what you’re trying to build.
Remember that at the end of the day, all of these are just tools you can use. There’s no one-size-fits-all solution, so you might use some of these, you might use none, or you might use a mixture of all three — or even other solutions.
GitHub Pages (static site generator)
GitHub Pages uses the Git version control system and a static website generator called Jekyll to publish websites for its users, and it’s free. Because you can only publish static pages, you won’t be able to deploy your web applications here, but it’s good for blogs, your portfolio site, or possibly a compiled version of a React application that doesn’t require back-end code.
Our How to Deploy a Website course will teach you how to deploy a website to GitHub Pages.
Heroku is a PaaS provider that’s very popular with developers because it makes it easy to deploy full-stack applications with no worry about configuring servers.
Heroku will also give you a free trial, which is good for hackathons or if you have a web application that doesn’t get a lot of traffic. Our Deploying with Netlify and Heroku course will teach you how to use Heroku and also Netlify, a static hosting provider.
Digital Ocean (IaaS)
If you want to scale your application and Heroku doesn’t fit your needs, Digital Ocean is a good option. Especially if you want to use an IaaS cloud provider but don’t want to deal with all the complexity that comes with some of the bigger providers. It’s easy to build your applications on Digital Ocean, and they have a lot of resources to help beginners get started.
Learning more about web development
If you want to show your shiny new app to the rest of the world, you need web hosting. There are plenty of options, from website builders to cloud hosting. It all depends on what type of website or application you want to deploy.
For blogs and sites that are mainly content, a website builder may be enough. If you want to deploy an actual web application that’ll execute server-side code, you’ll need to go with either a shared host, a dedicated host, or a cloud hosting provider.
If you don’t have a web application to deploy yet, we can show you how to build one with our courses.
And if you just want to jump right into building a website from scratch, try Build a Website with HTML, CSS, and GitHub Pages.