You can run Linux on a Mac, but not by replacing macOS the way you would on a PC
A Mac cannot dual-boot Linux the way a Windows machine can. Apple's hardware — especially newer Macs with Apple Silicon chips — does not support the standard Linux installation process. Instead, you have three realistic paths: run Linux inside a virtual machine on top of macOS, use a container system like Docker, or replace macOS entirely on older Intel-based Macs using specialized tools. Which one works depends on what you actually need to do with Linux.
Most people who want Linux on a Mac are developers who need a Linux environment to test code or run specific tools. For that, a virtual machine is the simplest and safest option — it runs Linux in a window on your Mac without touching the operating system underneath. If you want to replace macOS completely, you can do that on Intel Macs from around 2013 to 2021, but not on newer Apple Silicon models, and the process is more involved.
Key Takeaways
- Virtual machines like UTM (free) or Parallels Desktop (paid) let you run Linux inside macOS without replacing it, and work on both Intel and Apple Silicon Macs.
- Docker and other container tools are faster and lighter than virtual machines if you only need to run specific Linux applications or services.
- You can replace macOS with Linux on Intel-based Macs using tools like Asahi Linux, but not on Apple Silicon models released after 2021.
- A virtual machine is the safest choice if you are new to Linux or unsure whether you will keep using it regularly.
Running Linux in a virtual machine on macOS
A virtual machine is software that pretends to be a complete computer inside your Mac. Linux runs inside that pretend computer, completely separate from macOS. You can close it and return to macOS instantly, and nothing you do in Linux affects your Mac's actual operating system.
On an Apple Silicon Mac (M1, M2, M3, or later), use UTM, which is free and open-source. Download it from the Mac App Store or from utm.app. On an Intel Mac, you can use UTM, or pay for Parallels Desktop or VMware Fusion, which are faster but cost money. UTM works on both, but runs slower on Intel machines than the paid options.
After installing UTM, download a Linux distribution. Ubuntu is the most common choice for beginners. Go to ubuntu.com/download/server and download the ISO file for ARM64 (if you have an Apple Silicon Mac) or AMD64 (if you have an Intel Mac). Open UTM, create a new virtual machine, point it to the ISO file you downloaded, and follow the on-screen prompts. The whole process takes 20 to 40 minutes the first time.
Once Linux is running in the virtual machine, you interact with it exactly as you would on a real Linux computer. You can install software, run commands, and develop code. When you are done, close the window. Your Mac is unaffected.
Using containers instead of a full virtual machine
If you only need to run specific Linux applications or services — not a full Linux desktop — containers are faster and use less of your Mac's resources. Docker is the most common container tool. It packages an application and everything it needs to run into a single unit that works the same way on any computer.
Install Docker Desktop from docker.com/products/docker-desktop. It works on both Intel and Apple Silicon Macs. After installation, you can download and run pre-built containers from Docker Hub without ever seeing a Linux command line. For example, to run a web server, you type one command and it starts. When you are done, you stop it.
Containers are ideal if you are a developer who needs to test code in a Linux environment, or if you need to run a specific service like a database or message queue. They are not a replacement for a full Linux system if you need a desktop or want to learn Linux from the ground up.
Replacing macOS with Linux on Intel Macs
On older Intel-based Macs, you can erase macOS and install Linux directly. This is a permanent change — you will not have macOS anymore unless you restore it from a backup. Do this only if you are certain you want to use Linux full-time and understand that some Mac-specific software will not work.
Asahi Linux is a project that brings Linux to Apple Silicon Macs, but it is still in early stages and not recommended for everyday use. For Intel Macs, you have more options. Ubuntu, Fedora, and other distributions have installers that work on Intel hardware. The process is similar to installing Linux on a PC: create a bootable USB drive, restart your Mac while holding the Option key, select the USB drive, and follow the installer.
Before you start, back up your entire Mac using Time Machine or another backup tool. You will need an external USB drive with at least 8 GB of space to create the bootable installer. The actual installation takes 30 minutes to an hour, but preparation and backup can take several hours.
What you need before you start
For a virtual machine, you need about 20 to 50 GB of free space on your Mac's drive, depending on how large you want the Linux installation to be. You also need the ISO file for your chosen Linux distribution, which you download from the distribution's website. This is a large file — usually 2 to 4 GB — so download it on a fast internet connection.
For Docker, you need Docker Desktop installed and about 5 GB of free space. Most containers download automatically when you run them for the first time.
For replacing macOS with Linux, you need a USB drive with at least 8 GB of space, a backup of your entire Mac, and time to reinstall macOS later if you change your mind. You also need to know your Mac's exact model and year, because different Macs sometimes need different Linux versions.
Common mistakes and how to avoid them
The most common mistake is downloading the wrong version of Linux for your Mac's processor. If you have an Apple Silicon Mac and download the AMD64 version of Ubuntu, it will not work. Check your Mac's processor first: click the Apple menu, select About This Mac, and look at the Chip line. If it says Apple, you have Apple Silicon. If it says Intel, you have an Intel processor. Then download the matching version.
Another mistake is not leaving enough free space on your Mac's drive. Virtual machines need space for the Linux installation itself, plus space for files you create inside Linux. If your Mac's drive is more than 80 percent full, free up space before you start.
If you are replacing macOS with Linux, the biggest mistake is not backing up first. If something goes wrong or you change your mind, a backup is your only way back. Do not skip this step.
When to choose each option
Use a virtual machine if you are new to Linux, if you want to keep macOS as your main operating system, or if you are not sure how much you will use Linux. It is the safest and most reversible option. You can delete the virtual machine anytime and your Mac is exactly as it was.
Use Docker if you are a developer who needs to test code in a Linux environment, or if you need to run specific Linux services. It is faster and lighter than a virtual machine, but it is not a replacement for a full Linux system.
Replace macOS with Linux only if you are certain you want to use Linux full-time and you understand that some software designed for Mac will not work. This is a permanent decision unless you restore from backup.
Frequently Asked Questions
Can I install Linux on a new Mac with an M-series chip?
You can run Linux inside a virtual machine or container on Apple Silicon Macs. You cannot replace macOS with Linux on these models yet. Asahi Linux is working on this, but it is not ready for regular use. A virtual machine like UTM is your best option.
Will Linux run as fast in a virtual machine as it would on real hardware?
No. A virtual machine shares your Mac's processor and memory with macOS, so Linux runs slower than it would on dedicated hardware. For most development work, the difference is not noticeable. If you need maximum performance, you would need to replace macOS entirely.
Can I use the same files in both macOS and Linux?
Yes. Virtual machines let you share folders between macOS and Linux, so you can edit files in macOS and use them in Linux, or vice versa. Docker containers can also access files on your Mac. Set up the shared folder when you create the virtual machine.
What if I want to go back to macOS after installing Linux?
If you used a virtual machine, delete it and your Mac is unchanged. If you replaced macOS with Linux, you will need to restore from a Time Machine backup or reinstall macOS from an external drive. This is why backing up before you replace macOS is essential.
Do I need to pay for Linux?
No. Linux itself is free. Ubuntu, Fedora, and most other distributions are free to download and use. Virtual machine software like UTM and Docker Desktop are also free. Parallels Desktop and VMware Fusion are paid options, but UTM is a free alternative that works on both Intel and Apple Silicon Macs.