💻 Ubuntu Server Installation & Linux Basic Commands | Full Tutorial 🐧⚙️

0
💻 Ubuntu Server Installation & Linux Basic Commands | Full Tutorial 🐧⚙️
Linux Masterclass

💻 Ubuntu Server Installation & Linux Basic Commands | Full Tutorial 🐧⚙️

Master Linux from scratch! In Part 1, learn to install Ubuntu Server step‑by‑step. In Part 2, explore essential Linux commands every beginner must know — from file navigation to system monitoring.

🐧 Ubuntu Server 📂 Linux Commands ⚙️ Terminal 📚 A to Z
Part 1 – Step 1

Downloading the Ubuntu Server ISO 📥

The first step is to get the official Ubuntu Server installation image. This is a free download directly from Canonical (the company behind Ubuntu).

  1. Visit ubuntu.com/download/server — Go to ubuntu.com/download/server. The site automatically detects the latest LTS (Long Term Support) version, which is recommended for stability — currently Ubuntu 24.04 LTS.
  2. Choose the ISO — Click the big "Download Ubuntu Server" button. The ISO file is approximately 2.6 GB. You can also use the torrent link for faster download.
  3. Verify the Checksum (Optional but Recommended) — After downloading, verify the file integrity using PowerShell (Windows) or Terminal (macOS/Linux) to ensure the ISO isn't corrupted.
Verify SHA256 Checksum
# Windows (PowerShell)
Get-FileHash .\ubuntu-24.04-live-server-amd64.iso -Algorithm SHA256

# macOS / Linux
shasum -a 256 ubuntu-24.04-live-server-amd64.iso

# Compare the output with the checksum on the Ubuntu website
Which Version to Choose? Always pick the LTS (Long Term Support) version for servers. It receives security updates for 5 years and is more stable than interim releases.
Step 2

Creating a Bootable USB Drive 💽

You'll need a USB flash drive (at least 8 GB) and a tool to write the ISO. Here are the best free options for each operating system:

  • 🪟 Windows: Use Rufus (rufus.ie). It's fast, reliable, and automatically detects the correct settings for Ubuntu. Select the ISO, choose your USB drive, and click Start. Accept the prompt to write in ISO mode.
  • 🍎 macOS: Use balenaEtcher (etcher.balena.io). It's a simple 3‑step process: select ISO, select drive, flash.
  • 🐧 Linux: Use the Startup Disk Creator (built into Ubuntu) or the dd command.
Linux: Create Bootable USB with dd
# Identify your USB drive (e.g., /dev/sdb)
sudo fdisk -l

# Write the ISO (replace /dev/sdX with your USB drive)
sudo dd if=ubuntu-24.04-live-server-amd64.iso of=/dev/sdX bs=4M status=progress

# ⚠️ WARNING: Double-check the drive letter! dd overwrites everything.
Data Loss Warning Creating a bootable USB will erase all existing data on the flash drive. Back up any important files before proceeding.
Step 3

Step‑by‑Step Ubuntu Server Installation ⚙️

Insert the USB drive into your target machine and boot from it (you may need to change the boot order in BIOS/UEFI by pressing F2, F12, DEL, or ESC during startup).

  1. Select Language: Choose your preferred language. English is recommended for server environments.
  2. Keyboard Configuration: Accept the default or select your layout. Use the "Detect Keyboard Layout" option if unsure.
  3. Choose Installation Type: Select "Ubuntu Server" (not minimized). For most users, the default installation is perfect.
  4. Network Configuration: The installer detects your network card. If you're connected via Ethernet, it should auto‑configure via DHCP. You'll see your assigned IP address.
  5. Proxy Configuration: Leave blank unless you're behind a corporate proxy.
  6. Storage Configuration: Choose "Use an entire disk" (or LVM for advanced setups). Select the target disk and confirm. This erases the disk!
  7. Confirm Installation: Review the summary and click "Continue". The base system will install in 5‑10 minutes.
LVM Option If you plan to resize partitions later, choose LVM (Logical Volume Manager). It adds flexibility but slightly increases complexity. Beginners can skip it.
Step 4

Setting Up Users, Passwords & Basic Network 🔑

After the base installation, you'll configure your user account and optional SSH access:

  1. Create Your Profile: Enter your full name, server name (hostname), username, and a strong password. This user will have sudo (administrator) privileges.
  2. Ubuntu Pro (Optional): Skip this unless you need enterprise support. The free tier is sufficient for learning and personal projects.
  3. Install OpenSSH Server: Check the box to "Install OpenSSH server". This allows you to remotely manage your server via SSH. Highly recommended!
  4. Reboot: Once installation completes, remove the USB drive and reboot. Your server will boot into the command‑line interface.

Basic Network Check After Login:

Check Network & Update
# Check your IP address
ip addr show

# Test internet connectivity
ping -c 4 google.com

# Update package lists
sudo apt update

# Upgrade all installed packages
sudo apt upgrade -y
Pro Tip Set a static IP for your server if you plan to run services (web, database, etc.). Edit the Netplan configuration: sudo nano /etc/netplan/00-installer-config.yaml.
Part 2 – Commands

How to Navigate the Linux File System 📂

The Linux file system is a tree structure starting at the root /. Here are the essential navigation commands:

File Navigation Commands
# Show current directory
pwd

# List files and folders
ls -la        # -l: detailed view, -a: show hidden files

# Change directory
cd /home       # Go to /home
cd ..           # Go up one level
cd ~            # Go to your home directory
cd -            # Go to the previous directory

# Show directory structure
tree           # Install with: sudo apt install tree

Key directories to know:

  • / – Root directory (everything starts here).
  • /home – User home directories.
  • /etc – Configuration files.
  • /var – Variable data (logs, databases).
  • /tmp – Temporary files (cleared on reboot).
Commands

Creating, Editing & Deleting Files and Directories 📝

Mastering file operations is essential. Here's everything you need:

File & Directory Operations
# Create an empty file
touch myfile.txt

# Create a directory
mkdir myfolder
mkdir -p parent/child   # Create nested directories

# Copy files and directories
cp source.txt dest.txt
cp -r folder/ newfolder/   # Copy recursively

# Move or rename files
mv oldname.txt newname.txt
mv file.txt /home/user/

# Delete files and directories
rm file.txt
rm -r folder/          # Delete folder and contents
rm -rf folder/         # Force delete (use with caution!)

# View file contents
cat file.txt            # Display entire file
less file.txt           # View with scrolling (q to quit)
head -n 20 file.txt     # First 20 lines
tail -f log.txt         # Follow live log updates

Quick text editing: Use nano (beginner‑friendly) or vim (advanced). To edit a file: nano filename.txt. Save with CTRL+O, exit with CTRL+X.

Be Careful with rm -rf There's no trash bin in the terminal. Once you delete something with rm, it's gone forever. Always double‑check before pressing Enter.
Commands

Searching for Files, Text & Directories 🔍

Linux has powerful built‑in search tools that rival any desktop search:

Search Commands
# Find files by name
find /home -name "*.txt"           # All .txt files in /home
find . -type d -name "backup"       # Find directories named "backup"

# Find files by size
find / -size +100M                  # Files larger than 100 MB

# Search text inside files
grep -r "searchterm" /path/          # Recursive search
grep -i "error" log.txt             # Case‑insensitive

# Locate files (faster, uses database)
locate myfile.txt                   # Update DB first: sudo updatedb

# Find commands / programs
which python3                        # Show full path to command

Quick tip: Use grep with pipes to filter output. Example: ls -la | grep ".txt" lists only text files.

Commands

Managing Permissions & Ownership 🔐

Linux permissions control who can read, write, or execute files. Each file has an owner, a group, and others.

Permission & Ownership Commands
# View permissions
ls -l                    # Shows permissions like -rwxr-xr--

# Change permissions (symbolic)
chmod u+x script.sh       # Add execute for user
chmod go-w file.txt       # Remove write for group & others

# Change permissions (numeric – common)
chmod 755 script.sh       # rwxr-xr-x (owner full, others read+execute)
chmod 644 file.txt        # rw-r--r-- (owner read/write, others read‑only)
chmod 600 secret.key      # rw------- (only owner can read/write)

# Change owner and group
chown user:group file.txt   # Change owner and group
chown -R user:group folder/   # Recursively change ownership

Understanding numeric permissions: Read=4, Write=2, Execute=1. Add them: 7=rwx, 6=rw, 5=rx, 4=r. For example, 755 means owner rwx, group rx, others rx.

Commands

Viewing System Information & Processes 📊

Monitor your server's health, running processes, and resource usage:

System Monitoring Commands
# System information
uname -a                  # Kernel version and system info
lsb_release -a           # Ubuntu version details
hostnamectl              # Hostname and OS details

# Disk usage
df -h                    # Show disk space (human readable)
du -sh /home/*           # Size of each home directory

# Memory usage
free -h                   # RAM and swap usage

# Process management
top                       # Live process monitor (q to quit)
htop                      # Prettier top (install: sudo apt install htop)
ps aux                   # List all running processes
kill 1234                 # Terminate process with PID 1234
kill -9 1234              # Force kill a stubborn process
Pro Tip Install htop and neofetch for a more visual and informative terminal experience. sudo apt install htop neofetch -y then run neofetch to see your system summary in style.
Summary

Tips to Work Faster & Final Checklist ✅

Power user shortcuts for the terminal:

Terminal Shortcuts
TAB        → Auto‑complete commands and file names
CTRL + C   → Cancel current command
CTRL + L   → Clear the screen
CTRL + R   → Search command history
CTRL + A   → Jump to start of line
CTRL + E   → Jump to end of line
!!         → Repeat the last command
history    → Show command history
  • Downloaded Ubuntu Server ISO and verified checksum
  • Created a bootable USB drive with Rufus/Etcher/dd
  • Installed Ubuntu Server with SSH enabled
  • Set up user account and tested sudo access
  • Ran sudo apt update && sudo apt upgrade
  • Practiced ls, cd, pwd, mkdir, touch, cp, mv, rm
  • Tried cat, less, head, tail, nano for file viewing/editing
  • Used find and grep to search files and text
  • Practiced chmod, chown for permissions
  • Monitored system with top, htop, df, free

Key Takeaways

Ubuntu Server ISO is free from ubuntu.com
Rufus (Win) / Etcher (Mac) / dd (Linux) for USB
Install with SSH enabled for remote management
Master ls, cd, pwd, mkdir, cp, mv, rm first
find & grep are powerful search tools
Practice daily — the terminal becomes second nature

🐧 Ready to Master Linux?

Set up your Ubuntu Server today and practice these commands. The more you use the terminal, the more confident you'll become. Bookmark this guide and refer back to it as you learn!

Post a Comment

0 Comments

Join the tech debate...
We love a good discussion, but please keep it respectful and relevant to the topic. Vulgarity, personal attacks, and spam will be removed. Let’s keep the community smart, helpful, and welcoming to all tech fans!

Join the tech debate...
We love a good discussion, but please keep it respectful and relevant to the topic. Vulgarity, personal attacks, and spam will be removed. Let’s keep the community smart, helpful, and welcoming to all tech fans!

Post a Comment (0)
To Top