Sikau

Linux and the shell · Day 15 · about 40 min

Running a server

apt, systemctl, journalctl, disk space, cron and SSH keys.

Your first server

A fresh Ubuntu server needs software installed, services started and kept running, logs checked, disk watched and jobs scheduled. These are the daily commands of anyone who deploys web apps.

The admin toolkit

sudo apt update
sudo apt install -y htop jq
systemctl status nginx
sudo systemctl restart nginx
sudo systemctl enable app
systemctl is-active app
sudo journalctl -u app -n 3
df -h
du -sh /var/log
free -h
curl -s localhost:3000/api/health
ssh-keygen -t ed25519
cat ~/.ssh/id_ed25519.pub
echo "0 3 * * * /home/learner/backup.sh" > jobs
crontab jobs
crontab -l

The rest of this lesson

  • A systemd service for your appexplain
  • Logs and disk spaceexplain
  • Read the schedulepredict
  • Which command?match
  • Your turnwrite code
  • Badge quizquiz
  • What you learnedrecap

Continue this lesson free — run real code in your browser

Continue with Google

See all 16 lessons of Linux and the shell