BM: Baca dalam Bahasa Melayu
World L4: Remote Kitchens
Capstone mission 7: A server from scratch
You will learn: to set up a real server yourself: a user, a key, a firewall, nginx, a script and a timer.
Checked with Linux (Debian 13) on 1 Nov 2026
The problem
Mission 7: open a new branch kitchen, from an empty machine. First, plan the build. Put the jobs in a safe order.
First job at the top. Put these in order. Use the arrows, or drag.
- Firewall: allow SSH and web, then switch it on
- Update the packages
- nginx with your own page
- Add your own user with sudo
- A systemd timer for the script
- Test from your laptop
- Log in with an SSH key
- A backup script in strict mode
Watch
Real servers, real risks. Good rule or not?
Swipe right for good, left for needs work. Or use the buttons.
Use a throwaway VM or playground, never a work server.
Watch
Your backup script. Which line makes it stop at the first problem?
#!/bin/bash
set -euo pipefail
src="$HOME/kedai/menu"
dest="$HOME/backups"
mkdir -p "$dest"
cp -r "$src" "$dest/menu-$(date +%F)"
echo "backup done"Pick one answer.
Watch
The timer starts a service. Save this as /etc/systemd/system/kedai-backup.service, with your own user. Tap the line that runs the script.
Tap the line that runs the script.
0 of 1 found
Try it
Now build it for real. Your ticks are saved. Replace aina and SERVER-IP with your own.
Real mission
sudo apt update && sudo apt upgrade -ysudo adduser aina && sudo usermod -aG sudo ainassh-copy-id aina@SERVER-IPsudo apt install -y ufw nginxsudo ufw allow OpenSSH && sudo ufw allow 'Nginx HTTP'sudo ufw enable && sudo ufw statusecho '<h1>Kedai Kancil, branch 2</h1>' | sudo tee /var/www/html/index.htmlmkdir -p ~/kedai/menu && echo 'nasi lemak 5' > ~/kedai/menu/today.txtchmod +x ~/backup.sh && ~/backup.shsudo systemctl daemon-reload && sudo systemctl enable --now kedai-backup.timersystemctl list-timers kedai-backup.timer
0 of 14 steps done · Your ticks are saved.
Check
GitHub can see your files. Type your username and press Check now.
Check it on GitHub
- Your server-from-scratch repo is publicNot checked yet
- It has backup.shNot checked yet
- It has kedai-backup.serviceNot checked yet
- It has kedai-backup.timerNot checked yet
Check
The rest only you can see. Tick what is true.
Self-check
0 of 6 steps done · Your ticks are saved.
You did it!
You can now set up a small, safe Linux server from an empty machine.
Go deeper (optional)
Where the story breaks: a real branch kitchen has staff who smell smoke. A server notices nothing unless you add checks. The Monitoring & Observability course adds the smoke alarms. Later, harden SSH: turn off password logins, but only after your key login works.
Bahasa Melayu
Misi 7: buka dapur cawangan baharu, dari mesin kosong. Mula-mula, rancang binaannya. Susun kerja ikut tertib yang selamat.
Server sebenar, risiko sebenar. Peraturan yang baik atau tidak?
Skrip sandaran anda. Baris mana yang buat ia berhenti pada masalah pertama?
#!/bin/bash
set -euo pipefail
src="$HOME/kedai/menu"
dest="$HOME/backups"
mkdir -p "$dest"
cp -r "$src" "$dest/menu-$(date +%F)"
echo "backup done"
Timer memulakan satu servis. Simpan ini sebagai /etc/systemd/system/kedai-backup.service, dengan pengguna anda sendiri. Tekan baris yang jalankan skrip.
Sekarang bina betul-betul. Tanda anda disimpan. Tukar aina dan SERVER-IP kepada milik anda.
GitHub boleh lihat fail anda. Taip nama pengguna anda dan tekan Semak sekarang.
Selebihnya hanya anda boleh lihat. Tanda yang benar.
Kini anda boleh sediakan server Linux kecil yang selamat dari mesin kosong.
You finished this before. Practice is always welcome!
Official docs: Debian Reference: system tips · Debian: ufw(8) · systemd.timer · nginx: beginner's guide
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?