← Servers, deploying and APIs

Lesson 10 of 20 · Try it · 30 min

2.3 Hands-on: a web server and your first page

You'll install nginx and put your own page on your server.

Steps (logged in as your own user, from Module 1)

  1. Take a backup first: Servers → Backups → Take a backup now.
  2. Install nginx:
sudo apt update
sudo apt install nginx -y
  1. On your laptop, open http://<your IP> in a browser. You'll see Welcome to nginx! Your server is serving a web page.
  2. Make your own page. Open the editor nano:
sudo nano /var/www/html/index.html
  1. Type a short page, for example:
<!doctype html>
<html>
  <head><meta charset="utf-8"><title>Kwesi Builds</title></head>
  <body>
    <h1>Kwesi Builds</h1>
    <p>I set businesses up on Lynk. Call 024 000 0000.</p>
  </body>
</html>
  1. Save with Ctrl + O, press Enter, then exit with Ctrl + X.
  2. Refresh http://<your IP> in your browser. Your page is on the internet.

If it doesn't work

  • The page doesn't open: check the server is Active, and that you typed http://, not https:// (there's no certificate yet).
  • You still see Welcome to nginx: refresh with Ctrl + Shift + R, and check you saved the file as index.html.

Check your work: your own page shows at http://<your IP>.

Try it in Lynk

Now do it yourself. When you're done, come back here and mark this lesson done.

Sign in to try it
Next lesson

Sign in to save your progress and earn the certificate.

2.2 Move a Lynk website onto your server