Let’s get Started with Ubuntu:Setup & Commands
— ny_wk

Disclosure: some links above are affiliate links — if you buy through them I may earn a small commission at no extra cost to you. Thanks for supporting the channel!
Ready to dive into the world of open-source computing? Setting up Ubuntu, a powerful and user-friendly Linux distribution, is your first step towards mastering a versatile operating system that's a cornerstone for developers and DevOps engineers alike. This comprehensive guide will walk you through the complete Ubuntu setup, from downloading the ISO to configuring your environment, and then empower you with essential Ubuntu commands to navigate and manage your system like a pro.
Understanding Ubuntu: The Soul of Open Source
Yaar, before we even start the installation, let's understand kya cheez hai Ubuntu. You know, the name itself, "Ubuntu," is an ancient African word meaning 'humanity to others' or 'I am what I am because of who we all are.' This philosophy isn't just a fancy name; it's deeply embedded in the project's DNA. The goal has always been to make software freely accessible to everyone, regardless of language, disability, or income.
In the tech world, Ubuntu is a Debian-based Linux operating system that's become incredibly popular. Why? Because it strikes a fantastic balance between power, stability, and user-friendliness. From your desktop to massive cloud servers, Ubuntu is everywhere. It's the go-to platform for containers like Docker and Kubernetes, powers millions of PCs, and is the most popular OS across public and OpenStack clouds. Canonical Ltd. leads its development, generating revenue through support services, ensuring the project remains sustainable while staying true to its open-source principles.
When we talk about "free" software, especially in the context of Ubuntu, it's not just about the cost (though it is completely free to download and use!). It's also about freedom. Unlike proprietary systems like Windows or macOS, you get the freedom to edit its code, install as many copies as you want, and distribute the program as you please. This 'freedom' is what we call "free as in speech," not just "free as in beer." This open, collaborative spirit fosters innovation and security, making it a natural fit for the DevOps philosophy of shared responsibility and transparency.
Canonical releases new Ubuntu versions regularly. There are two main types:
- Standard Releases: These come out every six months and offer the latest features and software. They are supported for nine months. Good for folks who want to try out cutting-edge tech.
- Long Term Support (LTS) Releases: These are published every two years and are supported for five years (or even longer with extended maintenance). For serious work, especially in production environments or for your daily driver, LTS releases are the way to go. They offer unparalleled stability and reliability.
As a DevOps engineer, you'll almost always deal with LTS versions because stability is paramount. Currently, Ubuntu 22.04 LTS "Jammy Jellyfish" is a prime example of a robust, widely adopted LTS release, and we'll focus our setup on this version. The latest LTS release, Ubuntu 24.04 LTS "Noble Numbat", is also available, offering even newer features and extended support.
Preparing for Your Ubuntu Journey: System Requirements & Installation Media
The first step, boss, is to make sure your machine is ready for Ubuntu. It's not a very demanding OS, but having decent specs always helps, especially when you're running multiple dev tools or virtual machines.
Minimum System Requirements for Ubuntu 22.04 LTS:
- Processor: 2 GHz dual-core processor (or better).
- RAM: 4 GB system memory. Frankly speaking, if you plan to do any serious development, 8 GB or more is highly recommended for a smoother experience, especially when running IDEs, browsers, and Docker containers simultaneously.
- Hard Drive Space: 25 GB of free hard disk space. Again, for a dev machine, aim for at least 100 GB to accommodate your projects, tools, and logs.
- Bootable Media: A USB port (preferred) or a DVD drive.
- Internet Access: Optional during installation, but highly recommended for downloading updates and third-party software right away.
Downloading the Ubuntu ISO File
The Ubuntu installation starts with downloading the ISO file. This is essentially a digital disk image of the operating system.
- Go to the official Ubuntu website: ubuntu.com/download/desktop.
- Look for the latest LTS version (e.g., Ubuntu 22.04 LTS). Click on the download button.
- Once downloaded, it's a good practice to verify the integrity of the ISO file using its checksum. This ensures the file hasn't been corrupted during download or tampered with. You'll usually find the SHA256 checksum on the download page.
Creating Bootable Installation Media
Once you have the ISO, you need to "burn" it to a USB drive or DVD to make it bootable. USB drives are generally faster and more convenient.
For Windows Users:
The most popular tools are Rufus or BalenaEtcher.
- Rufus: Download Rufus, plug in your USB drive (at least 8GB), select the Ubuntu ISO, and click 'Start'. It's pretty straightforward.
- BalenaEtcher: This is an excellent cross-platform tool. Download and install it, select your ISO, select your USB drive, and click 'Flash!'. It's very user-friendly.
For macOS Users:
BalenaEtcher is your best bet. Follow the same steps as for Windows. Alternatively, you can use the built-in `dd` command in the terminal, but be extremely careful as `dd` can wipe the wrong disk if you make a mistake.
For Linux Users:
You can use BalenaEtcher, or the `dd` command in your terminal.
# First, identify your USB drive (e.g., /dev/sdX, where X is your drive letter)
lsblk
# Unmount the USB drive if it's mounted
sudo umount /dev/sdXn # Replace X and n with your drive and partition number
# Write the ISO to the USB drive (replace /path/to/ubuntu.iso and /dev/sdX)
sudo dd if=/path/to/ubuntu.iso of=/dev/sdX bs=4M status=progress
Important: Double-check the `of` parameter in the `dd` command! Using the wrong device can erase your entire hard drive.
Step-by-Step Ubuntu 22.04 LTS Installation Guide
Alright, USB drive ready, coffee in hand? Let's get this party started! Make sure your target machine (laptop or desktop) is powered off. Plug in your bootable USB drive.
Step 1: Boot from the USB Drive and Enter BIOS/UEFI Settings
Power on your computer and immediately start pressing the key to enter your BIOS/UEFI settings or the boot menu. This key varies by manufacturer (common keys are F2, F10, F12, DEL, or ESC). Once in, navigate to the "Boot" section and change the boot order to prioritize your USB drive. In some modern systems, you might need to disable "Secure Boot" or enable "Legacy Mode" if you encounter issues, especially with older hardware or specific graphics cards.
Step 2: Choose "Try Ubuntu" or "Install Ubuntu"
After booting from the USB, you'll see a GRUB menu. You have two main options:
- Try Ubuntu: This loads Ubuntu into a live environment without installing it. It's great for testing if your hardware is compatible, browsing the web, or recovering data from a damaged system. You can even initiate the installation from within the live environment.
- Install Ubuntu: This directly starts the installation process.
For our purposes, let's select "Install Ubuntu" to proceed with the setup.
Step 3: Select Language and Keyboard Layout
The installer will ask you to choose your preferred language. Select English (or your language) and click "Continue." Next, select your keyboard layout. The installer usually defaults to a suitable layout, but confirm it or test it in the provided text field.
Step 4: Prepare to Install Ubuntu
This is an important screen, mere dost.
- Installation Type:
- Normal installation: This includes a web browser, office suite (LibreOffice), media players, and other essential desktop utilities. Recommended for most users.
- Minimal installation: This provides a basic desktop environment with only a web browser and core utilities. You'll install everything else manually. Good for lightweight setups or if you want absolute control over your software.
- Other options:
- Download updates while installing Ubuntu: Highly recommended. This saves time post-installation.
- Install third-party software for graphics and Wi-Fi hardware and additional media formats: Absolutely crucial! This includes proprietary drivers for your graphics card (NVIDIA, AMD), Wi-Fi adapters, and codecs for playing MP3s, videos, etc. Always tick this box unless you have a very specific reason not to.
Click "Continue."
Step 5: Choose Your Installation Type (Partitioning)
This is where things can get a little tricky, especially if you're dual-booting or have multiple drives. Backups are your best friend here!
Option A: Erase disk and install Ubuntu (Simplest)
If you're dedicating the entire disk to Ubuntu, this is the easiest option. The installer will automatically create the necessary partitions. Warning: This will erase ALL data on the selected disk. Ensure you've backed up anything important!
Option B: Install Ubuntu alongside Windows Boot Manager (Dual-boot)
If Windows is already installed, the installer might detect it and offer to install Ubuntu next to it. It will provide a slider to resize your existing Windows partition to make space for Ubuntu. This is a common choice for beginners wanting to experience Linux without fully committing. Remember to back up your Windows drive before attempting this.
Option C: Something else (Manual Partitioning - For Advanced Users)
This option gives you full control over partitioning. You'll typically want to create a few partitions:
- Root partition (
/): Where the main operating system files reside. Mount point:/. Recommended size: 20-50 GB (or more). Format: Ext4. - Home partition (
/home): Stores your user's personal files, documents, downloads, and configurations. Keeping/homeseparate makes it easy to reinstall Ubuntu without losing your personal data. Mount point:/home. Recommended size: As much as you can spare. Format: Ext4. - Swap area: Used as virtual memory when RAM is full. Traditionally, it was 1-2x your RAM, but with modern systems and large RAM, a smaller swap (e.g., 4-8 GB) or even a swap file is often sufficient. If you plan to hibernate, make it at least as large as your RAM.
- EFI System Partition (ESP): If your system uses UEFI, you'll need a small FAT32 partition (100-500 MB) mounted as
/boot/efi. This is usually already present if Windows is installed.
For beginners, 'Erase disk and install Ubuntu' or 'Install alongside Windows' is recommended.
After making your choice, click "Install Now" and confirm the changes.
Step 6: Select Your Location and Create User
Choose your geographical location on the map. This sets your timezone. Then, create your user account:
- Your Name
- Your Computer's Name (hostname)
- Pick a Username
- Choose a strong password and confirm it. This is super important for security!
- You can choose to log in automatically or require a password at startup. Requiring a password is more secure.
Click "Continue."
Step 7: Installation Process
Now, sit back and relax, have some chai. The installer will copy files, install the system, and configure everything. This can take anywhere from 15 minutes to an hour, depending on your hardware and internet speed. Once complete, you'll be prompted to restart your computer. Remove the USB drive when instructed, and press Enter.
Mubarak ho! You've successfully installed Ubuntu!
First Steps Post-Installation: Setting Up Your Dev Environment
Your Ubuntu desktop is shiny and new, but like a fresh canvas, it needs a few strokes to become a masterpiece. These initial steps are crucial for any DevOps engineer to get their environment ready.
1. Update and Upgrade Your System
Even if you downloaded updates during installation, it's always good practice to run a full update and upgrade immediately after the first boot. This ensures all your packages are the latest, patched versions.
sudo apt update # Refreshes the list of available packages
sudo apt upgrade # Installs newer versions of installed packages
sudo apt dist-upgrade # Handles dependency changes, useful for major upgrades
The `sudo` command is your friend; it lets you run commands with superuser (administrator) privileges. You'll be using it a lot.
2. Install Build Essentials
For any kind of development, you'll need compilers, libraries, and tools. The `build-essential` package bundles many of these.
sudo apt install build-essential
3. Install an SSH Server (for Remote Access)
If you ever plan to connect to your Ubuntu machine remotely (which you absolutely will as a DevOps engineer, even if it's your desktop!), install OpenSSH server.
sudo apt install openssh-server
You can check its status with `sudo systemctl status ssh` and enable it to start on boot with `sudo systemctl enable ssh`.
4. Set Up Git
Git is indispensable for version control.
sudo apt install git
After installation, configure your user name and email:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
5. Explore Snap and Flatpak (Modern Package Management)
Beyond `apt`, Ubuntu supports Snaps, a universal package format. Flatpak is another similar system. They bundle applications and their dependencies, making them easier to install and run across different Linux distributions. Many modern applications are available as Snaps or Flatpaks.
For example, to install Visual Studio Code (often a snap):
sudo snap install code --classic
Flatpak support can be added easily:
sudo apt install flatpak
sudo apt install gnome-software-plugin-flatpak # If you want GUI integration
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
These are great for getting the latest versions of desktop applications.
6. Configure Firewall (UFW)
Ubuntu comes with UFW (Uncomplicated Firewall). It's simple to use and important for security.
sudo ufw enable # Activates the firewall
sudo ufw status verbose # Shows firewall rules and status
sudo ufw allow ssh # Allows incoming SSH connections (essential if you installed ssh-server)
sudo ufw allow http # If running a web server
sudo ufw allow https # If running a web server
Remember to configure specific ports if you run services like databases or custom applications.
7. Customize Your Desktop (Optional but Fun)
Install GNOME Tweaks for more control over your desktop environment (themes, fonts, extensions):
sudo apt install gnome-tweaks
This allows you to personalize your workspace, which can boost productivity.
Mastering Essential Ubuntu Commands for DevOps
Ab boss, you've installed Ubuntu, configured it. Now it's time to talk about the real power: the command line. For a DevOps engineer, the terminal isn't just a tool; it's your workshop. Knowing these commands is like knowing your tools inside out. Let's explore some crucial categories.
1. Navigating the File System
This is basic, but fundamental. You need to know where you are and how to move around.
pwd(Print Working Directory): Shows your current location.pwd # Output: /home/your_usernamels(List): Lists files and directories in the current directory.ls -l: Long listing format (permissions, owner, size, date).ls -a: Show all files, including hidden ones (starting with `.` ).ls -lh: Long listing with human-readable sizes.
ls -lh # Output: total 12K # drwxr-xr-x 2 user user 4.0K May 10 10:30 Desktop # drwxr-xr-x 2 user user 4.0K May 10 10:30 Documents # -rw-r--r-- 1 user user 1.2K May 10 09:15 important_file.txtcd(Change Directory): Moves you between directories.cd Desktop: Go to the Desktop directory.cd ..: Go up one level.cd ~: Go to your home directory.cd /var/log: Go to an absolute path.
2. File Management
Creating, copying, moving, and deleting files and directories.
touch: Creates an empty file.touch new_project.txtmkdir: Creates a new directory.mkdir my_scripts mkdir -p project/src/main # Create parent directories if they don't existcp(Copy): Copies files or directories.cp file.txt backup/file.txt cp -r my_project/ backup_project/ # -r for recursive copy of directoriesmv(Move/Rename): Moves files/directories or renames them.mv old_name.txt new_name.txt # Renames a file mv file.txt /tmp/ # Moves a file to /tmprm(Remove): Deletes files.rm -r: Removes directories and their contents recursively.rm -rf: Forcefully remove (use with extreme caution!).
rm unused_file.txt rm -r old_logs/
3. File Permissions (Very Important for DevOps!)
Understanding and managing permissions is critical for security and system stability.
chmod(Change Mode): Changes file permissions.- Symbolic mode: `u` (user), `g` (group), `o` (others), `a` (all). `+` (add), `-` (remove), `=` (set).
chmod u+x script.sh # Make script executable for the owner chmod go-rwx file.txt # Remove read, write, execute for group and others chmod -R 755 my_project/ # Recursively set rwx for owner, rx for group/others - Octal mode: Each digit represents owner, group, others.
- 4 = read (r)
- 2 = write (w)
- 1 = execute (x)
755means `rwx` (4+2+1) for owner, `rx` (4+1) for group and others.chmod 644 config.txt # Owner can read/write, group/others can only read
- Symbolic mode: `u` (user), `g` (group), `o` (others), `a` (all). `+` (add), `-` (remove), `=` (set).
chown(Change Owner): Changes file owner and/or group.: sudo chown devops:devteam /var/www/html/app sudo chown -R root:root /etc/my_app/
4. Package Management (`apt`)
This is how you install, update, and remove software on Ubuntu.
sudo apt update: Synchronizes the package index files from their sources. Always run this first!sudo apt upgrade: Installs the newest versions of all currently installed packages.sudo apt install: Installs a new package.sudo apt install nginxsudo apt remove: Removes a package, but leaves configuration files.sudo apt purge: Removes a package and its configuration files.sudo apt autoremove: Removes packages that were automatically installed to satisfy dependencies for other packages and are no longer needed.apt search: Searches for packages.apt search python3-devapt show: Displays detailed information about a package.
5. System Information and Monitoring
Keep an eye on your system's health and resources.
uname -a: Shows Linux kernel information.df -h(Disk Free): Shows disk space usage in human-readable format.df -h # Output: # Filesystem Size Used Avail Use% Mounted on # /dev/sda1 20G 10G 9.0G 53% / # /dev/sdb1 50G 20G 28G 42% /homedu -sh(Disk Usage): Shows the size of a directory or file.du -sh my_project/ # Output: 2.5G my_project/free -h: Displays free and used memory (RAM and swap).top/htop: Display running processes and resource usage dynamically. `htop` is a more user-friendly version; install it with `sudo apt install htop`.
6. User and Group Management
Important for multi-user environments and security.
whoami: Shows your current username.id: Displays user and group IDs for a user.sudo adduser: Creates a new user (interactive).sudo userdel: Deletes a user.sudo usermod -aG: Adds a user to an existing group.sudo usermod -aG docker devops_user # Add devops_user to the 'docker' groupsudo passwd: Changes a user's password.sudo groupadd: Creates a new group.sudo delgroup: Deletes a group.
7. Process Management
Controlling running applications and services.
ps aux: Shows all running processes.kill: Sends a signal to a process (usually to terminate it). Use `kill -9` for a forceful kill (use with caution!). kill 12345 # Terminate process with PID 12345killall: Kills all processes with a specific name.killall firefoxsystemctl status: Checks the status of a systemd service.systemctl status nginxsystemctl start/stop/restart: Manages systemd services.systemctl enable/disable: Enables/disables a service from starting at boot.
8. Networking Commands
Checking network configuration and connectivity.
ip a/ip addr show: Displays IP addresses and network interfaces.ip aping: Tests network connectivity to a host.netstat -tuln/ss -tuln: Shows listening ports and connections (ssis newer and preferred).ss -tulncurl/wget: Command-line tools to download files or interact with web services.curl https://example.com wget https://example.com/file.zip
9. Archiving and Compression
Working with compressed files, common for backups and software distribution.
tar -czvf: Compress files/directories into a `.tar.gz` archive. (`c`reate, `z`gzip, `v`erbose, `f`ile)..tar.gz tar -czvf my_backup.tar.gz my_project/ important_docs/tar -xzvf: Extract a `.tar.gz` archive. (`x`tract)..tar.gz unzip: Extracts `.zip` files..zip
10. Text Processing and Viewing
Essential for dealing with logs, configuration files, and scripts.
cat(Concatenate): Displays file content to standard output. Good for short files.cat /etc/hostsless/more: View file content page by page. `less` is more powerful. Press Q to quit.less /var/log/sysloghead/tail: View the beginning or end of a file.head -n 10 file.log: Show first 10 lines.tail -n 10 file.log: Show last 10 lines.tail -f file.log: Follow the file as it grows (great for monitoring live logs).
grep: Searches for a pattern within files.grep "error" /var/log/syslog grep -i "warning" /var/log/* # Case-insensitive search in all log filessed(Stream Editor): Powerful for transforming text.# Replace "old_string" with "new_string" in file.txt sed -i 's/old_string/new_string/g' file.txtawk: A pattern-scanning and processing language. Excellent for parsing structured text.# Print the third column of a space-separated file awk '{print $3}' data.txt
11. `sudo` - The Super User Do
We've used `sudo` repeatedly. It stands for "Super User Do" and allows authorized users to execute commands as the superuser (root) or another user. It's a cornerstone of Linux security. Never run commands as `root` directly unless absolutely necessary; `sudo` provides a safer, audited way to gain elevated privileges.
Dekho, yeh sab commands na, tumhare roz ke kaam aayenge. Practice them, integrate them into your workflow, and soon you'll be navigating and managing your Ubuntu system like it's second nature.
Troubleshooting Common Ubuntu Issues
Har cheez perfect toh nahin hoti, right? Sometimes you might hit a snag. Here are a few common issues and pointers on how to deal with them:
- Boot Issues (GRUB Rescue): If your system doesn't boot, especially after dual-booting, it might be a GRUB issue. You can often fix this by booting from your Ubuntu live USB, opening a terminal, and using tools like `boot-repair` or manually repairing GRUB.
- Network Connectivity Problems: Check `ip a` to see if your network interfaces have IP addresses. Use `ping google.com` to test internet connectivity. Check your router, drivers, and network manager settings.
- Package Dependency Errors (`apt`): Sometimes `sudo apt install -f` (fix broken) or `sudo apt autoremove` can resolve dependency issues. If all else fails, search specific error messages online.
- Disk Space Warnings: Use `df -h` to see which partition is full. Use `du -sh *` in directories to find large files/folders and free up space. Check `/var/log` for large log files.
- Graphical Issues: If your display isn't right, try updating your graphics drivers. For NVIDIA, you might need to install proprietary drivers via "Software & Updates" -> "Additional Drivers" tab.
- Where to Find Help: The Ubuntu community is massive!
- Man pages: For any command, type `man
` (e.g., `man ls`) to get its manual. - Ubuntu Forums: An excellent resource for specific issues.
- Ask Ubuntu / Stack Overflow: Search for your error message; chances are someone else has faced it and found a solution.
- Official Documentation: ubuntu.com/support.
- Man pages: For any command, type `man
Don't be afraid to experiment, and always back up important data!
Key Takeaways
- Ubuntu is a powerful, open-source, Debian-based Linux OS vital for DevOps, prioritizing freedom and community.
- Always opt for Long Term Support (LTS) versions like Ubuntu 22.04 LTS for maximum stability in production and development.
- The installation process is straightforward but requires careful consideration for partitioning, especially in dual-boot scenarios.
- Post-installation steps like system updates, installing `build-essential`, Git, and configuring the firewall are critical for a secure and functional dev environment.
- Mastering essential command-line tools for file system navigation, package management, permissions, and process control is fundamental for any DevOps engineer.
Frequently Asked Questions
What is the difference between Ubuntu Desktop and Ubuntu Server?
Ubuntu Desktop comes with a graphical user interface (GUI) and pre-installed applications for daily use, making it ideal for personal workstations. Ubuntu Server, on the other hand, is a minimal installation without a GUI, designed for command-line management and optimized for server roles, offering better performance and security for services like web servers, databases, and containers.
Can I install Ubuntu alongside Windows (dual-boot)?
Yes, absolutely! The Ubuntu installer provides an option to "Install Ubuntu alongside Windows Boot Manager." It will automatically resize your Windows partition to create space for Ubuntu. However, it's always recommended to back up your Windows data before attempting a dual-boot installation to prevent any data loss.
Why is command-line proficiency so important for DevOps engineers on Ubuntu?
Command-line proficiency is crucial for DevOps because it allows for automation, scripting, remote management of servers (often headless, i.e., without a GUI), efficient task execution, and deep system diagnostics. Many DevOps tools and practices, especially for cloud infrastructure, CI/CD pipelines, and container orchestration, are primarily command-line driven, making it an indispensable skill.
How do I update Ubuntu and install new software?
To update your Ubuntu system and install new software, you use the `apt` package manager via the terminal. First, update your package lists with `sudo apt update`. Then, upgrade all installed packages to their latest versions using `sudo apt upgrade`. To install new software, use `sudo apt install
So, there you have it, my friend. A comprehensive guide to getting started with Ubuntu. This OS will be your trusted companion, especially in the world of DevOps. Ab, der na karo, download the ISO, get your machine ready, and dive into the amazing world of Linux! For a visual walkthrough and more practical tips, don't forget to watch the detailed video on the @explorenystream channel and hit that subscribe button for more fantastic content!