Getting a Linux Terminal on Any Computer
Set up a Linux command line on Windows with WSL, on macOS, on a Linux desktop, on a free cloud server or in a Docker container.
On this page 11 sections
Introduction
To learn the command line you need to practise it, so this lesson gets you a Linux terminal whatever computer you use. Every option below gives you the same Bash commands used throughout this course. Pick one, set it up, and keep it open as you read the remaining lessons.
- How to install Ubuntu on Windows with WSL.
- How the macOS Terminal compares with Linux.
- Other options: a Linux desktop, a cloud server or a Docker container.
- How to practise safely.
Windows: WSL
Windows Subsystem for Linux (WSL) runs a real Linux distribution inside Windows, with no dual-booting or separate virtual-machine software. It is how many professional developers on Windows work every day.
- Right-click the Start button and open “Terminal (Admin)” or “PowerShell (Admin)”.
- Run the command below. It installs WSL and Ubuntu (the default distribution).
- Restart your computer when asked.
- Open “Ubuntu” from the Start menu. The first time, create a Linux username and password — they are separate from your Windows login.
wsl --installYour Windows drives are available inside Ubuntu under /mnt/c, /mnt/d and so on, and you can open your Linux files from Windows Explorer by typing \\wsl$ in the address bar. For the best performance, keep projects inside your Linux home folder rather than under /mnt/c.
Windows Terminal (preinstalled on Windows 11, free in the Microsoft Store for Windows 10) gives you tabs and lets you open Ubuntu, PowerShell and Command Prompt side by side.
macOS
macOS is a Unix operating system, so its Terminal app (in Applications → Utilities) already understands nearly every command in this course. Its default shell is Zsh, which behaves almost exactly like Bash for everyday use. A few differences to be aware of:
- Some commands have slightly different options, because macOS uses BSD versions of tools rather than GNU versions (for example, sed -i needs an extra empty argument on macOS).
- Software is installed with Homebrew (brew install …) instead of apt.
- Linux-only commands such as apt, ip and systemctl do not exist on macOS.
For the Linux-specific lessons (packages, services, system administration), use a Docker container or a cloud server as described below.
Linux Desktop
If you already run Ubuntu, Fedora or another distribution, open the Terminal app — on Ubuntu, press Ctrl+Alt+T. You can also install Ubuntu Desktop alongside another operating system, or try it in a virtual machine with free software such as VirtualBox.
Cloud Servers
A small Linux virtual machine from a cloud provider is excellent practice because it is exactly what you will use at work. Most providers offer a free tier or trial credit. You create an Ubuntu server in their web console, then connect from your terminal with SSH (covered in lesson 13).
Free tiers have limits. Choose the smallest machine, set a billing alert, and delete servers you are no longer using so you are never charged by surprise.
Docker
If Docker is installed, one command gives you a throwaway Ubuntu shell. Everything you do disappears when you type exit, which makes it a perfect sandbox for experiments:
docker run -it --rm ubuntu:24.04 bashContainer images are deliberately minimal, so you may need to install a few tools first (apt update && apt install -y nano curl). You will learn Docker properly in the Docker course.
Which Should You Choose?
| Your computer | Recommended | Also possible |
|---|---|---|
| Windows 10 or 11 | WSL with Ubuntu | Docker, cloud server, virtual machine |
| macOS | Terminal app for most lessons | Docker or a cloud server for Linux-only commands |
| Linux | Your normal terminal | — |
| Chromebook | Linux development environment (in Settings → Developers) | Cloud server |
You use Windows 11 and want to follow every lesson in this course, including installing packages with apt. What is the best option?
Staying Safe While Practising
- Practise in your home folder or a new practice folder, not in system folders like /etc.
- Be careful with rm (delete) — there is no recycle bin on the command line.
- Think twice before running anything with sudo, which gives a command full control of the system.
- A Docker container or a fresh cloud server is the safest place for risky experiments: if you break it, you simply start a new one.
Frequently Asked Questions
Yes. WSL 2 runs a genuine Linux kernel in a lightweight virtual machine, so commands, packages and file permissions behave as on any Ubuntu system.
Git Bash is fine for Git and basic file commands, but it is not Linux, so packages, permissions, processes and services work differently. Use WSL for this course if you can.
Not noticeably. WSL only uses resources while Linux programs are running, and it shuts down by itself when idle.
Key Takeaways
- On Windows, wsl --install gives you a real Ubuntu terminal.
- macOS Terminal handles most commands; some options differ and apt is not available.
- A cloud server or Docker container is ideal for Linux-only and risky experiments.
- Practise in your home folder and be careful with rm and sudo.
Summary
You now have a Linux terminal ready to use. In the next lesson you will learn how the Linux file system is organised and how to move around it confidently with pwd, ls and cd.