Academy is open. New beginner lessons every week, free.
Lesson 2 of 3 · beginner

Hosting and domains

Where your files live, what a domain really is, and what costs look like.

In this video, CodeYam cofounder and CTO Jared Cosulich answers the questions people ask most about getting a website online. Each question is its own chapter, so you can jump straight to the ones you care about.

The short version

Hosting is where your website lives so other people can reach it. A domain is the address people type to get there, like example.com. You can have one without the other, but most sites people take seriously have both.

Why your site isn't online yet

If you can see your site by double-clicking a file, or at an address with localhost in it, it is only running on your computer. Nobody else can open it, even if you send them the link. To share it, you need to host it.

Getting your first site online

  1. Start with free hosting. A static website (the same content for every visitor) can usually be hosted free on GitHub Pages. If your site has logins or a database, try Vercel or Render, which both have free tiers.
  2. Try it on the free address first. Your host gives you a working web address. It is long and not very pretty, but it is fine for testing or showing a few friends.
  3. Buy a domain when you are ready to share it widely. Aim for something short, catchy and easy to remember. Don't worry if the .com is taken; .co, .io, .ai and .org are all common now. If you pick an unusual extension, look it up first, because some networks block a few of them.
  4. Buy from a well-known registrar, the kind of company that sells domains, such as Namecheap. Check the renewal price as well as the first-year price, since some start cheap and renew much higher.
  5. Turn on automatic renewal. You rent a domain rather than own it, and if it lapses, someone else can buy it.

Want to see a real site go live on its own domain? Watch Going live on a custom domain.

What it costs

  • Hosting a simple static site: often free.
  • Hosting an app with a database: often free to start, then roughly $20 to $40 a month as it grows.
  • A new domain: usually $10 to $20 a year for a .com, and up to about $100 for some names. Buying a domain someone else already owns can cost thousands.

Hosts and database services warn you as you get close to a free tier's limit. The two things that usually push you onto a paid plan are a lot more visitors and a lot more stored data, like photos or videos people upload.

Words to know

  • Hosting: a service that keeps your site online for anyone to visit.
  • Domain: your site's address, like example.com.
  • Extension: the ending of a domain, like .com or .org.
  • Registrar: a company that sells domains.
  • localhost: an address that only works on your own computer.
  • Free tier: the free level of a paid service, with limits.

Services mentioned in this lesson

Prefer to listen? This video is also an episode of the CodeYam podcast: Hosting & Domains.

In this lesson11 chapters
  1. 0:00What do hosting and domains mean?
  2. 1:33How is a hosted site different from localhost?
  3. 2:32How do I choose a hosting provider?
  4. 3:40Do I need a domain for a personal site?
  5. 4:30How should I choose a domain name and extension?
  6. 7:11What if the domain I want isn't available?
  7. 8:16Where do I buy a domain, and am I stuck there?
  8. 10:04What have I bought, and do I own it forever?
  9. 11:16What does a simple site really cost?
  10. 13:49When have I outgrown free hosting?
  11. 14:43What hidden costs should I watch for?
TranscriptClick any timestamp to jump the video there.
0:00

What do hosting and domains mean?

A session with the CodeYam team, with Dani and Nadia putting the common questions to Jared. Hosting is putting a website or web app live somewhere so anybody on the internet can reach it, and most of the time that somewhere is a service rather than your own computer. A domain is the name, like google.com, that takes people to it. You can have either without the other. Hosting without a domain gets you a long, funky URL from the provider, and a domain pointing at nothing is at best a mild investment. Anyone doing something relatively professional usually buys one.

1:33

How is a hosted site different from localhost?

Files on your computer are only on your computer. Nobody else can see them unless you go to real effort to expose your machine to the internet, which most people don't bother with. When you run an app locally you usually see localhost in the URL, an easy alias for an address on your own machine. People do try to share localhost links, and they won't work for anybody but you, because the app is running on your computer and nowhere else.

2:32

How do I choose a hosting provider?

There are plenty to pick from, including GoDaddy, Render and Vercel, and for a static site you can use GitHub Pages directly. They are all pretty good and usually similar in price, so anything that ranks well when you search for hosting providers, or that Reddit recommends, is likely a decent choice. Jared's own default is GitHub Pages for a static website and Vercel or Render for a dynamic one, which matches the usual advice to start on GitHub Pages and level up from there.

3:40

Do I need a domain for a personal site?

You might launch without one just to test or to show a handful of people. Once you want the general public to see it, a domain is worth having. A personal website on a free provider URL can look weird, almost like a hack, especially to non-technical visitors.

4:30

How should I choose a domain name and extension?

There is no purely logical answer. Aim for something catchy, short, easy to remember and tied to your brand. It used to be that you almost always wanted a .com, but most short .coms are taken now, and people happily use .ai, .co, .io, or .org for a nonprofit, because most visitors find you through search anyway. Getting something reasonable is the goal, since perfect can cost tens of thousands of dollars. It is also worth researching an unusual extension before you commit, because some networks, campuses among them, block certain extensions such as .xyz outright.

7:11

What if the domain I want isn't available?

Get creative. Try a different extension, or prepend a word like try, install or use to get around a name that is already owned. Sometimes a squatter holds the name and will sell it for a price. Most companies, CodeYam included, brainstorm many, many names before landing on one they like. The perfect domain shouldn't block you from getting started, and people rarely find you by guessing your domain anyway.

8:16

Where do I buy a domain, and am I stuck there?

You are not stuck, and moving a domain to another provider is less painful than it feels. Namecheap is a popular registrar and the one the team most often uses, and Google Domains was sold to Squarespace. Watch for a low first-year price that renews at a much higher rate, and only buy from a legitimate source, since people do try to sell domains they don't own. Competition keeps the name-brand providers fairly honest.

10:04

What have I bought, and do I own it forever?

You never own a domain outright. You rent it for a period, from one year up to many years at once, often with a discount for buying longer. If you let it expire someone else can grab it, and big companies have had to pay a lot to buy theirs back. Registrars send plenty of reminders, so the simplest protection is to turn on automatic renewal.

11:16

What does a simple site really cost?

A static website serves the same content to everyone with nothing pulled from a database, and it can run free on something like GitHub Pages. Even a small site with a database can often stay on free tiers. A web app of mild complexity with a database typically runs about $20 to $40 a month, and a static site that talks to a database from the browser can cost less. Static sites also cope well with sudden traffic. An unclaimed domain is usually $10 to $100 up front and $10 to $100 a year after, with a typical .com around $10 to $20 a year. Buying a name from someone else is the part that can reach thousands.

13:49

When have I outgrown free hosting?

Two signals. You want to add complexity, such as a database, to a site that was hosted free, or the traffic coming through gets too large for the free tier. More often than not it comes down to how much traffic you have and how much data you store, and providers usually warn you before you tip into a paid plan.

14:43

What hidden costs should I watch for?

They are much less of a worry than they used to be. The old horror stories were surprise AWS bills from a sudden surge of traffic, and providers now notify you and let you set cost controls. The other thing to watch is storage. An app where people upload photos or video can grow its storage and database costs faster than you expect. Pay attention to what your hosting and database providers tell you and you probably won't have a problem.