Privacy note: We capture your IP address to provide customised and focused services. See our Privacy Policy.

Full-Stack Web Development — Alpha School

Lesson 19: Deployment: From Your Computer to the World

Deployment is the step that turns a project on your computer into a website anyone can visit, and it is less mysterious than it sounds: you put your files on a server, give that server a name, and make sure it serves the files securely. This lesson walks through that journey in order: choosing where to host, uploading your files, connecting a domain name, turning on HTTPS, and checking that the live site actually works. You will deploy the capstone project in the next lesson, so treat this lesson as the rehearsal, and by the end of it you will know exactly what each step does and what to do when it goes wrong.

Choosing a host

A host is a company that rents you space on a server, and for a static site, one built from HTML, CSS and JavaScript with no server code, hosting is often free: services such as GitHub Pages, Netlify and Cloudflare Pages will publish a site from a Git repository at no cost, which is why this course recommends them for student projects. A site with a backend, such as the Express API from Unit 4, needs a host that runs server code, which usually costs a small amount, and many hosts offer a free tier for learning. When choosing, look for three things: that it serves your site over HTTPS by default, that it redeploys automatically when you push to Git, and that it shows you clear logs when something fails. Avoid hosts that ask you to upload files by hand with no version control, because that is how files get lost and versions get confused.

Domains and DNS

A domain name, such as alpha.unb.college, is a human-readable name for a server, and you rent it from a registrar, usually for a year at a time. Connecting it to your host means adding a DNS record, which is a line in the domain's settings saying “this name points at that server”, and the most common records are A records, which point to an IP address, and CNAME records, which point to another name. DNS changes take time to spread around the world, sometimes minutes and sometimes hours, so do not panic if the new address does not work immediately, and check it with a tool such as whatsmydns.net to see whether the change has reached your area yet. Keep your domain registered to an email address you actually read, because if it expires, your site disappears, and renewing it late can be expensive or impossible.

HTTPS and security basics

HTTPS encrypts the connection between a visitor and your site, so passwords and form data cannot be read on the way, and browsers now warn visitors about sites that do not use it, so every site you publish must have it. The good news is that most modern hosts provide HTTPS automatically, using free certificates from Let's Encrypt, and the setup is often a single toggle, so there is no excuse for publishing over plain HTTP. A few more basics complete the picture: keep your server software updated, use strong unique passwords for every account, turn on two-factor authentication wherever it is offered, and never put secrets such as API keys into your code or your Git repository. These habits are simple, they cost nothing, and they prevent the great majority of attacks on small sites.

Going live and checking your work

When you deploy, follow a short checklist. Push your latest code to Git, so the host deploys the version you tested. Wait for the host to report that the deploy succeeded, and read the logs if it did not, because the error message usually names the problem. Visit the live site in a private browser window, which ignores your cached files, and click through every page, submit every form, and check the site on a phone. Then ask a friend to visit it, because fresh eyes catch what you have stopped seeing, and check the site again the next day, because DNS and caching can hide problems on the first visit. If something breaks, the fix is usually small: a file with the wrong capitalisation, a link pointing at localhost, or a missing file that worked on your computer but never got uploaded. Fix it, commit, push, and deploy again.

Key Terms

Deployment
Putting a project on a server so anyone can visit it.
Host
A company that rents you space on a server to publish a website.
Domain name
A human-readable name for a server, such as alpha.unb.college, rented from a registrar.
DNS record
A line in a domain's settings saying which server a name points to.
HTTPS
The encrypted version of HTTP, which protects data between a visitor and a site.
Let's Encrypt
A free service that provides the certificates needed for HTTPS.
Cache
A stored copy of a file, which can make a browser show an old version of a page.

Discussion Questions

  1. Why is it risky to host a site by uploading files by hand with no version control?
  2. DNS changes can take hours to spread. Why is that, and what should you do while you wait?
  3. Why do browsers warn visitors about sites without HTTPS, and what does that mean for your site?

Practice Questions

  1. What is the difference between a host and a domain name?
  2. Why must every site you publish use HTTPS?
  3. What is a DNS record, and what does an A record do?
  4. Why should you visit a newly deployed site in a private browser window?
  5. A live site is missing an image that worked on your computer. What is the most likely cause?
Show answers
  1. A host rents you space on a server; a domain name is the address visitors use to find it. You need both, and DNS connects the name to the server.
  2. It encrypts the connection so data cannot be read on the way. Browsers warn visitors about sites without it, and most hosts now provide it automatically.
  3. It is a line in a domain's settings saying where a name points. An A record points a name at an IP address.
  4. Because a private window ignores cached files. Your normal window may show an old copy, hiding problems with the new version.
  5. The file was never uploaded, or its name has different capitalisation. Servers treat capital letters as different from lowercase, unlike some personal computers.
Keep reading to complete this lesson