techlogia — AI and Web Development Berlin
All courses
Free to read – no sign-up

Deploy a live website with HTTPS

Within an hour you'll get your own website online — with a valid HTTPS certificate from Let's Encrypt, your own subdomain, and real nginx. You'll edit HTML, check nginx config, and trigger certbot. At the end you can share the link — it stays live as long as the lab session runs (max. 60 minutes).

Duration: 30 minLevel: BeginnerExercises: 4

Your own page with a Let's Encrypt cert

Deploy a live website with HTTPS

In this module you put a real website online within an hour — with a valid HTTPS certificate. You edit HTML, check the nginx configuration, and fetch a certificate from Let's Encrypt via certbot.

Key terms

  • Let's Encrypt: a free, automated certificate authority (CA) that issues real, browser-trusted certificates.
  • certbot: the tool that fetches the Let's Encrypt certificate and installs it into nginx.
  • HTTP-01 challenge: Let's Encrypt verifies over port 80 that you really own the domain — that's why HTTP must work first.

Your goal

Get nginx running on HTTP, customise the homepage, obtain a TLS certificate, and verify that HTTPS responds. The link is live as long as the lab session runs.

Exercises

  1. 1. nginx answers on HTTP

    Concept: HTTP reachability. The first step of any deploy pipeline: is a web server even responding? Without 200 OK on port 80, the HTTPS pipeline can't run later either (Let's Encrypt needs port 80 for the challenge).

    Make sure nginx is running and check:

    sudo systemctl enable --now nginx
    curl -sI http://localhost/

    Getting 502? Then look at sudo systemctl status nginx.

    Check: curl -sI http://localhost/ returns an HTTP/... 200 status line.

  2. 2. Customize index.html

    Concept: document root. nginx serves files from a directory — the document root (/var/www/lab/). The homepage is index.html. Make it your own.

    Edit /var/www/lab/index.html (sudo nano /var/www/lab/index.html) and add the title:

    <h1>Meine erste eigene Webseite</h1>

    Check: /var/www/lab/index.html contains the text Meine erste eigene Webseite.

  3. 3. HTTPS certificate retrieved

    Concept: certbot & automatic configuration. certbot with the nginx plugin fetches the certificate and writes it into the nginx config automatically (the ssl_certificate line then points to /etc/letsencrypt/live/...).

    Obtain the certificate for your lab domain (certbot asks for it or uses the prepared one):

    sudo certbot --nginx --non-interactive --agree-tos -m student@example.com

    certbot also sets up the HTTP→HTTPS redirect.

    Check: /etc/nginx/sites-enabled/lab-deploy.conf contains ssl_certificate /etc/letsencrypt/live/....

  4. 4. HTTPS responds with 200 OK

    Concept: final check. Does nginx now really speak TLS and serve your page over HTTPS? 301/302 (HTTP→HTTPS redirect) also count as success.

    curl -sIk https://localhost/

    -k ignores the cert hostname mismatch (the cert is for your lab domain, not "localhost"). Getting "Failed to connect to port 443"? Then certbot hasn't finished yet.

    Check: curl -sIk https://localhost/ returns HTTP/... 200, 301 or 302.

Now practice it yourself

Reading is good – doing is better. Start this course on a real Linux VM, right in your browser. A free account is all it takes.

Start for free

Lab content under CC BY 4.0 – free to use with attribution (© TechLogia).

Deploy a live website with HTTPS