You installed Ubuntu Server. Now what? The terminal is your desktop. Every command you run happens over SSH. No mouse. No context menu. Just a prompt and a blinking cursor.
This guide covers the commands you’ll use every day. Not everything Linux can do. The 20% that gets you 80% of the way.
Method 1: Getting Around
The File System
Linux has no C: drive. Everything starts at /.
/ - root. top of everything
/home - your files live here (/home/youruser)
/etc - config files (/etc/nginx, /etc/ssh)
/var - data that changes (logs in /var/log, databases in /var/lib)
/tmp - temp files. deleted on reboot.
/opt - optional software. Docker volumes often go here.
Your home directory is /home/youruser. That’s ~ for short. You spend most of your time here.
Navigation
pwd # where am I?
ls # what's in this directory?
ls -la # same, but show hidden files and details
cd /etc/nginx # go to a directory
cd ~ # go home
cd .. # go up one level
ls -la is the most useful command you’ll learn. The -l flag shows permissions, owner, size, date. The -a flag shows hidden files (they start with a dot).
Reading Files
cat file.txt # print the whole file
less file.txt # scroll through it (q to quit)
head -n 20 file.txt # first 20 lines
tail -n 20 file.txt # last 20 lines
tail -f file.txt # watch new lines appear (Ctrl+C to stop)
tail -f is how you watch logs in real time. When something is broken, this is your first stop.
Editing Files
You need a text editor. Nano is already installed and works over SSH:
nano /etc/nginx/nginx.conf
Arrow keys to move. Type to edit. Ctrl+O to save. Ctrl+X to exit.
That’s enough for now. If you find yourself editing configs daily, learn Vim. If not, stick with Nano.
File Operations
cp source.txt dest.txt # copy
mv old.txt new.txt # rename or move
rm file.txt # delete (no trash bin)
rm -rf directory/ # delete a directory and everything in it
mkdir newdir # create a directory
mkdir -p a/b/c # create nested directories
rm -rf is dangerous. Triple check before you run it. There is no undo.
Permissions
Every file has an owner and a permission set:
-rw-r--r-- 1 root root 1234 Apr 15 10:00 config.yml
The first character is type (- = file, d = directory). Then three groups of three: owner, group, everyone.
rw- means read and write. r-- means read only. --- means nothing.
Common permission commands:
chmod 600 file # owner can read+write, nobody else
chmod 755 file # owner can do everything, others can read+execute
chown user:group file # change owner and group
For config files that contain passwords:
chmod 600 ~/docker-services/.env
Getting Help
command --help # quick reference
man command # full manual (q to quit)
Run man ls and you get the complete documentation for ls. Press q to exit the manual.
Method 2: Managing Services
systemd
Ubuntu uses systemd to manage services. When you install something like Nginx or Docker, systemd keeps it running.
systemctl status nginx # is it running?
systemctl start nginx # start it
systemctl stop nginx # stop it
systemctl restart nginx # restart (after config change)
systemctl enable nginx # start on boot
systemctl disable nginx # don't start on boot
Check if a service is running with status. If it shows “active (running)”, you’re good. If “failed”, something is wrong.
journalctl -u nginx # see the service's logs
journalctl -u nginx --since "1 hour ago"
Processes
ps aux # all running processes
top # live view of processes (q to quit)
htop # nicer version of top (install with apt)
ps aux | grep docker shows you all processes with “docker” in the name. The pipe (|) sends output from one command to another. grep filters for matching lines.
Disk
df -h # disk space (human readable)
du -sh ~/docker-services/ # size of a directory
Run df -h weekly or put it in your head. A full disk causes more failures than any other single issue.
Network
ip addr show # your IP addresses
ip link show # network interfaces
ping 8.8.8.8 # can you reach the internet?
ss -tulpn # what ports are listening?
ss -tulpn shows every service accepting connections. Run it when a port doesn’t work and you’ll see whether the service is listening at all.
Package Management
Ubuntu uses apt:
sudo apt update # refresh package list
sudo apt install htop # install something
sudo apt remove htop # uninstall
sudo apt upgrade # update everything
sudo apt autoremove # clean up unused packages
Run sudo apt update && sudo apt upgrade regularly. Security patches come through here.
Docker-Specific
docker ps # running containers
docker ps -a # all containers
docker logs -f container-name # watch container logs
docker restart container-name # restart a container
docker system df # how much disk Docker is using
Docker containers restart with docker compose restart or docker restart <name>. Docker itself restarts with sudo systemctl restart docker.
Your Daily Routine
SSH into your server:
ssh youruser@192.168.1.100
Check what’s running:
htop
Check disk space:
df -h
Check Docker:
docker ps
Check for updates:
sudo apt update && sudo apt upgrade
That’s five commands. Takes 30 seconds. You now know the health of your server.
When something breaks, start here:
systemctl status <service>- is it running?journalctl -u <service> --since "10 min ago"- what does the log say?tail -f /var/log/syslog- what is the system doing right now?df -h- is the disk full?
9 times out of 10, those four commands tell you the problem.
Next Steps
You can navigate, edit files, and manage services. That’s most of what Linux asks of you. Next: monitor your new skills with Setting Up Monitoring.