Choosing the Right Installation Medium
Available Options
Architecture
Computer hardware, and CPUs in particular, come in several different architectures. A very common consumer architecture is known as x86_64 - the traditional Intel x86 architecture with AMD’s 64-bit extensions. If you are installing Alpine to a traditional computer, this is most likely what you have. Otherwise, if you want to install Alpine on a ARM processor, you most likely want to use aarch64. However, Alpine supports several other architectures for to-disk installation purposes:
- x86_64
-
64-bit Intel / AMD
- x86
-
32-bit Intel (i686)
- aarch64
-
64-bit ARMv8
- armv7
-
32-bit ARMv7
- armhf
-
32-bit ARMv6 with hardware floating point unit
- riscv64
-
64-bit RISC-V open standard ISA
- ppc64le
-
64-bit little-endian PowerPC (POWER8 and POWER9)
- s390x
-
IBM Z (Mainframes)
- loongarch64
-
64-bit Loongson’s ISA
Image Type
Alpine offers a variety of downloadable images.
The image varieties relevant to this handbook are as follows:
- standard
-
A minimal installation image. Requires networking.
- extended
-
Standard, but with additional packages included. Fewer available architectures, but may be more convenient. Often used for non-disk installations.
- netboot
-
A netboot image, intended to be used with PXE. Using PXE is outside the scope of this handbook, but it may be used in place of the standard image.
- raspberry pi
-
An installation optimized for Rasperry Pi. First generation through current platforms are supported.
- generic arm
-
A generic image for ARM processors. Both armv7 (32 bit) and aarch64 (64 bit) are available.
- mini root filesystem
-
An installation with a minimal root filesystem. This is intended for installing containers and minimal chroot environments.
- virtual
-
The standard image, but using a different kernel, optimized for virtual environments, such as kvm, virtualbox, or VMware.
- xen
-
Specialized image, intended to be used in xen dom0 installations.
- cloud
-
Specialized images for installation in a cloud provider’s environment, such as AWS, Azure, NoCloud, etc. For the latest information on these images, see https://alpinelinux.org/cloud/
Choosing the Right Image
If you are unsure which image to use:
-
Start with the Standard image for most installations.
-
Choose a specialized image if your environment demands it (e.g., Raspberry Pi, cloud, or virtual environments).
-
Use the Extended image if you are using a non-disk-based setup or need to install without network.
Downloading
Obtaining the Chosen Media
Image downloads are available at alpinelinux.org. Press the button under your chosen image type, that corresponds to your target architecture. This will link to a direct download of your image.
If your download has a suffix that is not |
[Recommended] Verifying the Downloaded Files (sha256)
To ascertain that the files you downloaded are intact, you can calculate what is known as a "hash sum" of the file, and compare it to the publicly known one. Next to the download button you clicked, there is a separate one with "sha256" written on it - this is a direct download to a (very small) file that contains said public hash.
[Linux] Sha256 Calculation
On a Linux host, you can calculate the sha256 hashsum of a given file using the sha256
utility.
Here is an example command you can enter in your shell to calculate the sha256 sum of a file named "alpine.iso" in your current directory.
sha256sum alpine.iso
[MacOS] Sha256 Calculation
On a MacOS host, you can calculate the sha256 hashsum of a given file using the shasum
utility.
Here is an example command you can enter in your shell to calculate the sha256 sum of a file named "alpine.iso" in your current directory.
shasum -a 256 alpine.iso
[Windows] Sha256 Calculation
On a Windows host, you can calculate the sha256 hashsum of a given file using the Get-FileHash
PowerShell utility.
Here is an example command you can enter in PowerShell to calculate the sha256 sum of a file named "alpine.iso" in your current directory.
Get-FileHash .\alpine.iso -Algorithm SHA256
[Optional] Verifying the Downloaded Files (PGP)
To ascertain that the files you downloaded are intact, and signed by the developers, you can use the signature file, and verify its validity against the public key of the signer, as well as the contents of the image. Next to the button you clicked, there is a separate one with "GPG" written on it - this is a direct download to a (very small) file that contains said signature.
Currently, signatures are made by ncopa, whose key is available over at alpinelinux.org. You should download and import this key, or import it into your PGP keychain some other way.
Assuming you have GnuPG (a PGP implementation) installed, you can verify the signature "alpine.iso.asc" of a file named "alpine.iso" signed by "ncopa.asc" in a shell as so:
gpg --import ncopa.asc
gpg --verify alpine.iso.asc alpine.iso
Using the Image
A .iso
file on its own is not very useful.
You can either flash it to a usb stick, or burn it to a physical cd/dvd.
USB Drive
On Windows and MacOS hosts, it is most convenient to use a dedicated utility, such as Etcher. See that project’s documentation in case any further details are required.
On Linux hosts, such utilities have many dependencies and might not be installed by default.
As such, it is also possible to use the dd
utility.
You must figure out the physical "device node" of your USB drive.
This will usually be in the form of /dev/sdX
, where X is a lowercase letter, such as a, b or c.
The next step will permanently erase all data on the selected device. Please be very sure you have identified the correct device before proceeding. |
Once you have identified your device, you can flash a file named "alpine.iso" to your device (/dev/sdb
in this example) using the following command:
dd if=alpine.iso of=/dev/sdb (1)
1 | This needs to be run as root, unless your user has write access to the output block device. |
You may achieve greater performance in this operation by passing additional parameters, such as |
Burning to a CD/DVD
Another way to utilize the .iso
file is by burning it on a CD or DVD.
This is also useful on older systems that do not know how to boot from a USB drive.
On MacOS, you can select the .iso
file, and then press ].
On Windows 8 and above, you can right-click the .iso
file, and then press Burn Disk Image.
On Linux hosts, there are no default built-in tools to burn images.
[Linux] Burning an Image File
This handbook recommends using k3b - a graphical utility inside of which one can select
.Alternatively, people that do not wish to use a graphical environment for this, might want to use the cdrtools
program.
Here is an example command that will burn an image named alpine.iso
to the first found disk drive (/dev/sr0
):
cdrecord dev=/dev/sr0 alpine.iso (1)
1 | This needs to be run as root, unless your user has write access to the output block device. |
Booting
Once you have prepared your appropriate installation medium, you need to boot into the Alpine Linux live environment. During the bootup of your system, you should have the option to enter BIOS/UEFI settings, alongside what is often called "One Time Boot Override", or "Boot Selection".
If you can identify the button to press to get that latter one, you should mash it, and select the entry that corresponds to your installation medium. Alternatively, you can try mashing the button for BIOS/UEFI settings, and changing the boot order (often allowed) to prioritize your medium. If it is unclear which button it is, you can try any of these, which are commonly used for all of those purposes: DEL F1 F10 ESC
If you want to install Alpine in UEFI (non-legacy, nor BIOS) mode, you must use UEFI to boot the USB disk. |
[Optional] Modifying Kernel Command Line
There are some scenarios in which you will need to modify the kernel command line. You might even need to do so for diagnostic reasons. You can see what parameters are available and what they do over at the Developer Handbook.
One common reason to modify the kernel command line is to set a serial console.
To enable the first serial port as console you may add |
[Grub] Modifying Kernel Command Line
Under grub, when you are presented with the boot prompt, you may press e to edit the booting configuration.
You can then find the line starting with linux
, and add or remove parameters from that line.
[Isolinux] Modifying Kernel Command Line
Under isolinux, there is no graphical editor, but you can specify the kernel command line directly.
To do so, you must select the correct label (for example, lts
or virt
), and add your parameters there.
For example, if you wanted to add console=ttyS0
to your kernel command line, your isolinux prompt should look as so:
boot: lts console=ttyS0