<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Wackbyte</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Wackbyte"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Wackbyte"/>
	<updated>2026-05-05T15:04:48Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Installation&amp;diff=30622</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Installation&amp;diff=30622"/>
		<updated>2025-07-30T20:42:57Z</updated>

		<summary type="html">&lt;p&gt;Wackbyte: /* Downloading installation image */ formatting and style, reorder file name explanation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:hdd_mount.png|left|link=]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page exists to provide a basic overview to get started. Before actually installing, it can help to skim through the [[Alpine_Linux:FAQ| Frequently Asked Questions (FAQ)]], as well as to refer to the official installation guide at [https://docs.alpinelinux.org/ docs.alpinelinux.org].&lt;br /&gt;
&lt;br /&gt;
{{Tip|This is a wiki!&lt;br /&gt;
If something isn&#039;t correct, or is incomplete, you will have to figure it out, or ask for the correct solution in the [https://alpinelinux.org/community/ community].&lt;br /&gt;
&lt;br /&gt;
And then carefully [[Help:Editing|edit]] the wiki page.&lt;br /&gt;
&lt;br /&gt;
Just as those before who did it for you.}}&lt;br /&gt;
&lt;br /&gt;
== Minimal Hardware Requirements ==&lt;br /&gt;
{{Main|Requirements}}&lt;br /&gt;
* At least 128 MB of RAM. [A graphical desktop system may require up to 512 minimum.]. Note that an installation itself (from ISO) generally requires at least 320 MB during installation.&lt;br /&gt;
* At least 0-700 MB space on a writable storage device. [Only required in [[#System Disk Mode|&amp;quot;sys&amp;quot;]] or [[#Data Disk Mode|&amp;quot;data&amp;quot;]] mode installations. It is optional in [[#Diskless Mode|&amp;quot;diskless&amp;quot;]] mode, where it may be used to save newer data and configurations states of a running system.]&lt;br /&gt;
* A working internet connection is required to complete [[#System Disk Mode|&amp;quot;sys&amp;quot;]] mode installation or use &#039;&#039;&#039;Extended image&#039;&#039;&#039; if available for your architecture.&lt;br /&gt;
&lt;br /&gt;
{{Note|Refer [[#Custom Installation Instructions|custom installation instructions]] for headless system, virtualization etc. Most of the steps outlined on this page applies to all [[Architecture#Architectures_supported|Architectures]] supported by Alpine Linux. For more specific installation instructions, refer to their respective pages.}}&lt;br /&gt;
&lt;br /&gt;
== Installation Overview ==&lt;br /&gt;
&lt;br /&gt;
Alpine Linux can be installed and run in [[Setting_up_disks_manually#Alpine_Linux_modes|three modes]]  i.e [[#Diskless_Mode|Diskless Mode]], [[#Data_Disk_Mode|Data Disk Mode]] and [[#System_Disk_Mode|System Disk Mode]]. The installation procedure for Alpine Linux &#039;&#039;&#039;requires basic understanding of the three modes&#039;&#039;&#039; explained in brief below: &lt;br /&gt;
&lt;br /&gt;
==== Diskless Mode ====&lt;br /&gt;
{{Main|Diskless Mode}}&lt;br /&gt;
In Diskless mode the entire operating system with all applications are first loaded into RAM and then only run from there. This mode is extremely fast and can save on unnecessary disk spin-ups, power, and wear.  Alpine Linux uses this method to boot the .iso installation images. The [[Alpine_setup_scripts#setup-alpine|&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;]] script configures the installed system to continue to boot like this if &amp;quot;disk=none&amp;quot; is specified.&lt;br /&gt;
&lt;br /&gt;
==== Data Disk Mode ====&lt;br /&gt;
{{Main|Data Disk Mode}}&lt;br /&gt;
In Data Disk mode also the operating system  runs from system RAM, thus it enjoys the same accelerated operation speed as &amp;quot;diskless&amp;quot; mode. However, swap storage and the entire {{Path|/var}} directory tree get mounted from a persistent storage device. This mode is useful for having RAM accelerated servers with variable amounts of user-data that exceed the available RAM size. &lt;br /&gt;
&lt;br /&gt;
==== System Disk Mode ====&lt;br /&gt;
&lt;br /&gt;
System or &#039;&#039;&#039;sys&#039;&#039;&#039; Disk Mode is the traditional hard-disk install. Alpine Linux can be installed to an entire [[#setup-alpine based System Disk Install|&#039;&#039;&#039;hard disk&#039;&#039;&#039;]] using &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; script or to custom partitions using [[Setting_up_disks_manually|&amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt;]]. For further info, refer [[Setting_up_disks_manually|System Disk Mode]]. &lt;br /&gt;
&lt;br /&gt;
=== General course of action ===&lt;br /&gt;
&lt;br /&gt;
It is really helpful for many use cases to [[#Preparing for the installation|prepare]] and complete the [[#Installation Step Details|installation]] until the [[#Base configuration|base configuration]] step, then proceed with installation of the target system with any one of the various [[#Alternative courses of action|alternative]] courses of action.&lt;br /&gt;
&lt;br /&gt;
=== Alternative courses of action ===&lt;br /&gt;
&lt;br /&gt;
Examples of preparation options:&lt;br /&gt;
&lt;br /&gt;
* Download some specific driver to configure the hardware, and/or install some software tool that may be missing in the live system by using the Alpine package manager &amp;lt;code&amp;gt;[[Alpine Package Keeper|apk]]&amp;lt;/code&amp;gt;.  &lt;br /&gt;
* Do a [[Setting up disks manually#Manual partitioning|manual partitioning]] of the hard disk that avoids overwrite of an entire disk.&lt;br /&gt;
&lt;br /&gt;
Examples of such options:&lt;br /&gt;
&lt;br /&gt;
* To install Alpine Linux on an &#039;&#039;&#039;entire hard disk&#039;&#039;&#039; with optional [[Alpine setup scripts#Environment Variables|environment variables]], proceed to [[#setup-alpine based System Disk Install|setup-alpine based System Disk Install]].&lt;br /&gt;
* Use {{ic|setup-disk}} script to complete a [[Setting up disks manually|traditional hard disk installation]] on a partition or to [[Dualbooting|dualboot]] or to configure [[Setting up disks manually#RAID|RAID]], [[Setting up disks manually#Encryption|encryption]] or [[Setting up disks manually#LVM|LVM]] for [[#System Disk Mode|&amp;quot;system&amp;quot;]] disk mode or to add a [[#Data Disk Mode|&amp;quot;data&amp;quot;]] mode partition.&lt;br /&gt;
* Create a [[Create a Bootable Device#Using setup-bootable|customizable boot media]] i.e a boot device with a writable filesystem for &#039;&#039;&#039;[[#Diskless Mode|diskless]]&#039;&#039;&#039; or &#039;&#039;&#039;[[#Data Disk Mode|data]]&#039;&#039;&#039; disk-mode.&lt;br /&gt;
* Configure a [[Diskless Mode#Using an internal disk for persistent storage|internal disk for persistent storage]] to save the local configuration state and local package cache for the [[#Diskless Mode|diskless]] system or &#039;&#039;&#039;[[#Data Disk Mode|data]]&#039;&#039;&#039; disk-mode.&lt;br /&gt;
&lt;br /&gt;
There are many more [[Alpine setup scripts|setup-scripts]] available. All these tools may also be run later to adjust specific configurations. For example, to set up a graphical environment as covered under [[#Post-Installation|Post-Installation]] below.&lt;br /&gt;
&lt;br /&gt;
== Preparing for the installation ==&lt;br /&gt;
&lt;br /&gt;
=== Downloading installation image ===&lt;br /&gt;
&lt;br /&gt;
Installation image files are available in the &#039;&#039;&#039;iso&#039;&#039;&#039;, &#039;&#039;&#039;tar.gz&#039;&#039;&#039;, and &#039;&#039;&#039;img.gz&#039;&#039;&#039; formats. Download the [https://alpinelinux.org/downloads/ stable release installation image file] for the target computer&#039;s architecture with the corresponding &amp;lt;code&amp;gt;sha256&amp;lt;/code&amp;gt; checksum and &amp;lt;code&amp;gt;GPG&amp;lt;/code&amp;gt; signature files. &lt;br /&gt;
{{Tip|Only download the &amp;lt;code&amp;gt;sha256&amp;lt;/code&amp;gt; checksum and &amp;lt;code&amp;gt;GPG&amp;lt;/code&amp;gt; signature files from the [https://alpinelinux.org/downloads/ official site] and not from mirrors.}}&lt;br /&gt;
&lt;br /&gt;
Now you have three files in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alpine-standard-*.iso&lt;br /&gt;
alpine-standard-*.iso.sha256&lt;br /&gt;
alpine-standard-*.iso.asc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine-standard-{{AlpineLatest}}-x86_64.iso&amp;lt;/code&amp;gt; is the &#039;&#039;&#039;standard&#039;&#039;&#039; image file for version &#039;&#039;&#039;{{AlpineLatest}}&#039;&#039;&#039; and the &#039;&#039;&#039;x86_64&#039;&#039;&#039; architecture in the &#039;&#039;&#039;iso&#039;&#039;&#039; format.&lt;br /&gt;
&lt;br /&gt;
=== Verifying downloaded image ===&lt;br /&gt;
&lt;br /&gt;
From Security point of view, verify the downloaded image file for both checksum and GPG signature before proceeding further. The three required utilities i.e &amp;lt;code&amp;gt;sha256&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gpg&amp;lt;/code&amp;gt; or their equivalents are available in every operating system including Linux, windows, Mac and BSD derivaties. &lt;br /&gt;
&lt;br /&gt;
{{Tip|Ensure that all the three downloaded files remain in the same folder. If not, adjust the commands accordingly.}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;sha256&amp;lt;/code&amp;gt; checksum verifies the integrity of the downloaded image i.e no modifications occurred during download.&lt;br /&gt;
{{Cmd|sha256sum -c alpine-*.iso.&#039;&#039;&#039;sha256&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;GPG&amp;lt;/code&amp;gt; signature verifies the link between the downloaded image to the individual who signed it. Signature verification involves two steps:&lt;br /&gt;
&lt;br /&gt;
Step 1. Download and import the gpg signature from official website &lt;br /&gt;
{{Cmd|curl https://alpinelinux.org/keys/ncopa.asc &amp;amp;#124; gpg --import ;}}&lt;br /&gt;
&lt;br /&gt;
Step 2. Verify that the image signature matches with the one downloaded in Step 1.&lt;br /&gt;
{{Cmd|gpg --verify alpine-*.iso.&#039;&#039;&#039;asc&#039;&#039;&#039; alpine-*.&#039;&#039;&#039;iso&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
=== Preparing installation media  ===&lt;br /&gt;
{{Seealso|Burning ISOs}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|All data currently on the installation media will be &#039;&#039;&#039;erased&#039;&#039;&#039;, when Alpine Linux installation image is written on it. Correctly identify the device name for the installation media using commands &amp;lt;code&amp;gt;lsblk&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;blkid&amp;lt;/code&amp;gt;.}} &lt;br /&gt;
If downloaded image file is in &#039;&#039;&#039;img.gz&#039;&#039;&#039; format, unzip it using the command {{ic|gunzip alpine-rpi-{{AlpineLatest}}-aarch64.img.gz}} to {{ic|alpine-rpi-{{AlpineLatest}}-aarch64.img}} first before using with {{ic|dd}} command. In Linux {{ic|dd}} command can be used to write image files in both &#039;&#039;&#039;iso&#039;&#039;&#039; and &#039;&#039;&#039;img&#039;&#039;&#039; format to the installation media. &lt;br /&gt;
&lt;br /&gt;
If &#039;&#039;&#039;tar.gz&#039;&#039;&#039; format image file is downloaded, follow the [[Create a Bootable Device#Manually copying Alpine files|instructions]] to create the installation media.&lt;br /&gt;
&lt;br /&gt;
Modify the input file(&#039;&#039;&#039;if&#039;&#039;&#039;)  of the {{ic|dd}} command according to the name and path to your image file and and the target device i.e output file(&#039;&#039;&#039;of&#039;&#039;&#039;) should be a device name &#039;&#039;&#039;/dev/sdX&#039;&#039;&#039; instead of partition like &#039;&#039;&#039;/dev/sdbXY&#039;&#039;&#039;:{{Cmd|# dd if{{=}}alpine-standard-{{AlpineLatest}}-x86_64.iso of{{=}}/dev/sdX bs{{=}}4M status{{=}}progress; eject /dev/sdX}}&lt;br /&gt;
&lt;br /&gt;
If your version of &amp;lt;code&amp;gt;dd&amp;lt;/code&amp;gt; does not support the option &amp;quot;status=progress&amp;quot;, remove it. The &amp;lt;code&amp;gt;eject&amp;lt;/code&amp;gt; command removes the target device from the system and ensures the write cache is completely flushed.&lt;br /&gt;
&lt;br /&gt;
In Windows and Mac OS, [https://www.balena.io/etcher/  Etcher] can be used to create an installation media.&lt;br /&gt;
&lt;br /&gt;
===  Verifying Installation media ===&lt;br /&gt;
&lt;br /&gt;
After detaching and re-attaching the device, a bit-wise comparison can verify the data written to the device (instead of just data buffered in RAM). If the comparison terminates with an end-of-file error on the .iso file side, all the contents from the image have been written (and re-read) successfully:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# cmp ~/Downloads/alpine-standard-{{AlpineLatest}}-x86_64.iso /dev/sdX &lt;br /&gt;
 cmp: EOF on alpine-standard-{{AlpineLatest}}-x86_64.iso&amp;lt;/Code&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Booting Installation Media ===&lt;br /&gt;
&lt;br /&gt;
Insert the [[#Preparing_installation_media|Installation media]] to a proper drive or port of the computer and turn the machine on, or restart it, if already running.&lt;br /&gt;
{{Note| To successfully boot and install Alpine Linux, disable [[UEFI#Secure boot|secure boot]] in the BIOS. Once Alpine Linux is installed, this can be [[UEFI_Secure_Boot|enabled]].}}&lt;br /&gt;
If the computer does not automatically boot from the desired device, one needs to bring up the boot menu and choose the media to boot from. Depending on the computer, the menu may be accessed by repeatedly pressing a key quickly when booting starts. Some computers require that you press the button &#039;&#039;before&#039;&#039; starting the computer and hold it down while the computer boots. Typical keys are:  {{key|F9}}-{{key|F12}}, sometimes {{key|F7}} or {{key|F8}}. If these don&#039;t bring up the boot menu, it may be necessary to enter the BIOS configuration and adjust the boot settings, for which typical keys are: {{key|Del}} {{key|F1}} {{key|F2}} {{key|F6}} or {{key|Esc}}.&lt;br /&gt;
&lt;br /&gt;
== Installation Step Details ==&lt;br /&gt;
&lt;br /&gt;
=== Boot Process ===&lt;br /&gt;
&lt;br /&gt;
The boot process of the alpine installation image first copies the entire operating system into the RAM memory, and then starts a complete Alpine Linux system from there. It will initially only provide a basic command line environment that does not depend on reading from any (possibly slow) initial boot media, anymore.&lt;br /&gt;
&lt;br /&gt;
Local log-in is possible as the user &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt;. Initially, the &#039;&#039;&#039;root&#039;&#039;&#039; user has no password.&lt;br /&gt;
&lt;br /&gt;
At the command prompt, an interactive script named [[Alpine_setup_scripts#setup-alpine|&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;]] is available to configure and install Alpine Linux. The script can be customized by the optional [[Alpine_setup_scripts#Environment_Variables|environment variables]], in case of [[Installation#Data_Disk_Mode|&#039;&#039;&#039;&amp;quot;data&amp;quot;&#039;&#039;&#039;]] or [[Installation#System_Disk_Mode|&#039;&#039;&#039;&amp;quot;sys&amp;quot;&#039;&#039;&#039;]] mode. For e.g {{Codeline|&amp;lt;code&amp;gt;USE_EFI{{=}}1 BOOT_SIZE{{=}}512 setup-alpine&amp;lt;/code&amp;gt;}}, sets the disklabel type to gpt, creates 512MB &#039;&#039;&#039;/boot&#039;&#039;&#039; partition with &#039;&#039;&#039;vfat&#039;&#039;&#039; filesystem and uses &amp;lt;code&amp;gt;grub&amp;lt;/code&amp;gt; as bootloader.&lt;br /&gt;
&lt;br /&gt;
=== Base configuration ===&lt;br /&gt;
&lt;br /&gt;
Launch the Alpine Linux Installation by running the [[Alpine_setup_scripts#setup-alpine|&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;]] script :&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# setup-alpine}}&lt;br /&gt;
&lt;br /&gt;
The question-and-answer dialog of &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; takes care of the base configuration. It sets up a network connection to access Internet to configure the system to boot into one of three different Alpine Linux &amp;quot;disk&amp;quot; modes:  [[Installation#Diskless_Mode|&#039;&#039;&#039;&amp;quot;diskless&amp;quot;&#039;&#039;&#039;(none)]],  [[Installation#Data_Disk_Mode|&#039;&#039;&#039;&amp;quot;data&amp;quot;&#039;&#039;&#039;]]  or [[Installation#System_Disk_Mode|&#039;&#039;&#039;&amp;quot;sys&amp;quot;&#039;&#039;&#039;]]. If you choose to edit any option, the relevant file is opened in [[BusyBox#vi| &#039;&#039;&#039;vi&#039;&#039;&#039; editor]] for editing.&lt;br /&gt;
&lt;br /&gt;
{{Tip| If you have access to a wired network, consider using [https://docs.alpinelinux.org/user-handbook/0.1a/Installing/setup_alpine.html#_setup_alpine_q Quick Mode], to complete the base configuration quickly.}}&lt;br /&gt;
&lt;br /&gt;
[[File:Installation-alpine-alpine-setup-3-setup-scripts.png|350px|thumb|right|Example &amp;lt;code&amp;gt;[[Alpine_setup_scripts#setup-alpine|setup-alpine]]&amp;lt;/code&amp;gt; session]]&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;[[Alpine_setup_scripts#setup-alpine|setup-alpine]]&amp;lt;/code&amp;gt; script offers the following configuration options:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Keyboard Layout&#039;&#039;&#039; (Local keyboard language and usage mode, e.g. &#039;&#039;us&#039;&#039; and variant of &#039;&#039;us-nodeadkeys&#039;&#039;.)&lt;br /&gt;
# &#039;&#039;&#039;Hostname&#039;&#039;&#039; (The name for the computer.)&lt;br /&gt;
# &#039;&#039;&#039;Network &#039;&#039;&#039; (Set up network connection to access Internet.)&lt;br /&gt;
#* Available interfaces are: &#039;&#039;&#039;eth0&#039;&#039;&#039; &#039;&#039;&#039;wlan0&#039;&#039;&#039;.(List depends on your hardware.)&lt;br /&gt;
#* Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0] (Enter &#039;done&#039; after configuring &#039;&#039;&#039;atleast&#039;&#039;&#039; one interface for Internet access.) &lt;br /&gt;
#* Do you want to do any manual network configuration? (y/n) [n] (Default uses &amp;quot;DHCP&amp;quot;.)  &lt;br /&gt;
# &#039;&#039;&#039;DNS Servers&#039;&#039;&#039; (If none of the interfaces configured in previous step uses dhcp, set DNS server. If unsure, leave DNS domain name blank and using &amp;lt;code&amp;gt;[https://quad9.net/ 9.9.9.9 2620:fe::fe]&amp;lt;/code&amp;gt; for DNS is typically adequate.)&lt;br /&gt;
# &#039;&#039;&#039;Root password&#039;&#039;&#039; (the password used to login to the root account)&lt;br /&gt;
# &#039;&#039;&#039;Timezone&#039;&#039;&#039; (Optionally display times/dates in your local time zone)&lt;br /&gt;
# &#039;&#039;&#039;HTTP/FTP Proxy&#039;&#039;&#039; (Proxy server to use for accessing the web/ftp. Use &amp;quot;none&amp;quot; for direct connections to websites and FTP servers.)&lt;br /&gt;
# &#039;&#039;&#039;Mirror&#039;&#039;&#039; (From where to download packages. Choose the organization you trust giving your usage patterns to.)&lt;br /&gt;
# &#039;&#039;&#039;Set up a user&#039;&#039;&#039; (Setting up a regular user account)&lt;br /&gt;
# &#039;&#039;&#039;NTP&#039;&#039;&#039; (Network Time Protocol client used for keeping the system clock in sync with a time server. Default is &amp;quot;busybox&amp;quot;.)&lt;br /&gt;
# &#039;&#039;&#039;SSH&#039;&#039;&#039; (Secure SHell remote access server. &amp;quot;OpenSSH&amp;quot; is part of the default install image. Use &amp;quot;none&amp;quot; to disable remote login, e.g. on laptops.)&lt;br /&gt;
# In most cases, either one of following line(s) is displayed as follows: &lt;br /&gt;
#: &#039;&#039;&#039;No disks found.&#039;&#039;&#039; or &#039;&#039;&#039; Available disks are: sda (128.0 GB JMicron  Tech )&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Disk Mode&#039;&#039;&#039; ( A pre-setup of the &amp;quot;diskless&amp;quot; system or base configuration is completed by answering &amp;quot;none&amp;quot; when asked for the following questions.) &lt;br /&gt;
#* Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) &#039;&#039;&#039;none&#039;&#039;&#039;&lt;br /&gt;
#* Enter where to store configs (/media/ or &#039;none&#039;) &#039;&#039;&#039;none&#039;&#039;&#039;&lt;br /&gt;
#* The location of the package cache &#039;&#039;&#039;none&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Base configuration is complete with the above step. Refer to the [[#Alternative courses of action|alternative courses of action]] to proceed further.&lt;br /&gt;
&lt;br /&gt;
=== setup-alpine based System Disk Install ===  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; script based system disk installation, needs an &#039;&#039;&#039; entire hard disk(s)&#039;&#039;&#039; for Alpine Linux and uses a partitioning layout with (/)root partition, /boot partition and a swap partition, where [[Alpine_setup_scripts#Environment_Variables|environment variables]] determine filesystem, size of the boot partition and the bootloader used.  If your use case matches the above, at the final step of [[#Base configuration|base configuration]], type the appropriate hard disk &#039;&#039;&#039;device name&#039;&#039;&#039; instead of &#039;&#039;&#039;none&#039;&#039;&#039;. If multiple disks are chosen, [[Alpine_setup_scripts#RAID|RAID]] is used.&lt;br /&gt;
 &lt;br /&gt;
* At the &#039;&#039;&#039;Disk Mode&#039;&#039;&#039; stage, &#039;&#039;&#039;sda&#039;&#039;&#039; or relevant disk(s) must be chosen in the below screen:&lt;br /&gt;
** Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) &#039;&#039;&#039;sda&#039;&#039;&#039;&lt;br /&gt;
** Confirmation for the chosen disk(s) appears. &#039;&#039;The following disk is selected:&#039;&#039; &#039;&#039;&#039;sda    (128.0 GB JMicron  Tech ).&#039;&#039;&#039; &lt;br /&gt;
{{Warning|Pay close attention to the disk name and size. If you enter &#039;&#039;&#039;sys&#039;&#039;&#039; in the next step, no further questions will be asked and data on the chosen disk(s) will be overwritten!. Enter {{key|Ctrl}}+{{key|c}} to abort the installation process. Proceed only if you are 100% sure.}}&lt;br /&gt;
* How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) &#039;&#039;&#039;sys&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If &#039;&#039;&#039;sys&#039;&#039;&#039; is chosen, the &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; script will complete the traditional hard-disk installation of Alpine Linux on the chosen disk(s) without further questions.  Once the installation is complete, you can skip the next steps and proceed to [[#Reboot|reboot]] the system to boot into the newly installed Alpine Linux and [[Installation#Post-Installation|configure]] further.&lt;br /&gt;
&lt;br /&gt;
=== Custom partitioning  ===&lt;br /&gt;
&lt;br /&gt;
[[Setting_up_disks_manually#Manual_partitioning|Manual partitioning]] of the harddisk may be needed to prepare the harddisk for &amp;quot;sys&amp;quot; mode install using [[Setting_up_disks_manually|&amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt;]] and for storing the config file using [[Alpine_local_backup|&amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt;]] and package cache for [[Diskless Mode|Diskless]] and for /var mount for [[Data Disk Mode|Data disk]] mode installs. Refer [[Setting up disks manually|Setting up disks manually]] page for specific configurations related to [[Setting_up_disks_manually#RAID|RAID]], [[Setting_up_disks_manually#Encryption|encryption]], [[Setting_up_disks_manually#LVM|LVM]], etc...&lt;br /&gt;
&lt;br /&gt;
=== Preparing for the first boot ===&lt;br /&gt;
If [[#System_Disk_Mode|System Disk Mode]] of installation was performed, ignore this section and proceed to [[#Reboot|reboot]].&lt;br /&gt;
&lt;br /&gt;
If the new local system was configured to run in &amp;quot;diskless&amp;quot; or &amp;quot;data&amp;quot; mode, and you do not want keep booting from the initial (and possibly read-only) [[Installation#Preparing_installation_media|installation media]], create a  [[Create_a_Bootable_Device|customizable boot device]]. Once everything is in place, save your customized configuration with {{ic|lbu commit}} before rebooting.&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
First, remove the initial installation media from the boot drive, or detach it from the port it&#039;s connected to. The system may now be power-cycled or rebooted to confirm everything is working correctly. The relevant commands for this are {{ic|poweroff}} or {{ic|reboot}}. Login into the new system with the root account.&lt;br /&gt;
&lt;br /&gt;
=== Completing the installation ===&lt;br /&gt;
&lt;br /&gt;
The installation script installs only the base operating system. &#039;&#039;&#039;No&#039;&#039;&#039; applications e.g. web server, mail server, desktop environment, or web browsers are installed.&lt;br /&gt;
&lt;br /&gt;
Please look at [[Installation#Post-Installation|Post-Installation]], for some common things to do after installation.&lt;br /&gt;
&lt;br /&gt;
== Custom Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- COMMENT FOR EDITORS&lt;br /&gt;
Specific topics should be kept on separate pages and manageable category-pages only must get listed with direct reference on this general page.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* [[Installation on a headless host]]&lt;br /&gt;
* [[Kernels]] &#039;&#039;(kernel selection, e.g. for VMs or RPi)&#039;&#039;&lt;br /&gt;
* [[How to make a custom ISO image with mkimage]] &#039;&#039;(installation media with its own configuration)&#039;&#039;&lt;br /&gt;
* [[Directly booting an ISO file]] &#039;&#039;(without flashing it to a disk or device)&#039;&#039;&lt;br /&gt;
* [[Alpine Linux in a chroot]]&lt;br /&gt;
* [[Netboot Alpine Linux using iPXE]]&lt;br /&gt;
* [[:Category:Virtualization|Virtualization]]&lt;br /&gt;
* [[Using an answerfile with setup-alpine]]&lt;br /&gt;
&lt;br /&gt;
Also see other [[:Category:Installation|Installation category]] pages.&lt;br /&gt;
&lt;br /&gt;
== Post-Installation ==&lt;br /&gt;
&lt;br /&gt;
{{Tip|Alpine Linux packages stay close to the upstream design. Therefore, all upstream documentation about configuring a software package, as well as good configuration guides from other distributions that stay close to upstream, e.g. those in the [https://wiki.archlinux.org/ ArchWiki], or [https://wiki.gentoo.org/wiki/ Gentoo wiki] are to a large degree, also applicable to configuring the software on Alpine Linux, thus can be very useful.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- COMMENT FOR EDITORS&lt;br /&gt;
If you edit Post-Install,&lt;br /&gt;
&lt;br /&gt;
  * Consider that there are already [[Tutorials_and_Howtos#Post-Install]], [[Developer_Documentation#Package_management]] [[Daily driver guide]] and the Handbook, please work towards reducing duplication and providing an overview, and maintaining topic details of considerable size on their own pages.&lt;br /&gt;
  * Here, only the most relevant jumping off points are listed, not exact list duplicates!!!&lt;br /&gt;
  * Keep short-list of links here, as overview to more detailed topic specific pages.&lt;br /&gt;
  * Don&#039;t aggregate different topics at yet another place.&lt;br /&gt;
Any topic related to configuring Alpine as Desktop workstation i.e as a daily driver must go to the [[Daily driver guide]] or [[Tutorials_and_Howtos#Desktop|Desktop]]section. Links to Tutorial and How To&#039;s should be added to [[Tutorials_and_Howtos]] and not added here.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* [[Tutorials_and_Howtos#Desktop|Guide to daily drive]] Alpine Linux as a desktop OS&lt;br /&gt;
* [[Tutorials_and_Howtos#Services|Hosting services]] like mail/web/ssh/Firewall/VPN servers &lt;br /&gt;
* [[Tutorials_and_Howtos#Virtualization|Virtualization]] guide for using Alpine Linux as both guest and host&lt;br /&gt;
* Guide to [[OpenRC|OpenRC]] - Init system used to configure services&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Tutorials and Howtos]]&lt;br /&gt;
* [[Comparison with other distros]] &#039;&#039;(how common things are done on Alpine)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Wackbyte</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Installation&amp;diff=30621</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Installation&amp;diff=30621"/>
		<updated>2025-07-30T20:34:26Z</updated>

		<summary type="html">&lt;p&gt;Wackbyte: /* Alternative courses of action */ formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:hdd_mount.png|left|link=]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page exists to provide a basic overview to get started. Before actually installing, it can help to skim through the [[Alpine_Linux:FAQ| Frequently Asked Questions (FAQ)]], as well as to refer to the official installation guide at [https://docs.alpinelinux.org/ docs.alpinelinux.org].&lt;br /&gt;
&lt;br /&gt;
{{Tip|This is a wiki!&lt;br /&gt;
If something isn&#039;t correct, or is incomplete, you will have to figure it out, or ask for the correct solution in the [https://alpinelinux.org/community/ community].&lt;br /&gt;
&lt;br /&gt;
And then carefully [[Help:Editing|edit]] the wiki page.&lt;br /&gt;
&lt;br /&gt;
Just as those before who did it for you.}}&lt;br /&gt;
&lt;br /&gt;
== Minimal Hardware Requirements ==&lt;br /&gt;
{{Main|Requirements}}&lt;br /&gt;
* At least 128 MB of RAM. [A graphical desktop system may require up to 512 minimum.]. Note that an installation itself (from ISO) generally requires at least 320 MB during installation.&lt;br /&gt;
* At least 0-700 MB space on a writable storage device. [Only required in [[#System Disk Mode|&amp;quot;sys&amp;quot;]] or [[#Data Disk Mode|&amp;quot;data&amp;quot;]] mode installations. It is optional in [[#Diskless Mode|&amp;quot;diskless&amp;quot;]] mode, where it may be used to save newer data and configurations states of a running system.]&lt;br /&gt;
* A working internet connection is required to complete [[#System Disk Mode|&amp;quot;sys&amp;quot;]] mode installation or use &#039;&#039;&#039;Extended image&#039;&#039;&#039; if available for your architecture.&lt;br /&gt;
&lt;br /&gt;
{{Note|Refer [[#Custom Installation Instructions|custom installation instructions]] for headless system, virtualization etc. Most of the steps outlined on this page applies to all [[Architecture#Architectures_supported|Architectures]] supported by Alpine Linux. For more specific installation instructions, refer to their respective pages.}}&lt;br /&gt;
&lt;br /&gt;
== Installation Overview ==&lt;br /&gt;
&lt;br /&gt;
Alpine Linux can be installed and run in [[Setting_up_disks_manually#Alpine_Linux_modes|three modes]]  i.e [[#Diskless_Mode|Diskless Mode]], [[#Data_Disk_Mode|Data Disk Mode]] and [[#System_Disk_Mode|System Disk Mode]]. The installation procedure for Alpine Linux &#039;&#039;&#039;requires basic understanding of the three modes&#039;&#039;&#039; explained in brief below: &lt;br /&gt;
&lt;br /&gt;
==== Diskless Mode ====&lt;br /&gt;
{{Main|Diskless Mode}}&lt;br /&gt;
In Diskless mode the entire operating system with all applications are first loaded into RAM and then only run from there. This mode is extremely fast and can save on unnecessary disk spin-ups, power, and wear.  Alpine Linux uses this method to boot the .iso installation images. The [[Alpine_setup_scripts#setup-alpine|&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;]] script configures the installed system to continue to boot like this if &amp;quot;disk=none&amp;quot; is specified.&lt;br /&gt;
&lt;br /&gt;
==== Data Disk Mode ====&lt;br /&gt;
{{Main|Data Disk Mode}}&lt;br /&gt;
In Data Disk mode also the operating system  runs from system RAM, thus it enjoys the same accelerated operation speed as &amp;quot;diskless&amp;quot; mode. However, swap storage and the entire {{Path|/var}} directory tree get mounted from a persistent storage device. This mode is useful for having RAM accelerated servers with variable amounts of user-data that exceed the available RAM size. &lt;br /&gt;
&lt;br /&gt;
==== System Disk Mode ====&lt;br /&gt;
&lt;br /&gt;
System or &#039;&#039;&#039;sys&#039;&#039;&#039; Disk Mode is the traditional hard-disk install. Alpine Linux can be installed to an entire [[#setup-alpine based System Disk Install|&#039;&#039;&#039;hard disk&#039;&#039;&#039;]] using &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; script or to custom partitions using [[Setting_up_disks_manually|&amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt;]]. For further info, refer [[Setting_up_disks_manually|System Disk Mode]]. &lt;br /&gt;
&lt;br /&gt;
=== General course of action ===&lt;br /&gt;
&lt;br /&gt;
It is really helpful for many use cases to [[#Preparing for the installation|prepare]] and complete the [[#Installation Step Details|installation]] until the [[#Base configuration|base configuration]] step, then proceed with installation of the target system with any one of the various [[#Alternative courses of action|alternative]] courses of action.&lt;br /&gt;
&lt;br /&gt;
=== Alternative courses of action ===&lt;br /&gt;
&lt;br /&gt;
Examples of preparation options:&lt;br /&gt;
&lt;br /&gt;
* Download some specific driver to configure the hardware, and/or install some software tool that may be missing in the live system by using the Alpine package manager &amp;lt;code&amp;gt;[[Alpine Package Keeper|apk]]&amp;lt;/code&amp;gt;.  &lt;br /&gt;
* Do a [[Setting up disks manually#Manual partitioning|manual partitioning]] of the hard disk that avoids overwrite of an entire disk.&lt;br /&gt;
&lt;br /&gt;
Examples of such options:&lt;br /&gt;
&lt;br /&gt;
* To install Alpine Linux on an &#039;&#039;&#039;entire hard disk&#039;&#039;&#039; with optional [[Alpine setup scripts#Environment Variables|environment variables]], proceed to [[#setup-alpine based System Disk Install|setup-alpine based System Disk Install]].&lt;br /&gt;
* Use {{ic|setup-disk}} script to complete a [[Setting up disks manually|traditional hard disk installation]] on a partition or to [[Dualbooting|dualboot]] or to configure [[Setting up disks manually#RAID|RAID]], [[Setting up disks manually#Encryption|encryption]] or [[Setting up disks manually#LVM|LVM]] for [[#System Disk Mode|&amp;quot;system&amp;quot;]] disk mode or to add a [[#Data Disk Mode|&amp;quot;data&amp;quot;]] mode partition.&lt;br /&gt;
* Create a [[Create a Bootable Device#Using setup-bootable|customizable boot media]] i.e a boot device with a writable filesystem for &#039;&#039;&#039;[[#Diskless Mode|diskless]]&#039;&#039;&#039; or &#039;&#039;&#039;[[#Data Disk Mode|data]]&#039;&#039;&#039; disk-mode.&lt;br /&gt;
* Configure a [[Diskless Mode#Using an internal disk for persistent storage|internal disk for persistent storage]] to save the local configuration state and local package cache for the [[#Diskless Mode|diskless]] system or &#039;&#039;&#039;[[#Data Disk Mode|data]]&#039;&#039;&#039; disk-mode.&lt;br /&gt;
&lt;br /&gt;
There are many more [[Alpine setup scripts|setup-scripts]] available. All these tools may also be run later to adjust specific configurations. For example, to set up a graphical environment as covered under [[#Post-Installation|Post-Installation]] below.&lt;br /&gt;
&lt;br /&gt;
== Preparing for the installation ==&lt;br /&gt;
&lt;br /&gt;
=== Downloading installation image ===&lt;br /&gt;
&lt;br /&gt;
Installation image files are available in &#039;&#039;&#039;iso&#039;&#039;&#039; or &#039;&#039;&#039;tar.gz&#039;&#039;&#039; or &#039;&#039;&#039;img.gz&#039;&#039;&#039; formats. Download the [https://alpinelinux.org/downloads/ stable-release installation image-file] for the target computer&#039;s architecture with their corresponding &amp;lt;code&amp;gt;sha256&amp;lt;/code&amp;gt; (checksum) and &amp;lt;code&amp;gt;GPG&amp;lt;/code&amp;gt; (signature) files. &lt;br /&gt;
{{Tip| Download &amp;lt;code&amp;gt;sha256&amp;lt;/code&amp;gt; (checksum) and &amp;lt;code&amp;gt;GPG&amp;lt;/code&amp;gt; (signature) files only from [https://alpinelinux.org/downloads/ official] site and not from mirrors.}}&lt;br /&gt;
&lt;br /&gt;
Now you have three files of the following format.. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alpine-standard-*.iso&lt;br /&gt;
alpine-standard-*.iso.sha256&lt;br /&gt;
alpine-standard-*.iso.asc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;alpine-standard-{{AlpineLatest}}-x86_64.iso&#039;&#039; is the &#039;&#039;&#039;{{AlpineLatest}}&#039;&#039;&#039; version &#039;&#039;&#039;Standard&#039;&#039;&#039; image file in &#039;&#039;&#039;iso&#039;&#039;&#039; format for &#039;&#039;&#039;x86_64&#039;&#039;&#039; architecture.&lt;br /&gt;
&lt;br /&gt;
=== Verifying downloaded image ===&lt;br /&gt;
&lt;br /&gt;
From Security point of view, verify the downloaded image file for both checksum and GPG signature before proceeding further. The three required utilities i.e &amp;lt;code&amp;gt;sha256&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gpg&amp;lt;/code&amp;gt; or their equivalents are available in every operating system including Linux, windows, Mac and BSD derivaties. &lt;br /&gt;
&lt;br /&gt;
{{Tip|Ensure that all the three downloaded files remain in the same folder. If not, adjust the commands accordingly.}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;sha256&amp;lt;/code&amp;gt; checksum verifies the integrity of the downloaded image i.e no modifications occurred during download.&lt;br /&gt;
{{Cmd|sha256sum -c alpine-*.iso.&#039;&#039;&#039;sha256&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;GPG&amp;lt;/code&amp;gt; signature verifies the link between the downloaded image to the individual who signed it. Signature verification involves two steps:&lt;br /&gt;
&lt;br /&gt;
Step 1. Download and import the gpg signature from official website &lt;br /&gt;
{{Cmd|curl https://alpinelinux.org/keys/ncopa.asc &amp;amp;#124; gpg --import ;}}&lt;br /&gt;
&lt;br /&gt;
Step 2. Verify that the image signature matches with the one downloaded in Step 1.&lt;br /&gt;
{{Cmd|gpg --verify alpine-*.iso.&#039;&#039;&#039;asc&#039;&#039;&#039; alpine-*.&#039;&#039;&#039;iso&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
=== Preparing installation media  ===&lt;br /&gt;
{{Seealso|Burning ISOs}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|All data currently on the installation media will be &#039;&#039;&#039;erased&#039;&#039;&#039;, when Alpine Linux installation image is written on it. Correctly identify the device name for the installation media using commands &amp;lt;code&amp;gt;lsblk&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;blkid&amp;lt;/code&amp;gt;.}} &lt;br /&gt;
If downloaded image file is in &#039;&#039;&#039;img.gz&#039;&#039;&#039; format, unzip it using the command {{ic|gunzip alpine-rpi-{{AlpineLatest}}-aarch64.img.gz}} to {{ic|alpine-rpi-{{AlpineLatest}}-aarch64.img}} first before using with {{ic|dd}} command. In Linux {{ic|dd}} command can be used to write image files in both &#039;&#039;&#039;iso&#039;&#039;&#039; and &#039;&#039;&#039;img&#039;&#039;&#039; format to the installation media. &lt;br /&gt;
&lt;br /&gt;
If &#039;&#039;&#039;tar.gz&#039;&#039;&#039; format image file is downloaded, follow the [[Create a Bootable Device#Manually copying Alpine files|instructions]] to create the installation media.&lt;br /&gt;
&lt;br /&gt;
Modify the input file(&#039;&#039;&#039;if&#039;&#039;&#039;)  of the {{ic|dd}} command according to the name and path to your image file and and the target device i.e output file(&#039;&#039;&#039;of&#039;&#039;&#039;) should be a device name &#039;&#039;&#039;/dev/sdX&#039;&#039;&#039; instead of partition like &#039;&#039;&#039;/dev/sdbXY&#039;&#039;&#039;:{{Cmd|# dd if{{=}}alpine-standard-{{AlpineLatest}}-x86_64.iso of{{=}}/dev/sdX bs{{=}}4M status{{=}}progress; eject /dev/sdX}}&lt;br /&gt;
&lt;br /&gt;
If your version of &amp;lt;code&amp;gt;dd&amp;lt;/code&amp;gt; does not support the option &amp;quot;status=progress&amp;quot;, remove it. The &amp;lt;code&amp;gt;eject&amp;lt;/code&amp;gt; command removes the target device from the system and ensures the write cache is completely flushed.&lt;br /&gt;
&lt;br /&gt;
In Windows and Mac OS, [https://www.balena.io/etcher/  Etcher] can be used to create an installation media.&lt;br /&gt;
&lt;br /&gt;
===  Verifying Installation media ===&lt;br /&gt;
&lt;br /&gt;
After detaching and re-attaching the device, a bit-wise comparison can verify the data written to the device (instead of just data buffered in RAM). If the comparison terminates with an end-of-file error on the .iso file side, all the contents from the image have been written (and re-read) successfully:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# cmp ~/Downloads/alpine-standard-{{AlpineLatest}}-x86_64.iso /dev/sdX &lt;br /&gt;
 cmp: EOF on alpine-standard-{{AlpineLatest}}-x86_64.iso&amp;lt;/Code&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Booting Installation Media ===&lt;br /&gt;
&lt;br /&gt;
Insert the [[#Preparing_installation_media|Installation media]] to a proper drive or port of the computer and turn the machine on, or restart it, if already running.&lt;br /&gt;
{{Note| To successfully boot and install Alpine Linux, disable [[UEFI#Secure boot|secure boot]] in the BIOS. Once Alpine Linux is installed, this can be [[UEFI_Secure_Boot|enabled]].}}&lt;br /&gt;
If the computer does not automatically boot from the desired device, one needs to bring up the boot menu and choose the media to boot from. Depending on the computer, the menu may be accessed by repeatedly pressing a key quickly when booting starts. Some computers require that you press the button &#039;&#039;before&#039;&#039; starting the computer and hold it down while the computer boots. Typical keys are:  {{key|F9}}-{{key|F12}}, sometimes {{key|F7}} or {{key|F8}}. If these don&#039;t bring up the boot menu, it may be necessary to enter the BIOS configuration and adjust the boot settings, for which typical keys are: {{key|Del}} {{key|F1}} {{key|F2}} {{key|F6}} or {{key|Esc}}.&lt;br /&gt;
&lt;br /&gt;
== Installation Step Details ==&lt;br /&gt;
&lt;br /&gt;
=== Boot Process ===&lt;br /&gt;
&lt;br /&gt;
The boot process of the alpine installation image first copies the entire operating system into the RAM memory, and then starts a complete Alpine Linux system from there. It will initially only provide a basic command line environment that does not depend on reading from any (possibly slow) initial boot media, anymore.&lt;br /&gt;
&lt;br /&gt;
Local log-in is possible as the user &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt;. Initially, the &#039;&#039;&#039;root&#039;&#039;&#039; user has no password.&lt;br /&gt;
&lt;br /&gt;
At the command prompt, an interactive script named [[Alpine_setup_scripts#setup-alpine|&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;]] is available to configure and install Alpine Linux. The script can be customized by the optional [[Alpine_setup_scripts#Environment_Variables|environment variables]], in case of [[Installation#Data_Disk_Mode|&#039;&#039;&#039;&amp;quot;data&amp;quot;&#039;&#039;&#039;]] or [[Installation#System_Disk_Mode|&#039;&#039;&#039;&amp;quot;sys&amp;quot;&#039;&#039;&#039;]] mode. For e.g {{Codeline|&amp;lt;code&amp;gt;USE_EFI{{=}}1 BOOT_SIZE{{=}}512 setup-alpine&amp;lt;/code&amp;gt;}}, sets the disklabel type to gpt, creates 512MB &#039;&#039;&#039;/boot&#039;&#039;&#039; partition with &#039;&#039;&#039;vfat&#039;&#039;&#039; filesystem and uses &amp;lt;code&amp;gt;grub&amp;lt;/code&amp;gt; as bootloader.&lt;br /&gt;
&lt;br /&gt;
=== Base configuration ===&lt;br /&gt;
&lt;br /&gt;
Launch the Alpine Linux Installation by running the [[Alpine_setup_scripts#setup-alpine|&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;]] script :&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# setup-alpine}}&lt;br /&gt;
&lt;br /&gt;
The question-and-answer dialog of &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; takes care of the base configuration. It sets up a network connection to access Internet to configure the system to boot into one of three different Alpine Linux &amp;quot;disk&amp;quot; modes:  [[Installation#Diskless_Mode|&#039;&#039;&#039;&amp;quot;diskless&amp;quot;&#039;&#039;&#039;(none)]],  [[Installation#Data_Disk_Mode|&#039;&#039;&#039;&amp;quot;data&amp;quot;&#039;&#039;&#039;]]  or [[Installation#System_Disk_Mode|&#039;&#039;&#039;&amp;quot;sys&amp;quot;&#039;&#039;&#039;]]. If you choose to edit any option, the relevant file is opened in [[BusyBox#vi| &#039;&#039;&#039;vi&#039;&#039;&#039; editor]] for editing.&lt;br /&gt;
&lt;br /&gt;
{{Tip| If you have access to a wired network, consider using [https://docs.alpinelinux.org/user-handbook/0.1a/Installing/setup_alpine.html#_setup_alpine_q Quick Mode], to complete the base configuration quickly.}}&lt;br /&gt;
&lt;br /&gt;
[[File:Installation-alpine-alpine-setup-3-setup-scripts.png|350px|thumb|right|Example &amp;lt;code&amp;gt;[[Alpine_setup_scripts#setup-alpine|setup-alpine]]&amp;lt;/code&amp;gt; session]]&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;[[Alpine_setup_scripts#setup-alpine|setup-alpine]]&amp;lt;/code&amp;gt; script offers the following configuration options:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Keyboard Layout&#039;&#039;&#039; (Local keyboard language and usage mode, e.g. &#039;&#039;us&#039;&#039; and variant of &#039;&#039;us-nodeadkeys&#039;&#039;.)&lt;br /&gt;
# &#039;&#039;&#039;Hostname&#039;&#039;&#039; (The name for the computer.)&lt;br /&gt;
# &#039;&#039;&#039;Network &#039;&#039;&#039; (Set up network connection to access Internet.)&lt;br /&gt;
#* Available interfaces are: &#039;&#039;&#039;eth0&#039;&#039;&#039; &#039;&#039;&#039;wlan0&#039;&#039;&#039;.(List depends on your hardware.)&lt;br /&gt;
#* Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0] (Enter &#039;done&#039; after configuring &#039;&#039;&#039;atleast&#039;&#039;&#039; one interface for Internet access.) &lt;br /&gt;
#* Do you want to do any manual network configuration? (y/n) [n] (Default uses &amp;quot;DHCP&amp;quot;.)  &lt;br /&gt;
# &#039;&#039;&#039;DNS Servers&#039;&#039;&#039; (If none of the interfaces configured in previous step uses dhcp, set DNS server. If unsure, leave DNS domain name blank and using &amp;lt;code&amp;gt;[https://quad9.net/ 9.9.9.9 2620:fe::fe]&amp;lt;/code&amp;gt; for DNS is typically adequate.)&lt;br /&gt;
# &#039;&#039;&#039;Root password&#039;&#039;&#039; (the password used to login to the root account)&lt;br /&gt;
# &#039;&#039;&#039;Timezone&#039;&#039;&#039; (Optionally display times/dates in your local time zone)&lt;br /&gt;
# &#039;&#039;&#039;HTTP/FTP Proxy&#039;&#039;&#039; (Proxy server to use for accessing the web/ftp. Use &amp;quot;none&amp;quot; for direct connections to websites and FTP servers.)&lt;br /&gt;
# &#039;&#039;&#039;Mirror&#039;&#039;&#039; (From where to download packages. Choose the organization you trust giving your usage patterns to.)&lt;br /&gt;
# &#039;&#039;&#039;Set up a user&#039;&#039;&#039; (Setting up a regular user account)&lt;br /&gt;
# &#039;&#039;&#039;NTP&#039;&#039;&#039; (Network Time Protocol client used for keeping the system clock in sync with a time server. Default is &amp;quot;busybox&amp;quot;.)&lt;br /&gt;
# &#039;&#039;&#039;SSH&#039;&#039;&#039; (Secure SHell remote access server. &amp;quot;OpenSSH&amp;quot; is part of the default install image. Use &amp;quot;none&amp;quot; to disable remote login, e.g. on laptops.)&lt;br /&gt;
# In most cases, either one of following line(s) is displayed as follows: &lt;br /&gt;
#: &#039;&#039;&#039;No disks found.&#039;&#039;&#039; or &#039;&#039;&#039; Available disks are: sda (128.0 GB JMicron  Tech )&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Disk Mode&#039;&#039;&#039; ( A pre-setup of the &amp;quot;diskless&amp;quot; system or base configuration is completed by answering &amp;quot;none&amp;quot; when asked for the following questions.) &lt;br /&gt;
#* Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) &#039;&#039;&#039;none&#039;&#039;&#039;&lt;br /&gt;
#* Enter where to store configs (/media/ or &#039;none&#039;) &#039;&#039;&#039;none&#039;&#039;&#039;&lt;br /&gt;
#* The location of the package cache &#039;&#039;&#039;none&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Base configuration is complete with the above step. Refer to the [[#Alternative courses of action|alternative courses of action]] to proceed further.&lt;br /&gt;
&lt;br /&gt;
=== setup-alpine based System Disk Install ===  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; script based system disk installation, needs an &#039;&#039;&#039; entire hard disk(s)&#039;&#039;&#039; for Alpine Linux and uses a partitioning layout with (/)root partition, /boot partition and a swap partition, where [[Alpine_setup_scripts#Environment_Variables|environment variables]] determine filesystem, size of the boot partition and the bootloader used.  If your use case matches the above, at the final step of [[#Base configuration|base configuration]], type the appropriate hard disk &#039;&#039;&#039;device name&#039;&#039;&#039; instead of &#039;&#039;&#039;none&#039;&#039;&#039;. If multiple disks are chosen, [[Alpine_setup_scripts#RAID|RAID]] is used.&lt;br /&gt;
 &lt;br /&gt;
* At the &#039;&#039;&#039;Disk Mode&#039;&#039;&#039; stage, &#039;&#039;&#039;sda&#039;&#039;&#039; or relevant disk(s) must be chosen in the below screen:&lt;br /&gt;
** Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) &#039;&#039;&#039;sda&#039;&#039;&#039;&lt;br /&gt;
** Confirmation for the chosen disk(s) appears. &#039;&#039;The following disk is selected:&#039;&#039; &#039;&#039;&#039;sda    (128.0 GB JMicron  Tech ).&#039;&#039;&#039; &lt;br /&gt;
{{Warning|Pay close attention to the disk name and size. If you enter &#039;&#039;&#039;sys&#039;&#039;&#039; in the next step, no further questions will be asked and data on the chosen disk(s) will be overwritten!. Enter {{key|Ctrl}}+{{key|c}} to abort the installation process. Proceed only if you are 100% sure.}}&lt;br /&gt;
* How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) &#039;&#039;&#039;sys&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If &#039;&#039;&#039;sys&#039;&#039;&#039; is chosen, the &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; script will complete the traditional hard-disk installation of Alpine Linux on the chosen disk(s) without further questions.  Once the installation is complete, you can skip the next steps and proceed to [[#Reboot|reboot]] the system to boot into the newly installed Alpine Linux and [[Installation#Post-Installation|configure]] further.&lt;br /&gt;
&lt;br /&gt;
=== Custom partitioning  ===&lt;br /&gt;
&lt;br /&gt;
[[Setting_up_disks_manually#Manual_partitioning|Manual partitioning]] of the harddisk may be needed to prepare the harddisk for &amp;quot;sys&amp;quot; mode install using [[Setting_up_disks_manually|&amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt;]] and for storing the config file using [[Alpine_local_backup|&amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt;]] and package cache for [[Diskless Mode|Diskless]] and for /var mount for [[Data Disk Mode|Data disk]] mode installs. Refer [[Setting up disks manually|Setting up disks manually]] page for specific configurations related to [[Setting_up_disks_manually#RAID|RAID]], [[Setting_up_disks_manually#Encryption|encryption]], [[Setting_up_disks_manually#LVM|LVM]], etc...&lt;br /&gt;
&lt;br /&gt;
=== Preparing for the first boot ===&lt;br /&gt;
If [[#System_Disk_Mode|System Disk Mode]] of installation was performed, ignore this section and proceed to [[#Reboot|reboot]].&lt;br /&gt;
&lt;br /&gt;
If the new local system was configured to run in &amp;quot;diskless&amp;quot; or &amp;quot;data&amp;quot; mode, and you do not want keep booting from the initial (and possibly read-only) [[Installation#Preparing_installation_media|installation media]], create a  [[Create_a_Bootable_Device|customizable boot device]]. Once everything is in place, save your customized configuration with {{ic|lbu commit}} before rebooting.&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
First, remove the initial installation media from the boot drive, or detach it from the port it&#039;s connected to. The system may now be power-cycled or rebooted to confirm everything is working correctly. The relevant commands for this are {{ic|poweroff}} or {{ic|reboot}}. Login into the new system with the root account.&lt;br /&gt;
&lt;br /&gt;
=== Completing the installation ===&lt;br /&gt;
&lt;br /&gt;
The installation script installs only the base operating system. &#039;&#039;&#039;No&#039;&#039;&#039; applications e.g. web server, mail server, desktop environment, or web browsers are installed.&lt;br /&gt;
&lt;br /&gt;
Please look at [[Installation#Post-Installation|Post-Installation]], for some common things to do after installation.&lt;br /&gt;
&lt;br /&gt;
== Custom Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- COMMENT FOR EDITORS&lt;br /&gt;
Specific topics should be kept on separate pages and manageable category-pages only must get listed with direct reference on this general page.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* [[Installation on a headless host]]&lt;br /&gt;
* [[Kernels]] &#039;&#039;(kernel selection, e.g. for VMs or RPi)&#039;&#039;&lt;br /&gt;
* [[How to make a custom ISO image with mkimage]] &#039;&#039;(installation media with its own configuration)&#039;&#039;&lt;br /&gt;
* [[Directly booting an ISO file]] &#039;&#039;(without flashing it to a disk or device)&#039;&#039;&lt;br /&gt;
* [[Alpine Linux in a chroot]]&lt;br /&gt;
* [[Netboot Alpine Linux using iPXE]]&lt;br /&gt;
* [[:Category:Virtualization|Virtualization]]&lt;br /&gt;
* [[Using an answerfile with setup-alpine]]&lt;br /&gt;
&lt;br /&gt;
Also see other [[:Category:Installation|Installation category]] pages.&lt;br /&gt;
&lt;br /&gt;
== Post-Installation ==&lt;br /&gt;
&lt;br /&gt;
{{Tip|Alpine Linux packages stay close to the upstream design. Therefore, all upstream documentation about configuring a software package, as well as good configuration guides from other distributions that stay close to upstream, e.g. those in the [https://wiki.archlinux.org/ ArchWiki], or [https://wiki.gentoo.org/wiki/ Gentoo wiki] are to a large degree, also applicable to configuring the software on Alpine Linux, thus can be very useful.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- COMMENT FOR EDITORS&lt;br /&gt;
If you edit Post-Install,&lt;br /&gt;
&lt;br /&gt;
  * Consider that there are already [[Tutorials_and_Howtos#Post-Install]], [[Developer_Documentation#Package_management]] [[Daily driver guide]] and the Handbook, please work towards reducing duplication and providing an overview, and maintaining topic details of considerable size on their own pages.&lt;br /&gt;
  * Here, only the most relevant jumping off points are listed, not exact list duplicates!!!&lt;br /&gt;
  * Keep short-list of links here, as overview to more detailed topic specific pages.&lt;br /&gt;
  * Don&#039;t aggregate different topics at yet another place.&lt;br /&gt;
Any topic related to configuring Alpine as Desktop workstation i.e as a daily driver must go to the [[Daily driver guide]] or [[Tutorials_and_Howtos#Desktop|Desktop]]section. Links to Tutorial and How To&#039;s should be added to [[Tutorials_and_Howtos]] and not added here.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* [[Tutorials_and_Howtos#Desktop|Guide to daily drive]] Alpine Linux as a desktop OS&lt;br /&gt;
* [[Tutorials_and_Howtos#Services|Hosting services]] like mail/web/ssh/Firewall/VPN servers &lt;br /&gt;
* [[Tutorials_and_Howtos#Virtualization|Virtualization]] guide for using Alpine Linux as both guest and host&lt;br /&gt;
* Guide to [[OpenRC|OpenRC]] - Init system used to configure services&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Tutorials and Howtos]]&lt;br /&gt;
* [[Comparison with other distros]] &#039;&#039;(how common things are done on Alpine)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Wackbyte</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Installation&amp;diff=30620</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Installation&amp;diff=30620"/>
		<updated>2025-07-30T20:29:27Z</updated>

		<summary type="html">&lt;p&gt;Wackbyte: /* General course of action */ formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:hdd_mount.png|left|link=]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page exists to provide a basic overview to get started. Before actually installing, it can help to skim through the [[Alpine_Linux:FAQ| Frequently Asked Questions (FAQ)]], as well as to refer to the official installation guide at [https://docs.alpinelinux.org/ docs.alpinelinux.org].&lt;br /&gt;
&lt;br /&gt;
{{Tip|This is a wiki!&lt;br /&gt;
If something isn&#039;t correct, or is incomplete, you will have to figure it out, or ask for the correct solution in the [https://alpinelinux.org/community/ community].&lt;br /&gt;
&lt;br /&gt;
And then carefully [[Help:Editing|edit]] the wiki page.&lt;br /&gt;
&lt;br /&gt;
Just as those before who did it for you.}}&lt;br /&gt;
&lt;br /&gt;
== Minimal Hardware Requirements ==&lt;br /&gt;
{{Main|Requirements}}&lt;br /&gt;
* At least 128 MB of RAM. [A graphical desktop system may require up to 512 minimum.]. Note that an installation itself (from ISO) generally requires at least 320 MB during installation.&lt;br /&gt;
* At least 0-700 MB space on a writable storage device. [Only required in [[#System Disk Mode|&amp;quot;sys&amp;quot;]] or [[#Data Disk Mode|&amp;quot;data&amp;quot;]] mode installations. It is optional in [[#Diskless Mode|&amp;quot;diskless&amp;quot;]] mode, where it may be used to save newer data and configurations states of a running system.]&lt;br /&gt;
* A working internet connection is required to complete [[#System Disk Mode|&amp;quot;sys&amp;quot;]] mode installation or use &#039;&#039;&#039;Extended image&#039;&#039;&#039; if available for your architecture.&lt;br /&gt;
&lt;br /&gt;
{{Note|Refer [[#Custom Installation Instructions|custom installation instructions]] for headless system, virtualization etc. Most of the steps outlined on this page applies to all [[Architecture#Architectures_supported|Architectures]] supported by Alpine Linux. For more specific installation instructions, refer to their respective pages.}}&lt;br /&gt;
&lt;br /&gt;
== Installation Overview ==&lt;br /&gt;
&lt;br /&gt;
Alpine Linux can be installed and run in [[Setting_up_disks_manually#Alpine_Linux_modes|three modes]]  i.e [[#Diskless_Mode|Diskless Mode]], [[#Data_Disk_Mode|Data Disk Mode]] and [[#System_Disk_Mode|System Disk Mode]]. The installation procedure for Alpine Linux &#039;&#039;&#039;requires basic understanding of the three modes&#039;&#039;&#039; explained in brief below: &lt;br /&gt;
&lt;br /&gt;
==== Diskless Mode ====&lt;br /&gt;
{{Main|Diskless Mode}}&lt;br /&gt;
In Diskless mode the entire operating system with all applications are first loaded into RAM and then only run from there. This mode is extremely fast and can save on unnecessary disk spin-ups, power, and wear.  Alpine Linux uses this method to boot the .iso installation images. The [[Alpine_setup_scripts#setup-alpine|&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;]] script configures the installed system to continue to boot like this if &amp;quot;disk=none&amp;quot; is specified.&lt;br /&gt;
&lt;br /&gt;
==== Data Disk Mode ====&lt;br /&gt;
{{Main|Data Disk Mode}}&lt;br /&gt;
In Data Disk mode also the operating system  runs from system RAM, thus it enjoys the same accelerated operation speed as &amp;quot;diskless&amp;quot; mode. However, swap storage and the entire {{Path|/var}} directory tree get mounted from a persistent storage device. This mode is useful for having RAM accelerated servers with variable amounts of user-data that exceed the available RAM size. &lt;br /&gt;
&lt;br /&gt;
==== System Disk Mode ====&lt;br /&gt;
&lt;br /&gt;
System or &#039;&#039;&#039;sys&#039;&#039;&#039; Disk Mode is the traditional hard-disk install. Alpine Linux can be installed to an entire [[#setup-alpine based System Disk Install|&#039;&#039;&#039;hard disk&#039;&#039;&#039;]] using &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; script or to custom partitions using [[Setting_up_disks_manually|&amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt;]]. For further info, refer [[Setting_up_disks_manually|System Disk Mode]]. &lt;br /&gt;
&lt;br /&gt;
=== General course of action ===&lt;br /&gt;
&lt;br /&gt;
It is really helpful for many use cases to [[#Preparing for the installation|prepare]] and complete the [[#Installation Step Details|installation]] until the [[#Base configuration|base configuration]] step, then proceed with installation of the target system with any one of the various [[#Alternative courses of action|alternative]] courses of action.&lt;br /&gt;
&lt;br /&gt;
=== Alternative courses of action ===&lt;br /&gt;
&lt;br /&gt;
Examples of preparation options:&lt;br /&gt;
&lt;br /&gt;
* Download some specific driver to configure the hardware, and/or install some software tool that may be missing in the live system by using the alpine package manager &amp;lt;code&amp;gt;[[Alpine_Package_Keeper|apk]]&amp;lt;/code&amp;gt;.  &lt;br /&gt;
* Do a [[Setting_up_disks_manually#Manual_partitioning|Manual partitioning]] of the harddisk that avoids overwrite of an entire disk.&lt;br /&gt;
&lt;br /&gt;
Examples of such options:&lt;br /&gt;
&lt;br /&gt;
* To install Alpine Linux on an &#039;&#039;&#039;entire hard disk&#039;&#039;&#039; with optional [[Alpine_setup_scripts#Environment_Variables|environment variables]], proceed to [[#setup-alpine_based_System_Disk_Install|setup-alpine based System Disk Install]].&lt;br /&gt;
* Use {{ic|setup-disk}} script to complete a [[Setting_up_disks_manually|traditional hard-disk installation]] on a partition or to [[Dualbooting|Dualboot]] or to configure [[Setting_up_disks_manually#RAID|RAID]], [[Setting_up_disks_manually#Encryption|encryption]] or [[Setting_up_disks_manually#LVM|LVM]] for [[#System_Disk_Mode|&amp;quot;system&amp;quot;]] disk mode or to add a [[#Data Disk Mode|&amp;quot;data&amp;quot;]] mode partition.&lt;br /&gt;
* Create a [[Create_a_Bootable_Device#Using_setup-bootable|customizable boot media]] i.e a boot device with a writable filesystem for &#039;&#039;&#039;[[#Diskless_Mode|diskless]]&#039;&#039;&#039; or &#039;&#039;&#039;[[#Data_Disk_Mode|data]]&#039;&#039;&#039; disk-mode.&lt;br /&gt;
* Configure a [[Diskless_Mode#Using_an_internal_disk_for_persistent_storage|internal disk for persistent storage]] to save the local configuration state and local package cache for the [[#Diskless Mode|diskless]] system or &#039;&#039;&#039;[[#Data_Disk_Mode|data]]&#039;&#039;&#039; disk-mode.&lt;br /&gt;
&lt;br /&gt;
There are many more [[Alpine_setup_scripts|setup-scripts]] available. All these tools may also be run later to adjust specific configurations. For example, to set up a graphical environment as covered under [[#Post-Installation|Post-Installation]] below.&lt;br /&gt;
&lt;br /&gt;
== Preparing for the installation ==&lt;br /&gt;
&lt;br /&gt;
=== Downloading installation image ===&lt;br /&gt;
&lt;br /&gt;
Installation image files are available in &#039;&#039;&#039;iso&#039;&#039;&#039; or &#039;&#039;&#039;tar.gz&#039;&#039;&#039; or &#039;&#039;&#039;img.gz&#039;&#039;&#039; formats. Download the [https://alpinelinux.org/downloads/ stable-release installation image-file] for the target computer&#039;s architecture with their corresponding &amp;lt;code&amp;gt;sha256&amp;lt;/code&amp;gt; (checksum) and &amp;lt;code&amp;gt;GPG&amp;lt;/code&amp;gt; (signature) files. &lt;br /&gt;
{{Tip| Download &amp;lt;code&amp;gt;sha256&amp;lt;/code&amp;gt; (checksum) and &amp;lt;code&amp;gt;GPG&amp;lt;/code&amp;gt; (signature) files only from [https://alpinelinux.org/downloads/ official] site and not from mirrors.}}&lt;br /&gt;
&lt;br /&gt;
Now you have three files of the following format.. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alpine-standard-*.iso&lt;br /&gt;
alpine-standard-*.iso.sha256&lt;br /&gt;
alpine-standard-*.iso.asc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;alpine-standard-{{AlpineLatest}}-x86_64.iso&#039;&#039; is the &#039;&#039;&#039;{{AlpineLatest}}&#039;&#039;&#039; version &#039;&#039;&#039;Standard&#039;&#039;&#039; image file in &#039;&#039;&#039;iso&#039;&#039;&#039; format for &#039;&#039;&#039;x86_64&#039;&#039;&#039; architecture.&lt;br /&gt;
&lt;br /&gt;
=== Verifying downloaded image ===&lt;br /&gt;
&lt;br /&gt;
From Security point of view, verify the downloaded image file for both checksum and GPG signature before proceeding further. The three required utilities i.e &amp;lt;code&amp;gt;sha256&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gpg&amp;lt;/code&amp;gt; or their equivalents are available in every operating system including Linux, windows, Mac and BSD derivaties. &lt;br /&gt;
&lt;br /&gt;
{{Tip|Ensure that all the three downloaded files remain in the same folder. If not, adjust the commands accordingly.}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;sha256&amp;lt;/code&amp;gt; checksum verifies the integrity of the downloaded image i.e no modifications occurred during download.&lt;br /&gt;
{{Cmd|sha256sum -c alpine-*.iso.&#039;&#039;&#039;sha256&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;GPG&amp;lt;/code&amp;gt; signature verifies the link between the downloaded image to the individual who signed it. Signature verification involves two steps:&lt;br /&gt;
&lt;br /&gt;
Step 1. Download and import the gpg signature from official website &lt;br /&gt;
{{Cmd|curl https://alpinelinux.org/keys/ncopa.asc &amp;amp;#124; gpg --import ;}}&lt;br /&gt;
&lt;br /&gt;
Step 2. Verify that the image signature matches with the one downloaded in Step 1.&lt;br /&gt;
{{Cmd|gpg --verify alpine-*.iso.&#039;&#039;&#039;asc&#039;&#039;&#039; alpine-*.&#039;&#039;&#039;iso&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
=== Preparing installation media  ===&lt;br /&gt;
{{Seealso|Burning ISOs}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|All data currently on the installation media will be &#039;&#039;&#039;erased&#039;&#039;&#039;, when Alpine Linux installation image is written on it. Correctly identify the device name for the installation media using commands &amp;lt;code&amp;gt;lsblk&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;blkid&amp;lt;/code&amp;gt;.}} &lt;br /&gt;
If downloaded image file is in &#039;&#039;&#039;img.gz&#039;&#039;&#039; format, unzip it using the command {{ic|gunzip alpine-rpi-{{AlpineLatest}}-aarch64.img.gz}} to {{ic|alpine-rpi-{{AlpineLatest}}-aarch64.img}} first before using with {{ic|dd}} command. In Linux {{ic|dd}} command can be used to write image files in both &#039;&#039;&#039;iso&#039;&#039;&#039; and &#039;&#039;&#039;img&#039;&#039;&#039; format to the installation media. &lt;br /&gt;
&lt;br /&gt;
If &#039;&#039;&#039;tar.gz&#039;&#039;&#039; format image file is downloaded, follow the [[Create a Bootable Device#Manually copying Alpine files|instructions]] to create the installation media.&lt;br /&gt;
&lt;br /&gt;
Modify the input file(&#039;&#039;&#039;if&#039;&#039;&#039;)  of the {{ic|dd}} command according to the name and path to your image file and and the target device i.e output file(&#039;&#039;&#039;of&#039;&#039;&#039;) should be a device name &#039;&#039;&#039;/dev/sdX&#039;&#039;&#039; instead of partition like &#039;&#039;&#039;/dev/sdbXY&#039;&#039;&#039;:{{Cmd|# dd if{{=}}alpine-standard-{{AlpineLatest}}-x86_64.iso of{{=}}/dev/sdX bs{{=}}4M status{{=}}progress; eject /dev/sdX}}&lt;br /&gt;
&lt;br /&gt;
If your version of &amp;lt;code&amp;gt;dd&amp;lt;/code&amp;gt; does not support the option &amp;quot;status=progress&amp;quot;, remove it. The &amp;lt;code&amp;gt;eject&amp;lt;/code&amp;gt; command removes the target device from the system and ensures the write cache is completely flushed.&lt;br /&gt;
&lt;br /&gt;
In Windows and Mac OS, [https://www.balena.io/etcher/  Etcher] can be used to create an installation media.&lt;br /&gt;
&lt;br /&gt;
===  Verifying Installation media ===&lt;br /&gt;
&lt;br /&gt;
After detaching and re-attaching the device, a bit-wise comparison can verify the data written to the device (instead of just data buffered in RAM). If the comparison terminates with an end-of-file error on the .iso file side, all the contents from the image have been written (and re-read) successfully:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# cmp ~/Downloads/alpine-standard-{{AlpineLatest}}-x86_64.iso /dev/sdX &lt;br /&gt;
 cmp: EOF on alpine-standard-{{AlpineLatest}}-x86_64.iso&amp;lt;/Code&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Booting Installation Media ===&lt;br /&gt;
&lt;br /&gt;
Insert the [[#Preparing_installation_media|Installation media]] to a proper drive or port of the computer and turn the machine on, or restart it, if already running.&lt;br /&gt;
{{Note| To successfully boot and install Alpine Linux, disable [[UEFI#Secure boot|secure boot]] in the BIOS. Once Alpine Linux is installed, this can be [[UEFI_Secure_Boot|enabled]].}}&lt;br /&gt;
If the computer does not automatically boot from the desired device, one needs to bring up the boot menu and choose the media to boot from. Depending on the computer, the menu may be accessed by repeatedly pressing a key quickly when booting starts. Some computers require that you press the button &#039;&#039;before&#039;&#039; starting the computer and hold it down while the computer boots. Typical keys are:  {{key|F9}}-{{key|F12}}, sometimes {{key|F7}} or {{key|F8}}. If these don&#039;t bring up the boot menu, it may be necessary to enter the BIOS configuration and adjust the boot settings, for which typical keys are: {{key|Del}} {{key|F1}} {{key|F2}} {{key|F6}} or {{key|Esc}}.&lt;br /&gt;
&lt;br /&gt;
== Installation Step Details ==&lt;br /&gt;
&lt;br /&gt;
=== Boot Process ===&lt;br /&gt;
&lt;br /&gt;
The boot process of the alpine installation image first copies the entire operating system into the RAM memory, and then starts a complete Alpine Linux system from there. It will initially only provide a basic command line environment that does not depend on reading from any (possibly slow) initial boot media, anymore.&lt;br /&gt;
&lt;br /&gt;
Local log-in is possible as the user &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt;. Initially, the &#039;&#039;&#039;root&#039;&#039;&#039; user has no password.&lt;br /&gt;
&lt;br /&gt;
At the command prompt, an interactive script named [[Alpine_setup_scripts#setup-alpine|&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;]] is available to configure and install Alpine Linux. The script can be customized by the optional [[Alpine_setup_scripts#Environment_Variables|environment variables]], in case of [[Installation#Data_Disk_Mode|&#039;&#039;&#039;&amp;quot;data&amp;quot;&#039;&#039;&#039;]] or [[Installation#System_Disk_Mode|&#039;&#039;&#039;&amp;quot;sys&amp;quot;&#039;&#039;&#039;]] mode. For e.g {{Codeline|&amp;lt;code&amp;gt;USE_EFI{{=}}1 BOOT_SIZE{{=}}512 setup-alpine&amp;lt;/code&amp;gt;}}, sets the disklabel type to gpt, creates 512MB &#039;&#039;&#039;/boot&#039;&#039;&#039; partition with &#039;&#039;&#039;vfat&#039;&#039;&#039; filesystem and uses &amp;lt;code&amp;gt;grub&amp;lt;/code&amp;gt; as bootloader.&lt;br /&gt;
&lt;br /&gt;
=== Base configuration ===&lt;br /&gt;
&lt;br /&gt;
Launch the Alpine Linux Installation by running the [[Alpine_setup_scripts#setup-alpine|&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;]] script :&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# setup-alpine}}&lt;br /&gt;
&lt;br /&gt;
The question-and-answer dialog of &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; takes care of the base configuration. It sets up a network connection to access Internet to configure the system to boot into one of three different Alpine Linux &amp;quot;disk&amp;quot; modes:  [[Installation#Diskless_Mode|&#039;&#039;&#039;&amp;quot;diskless&amp;quot;&#039;&#039;&#039;(none)]],  [[Installation#Data_Disk_Mode|&#039;&#039;&#039;&amp;quot;data&amp;quot;&#039;&#039;&#039;]]  or [[Installation#System_Disk_Mode|&#039;&#039;&#039;&amp;quot;sys&amp;quot;&#039;&#039;&#039;]]. If you choose to edit any option, the relevant file is opened in [[BusyBox#vi| &#039;&#039;&#039;vi&#039;&#039;&#039; editor]] for editing.&lt;br /&gt;
&lt;br /&gt;
{{Tip| If you have access to a wired network, consider using [https://docs.alpinelinux.org/user-handbook/0.1a/Installing/setup_alpine.html#_setup_alpine_q Quick Mode], to complete the base configuration quickly.}}&lt;br /&gt;
&lt;br /&gt;
[[File:Installation-alpine-alpine-setup-3-setup-scripts.png|350px|thumb|right|Example &amp;lt;code&amp;gt;[[Alpine_setup_scripts#setup-alpine|setup-alpine]]&amp;lt;/code&amp;gt; session]]&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;[[Alpine_setup_scripts#setup-alpine|setup-alpine]]&amp;lt;/code&amp;gt; script offers the following configuration options:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Keyboard Layout&#039;&#039;&#039; (Local keyboard language and usage mode, e.g. &#039;&#039;us&#039;&#039; and variant of &#039;&#039;us-nodeadkeys&#039;&#039;.)&lt;br /&gt;
# &#039;&#039;&#039;Hostname&#039;&#039;&#039; (The name for the computer.)&lt;br /&gt;
# &#039;&#039;&#039;Network &#039;&#039;&#039; (Set up network connection to access Internet.)&lt;br /&gt;
#* Available interfaces are: &#039;&#039;&#039;eth0&#039;&#039;&#039; &#039;&#039;&#039;wlan0&#039;&#039;&#039;.(List depends on your hardware.)&lt;br /&gt;
#* Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0] (Enter &#039;done&#039; after configuring &#039;&#039;&#039;atleast&#039;&#039;&#039; one interface for Internet access.) &lt;br /&gt;
#* Do you want to do any manual network configuration? (y/n) [n] (Default uses &amp;quot;DHCP&amp;quot;.)  &lt;br /&gt;
# &#039;&#039;&#039;DNS Servers&#039;&#039;&#039; (If none of the interfaces configured in previous step uses dhcp, set DNS server. If unsure, leave DNS domain name blank and using &amp;lt;code&amp;gt;[https://quad9.net/ 9.9.9.9 2620:fe::fe]&amp;lt;/code&amp;gt; for DNS is typically adequate.)&lt;br /&gt;
# &#039;&#039;&#039;Root password&#039;&#039;&#039; (the password used to login to the root account)&lt;br /&gt;
# &#039;&#039;&#039;Timezone&#039;&#039;&#039; (Optionally display times/dates in your local time zone)&lt;br /&gt;
# &#039;&#039;&#039;HTTP/FTP Proxy&#039;&#039;&#039; (Proxy server to use for accessing the web/ftp. Use &amp;quot;none&amp;quot; for direct connections to websites and FTP servers.)&lt;br /&gt;
# &#039;&#039;&#039;Mirror&#039;&#039;&#039; (From where to download packages. Choose the organization you trust giving your usage patterns to.)&lt;br /&gt;
# &#039;&#039;&#039;Set up a user&#039;&#039;&#039; (Setting up a regular user account)&lt;br /&gt;
# &#039;&#039;&#039;NTP&#039;&#039;&#039; (Network Time Protocol client used for keeping the system clock in sync with a time server. Default is &amp;quot;busybox&amp;quot;.)&lt;br /&gt;
# &#039;&#039;&#039;SSH&#039;&#039;&#039; (Secure SHell remote access server. &amp;quot;OpenSSH&amp;quot; is part of the default install image. Use &amp;quot;none&amp;quot; to disable remote login, e.g. on laptops.)&lt;br /&gt;
# In most cases, either one of following line(s) is displayed as follows: &lt;br /&gt;
#: &#039;&#039;&#039;No disks found.&#039;&#039;&#039; or &#039;&#039;&#039; Available disks are: sda (128.0 GB JMicron  Tech )&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Disk Mode&#039;&#039;&#039; ( A pre-setup of the &amp;quot;diskless&amp;quot; system or base configuration is completed by answering &amp;quot;none&amp;quot; when asked for the following questions.) &lt;br /&gt;
#* Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) &#039;&#039;&#039;none&#039;&#039;&#039;&lt;br /&gt;
#* Enter where to store configs (/media/ or &#039;none&#039;) &#039;&#039;&#039;none&#039;&#039;&#039;&lt;br /&gt;
#* The location of the package cache &#039;&#039;&#039;none&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Base configuration is complete with the above step. Refer to the [[#Alternative courses of action|alternative courses of action]] to proceed further.&lt;br /&gt;
&lt;br /&gt;
=== setup-alpine based System Disk Install ===  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; script based system disk installation, needs an &#039;&#039;&#039; entire hard disk(s)&#039;&#039;&#039; for Alpine Linux and uses a partitioning layout with (/)root partition, /boot partition and a swap partition, where [[Alpine_setup_scripts#Environment_Variables|environment variables]] determine filesystem, size of the boot partition and the bootloader used.  If your use case matches the above, at the final step of [[#Base configuration|base configuration]], type the appropriate hard disk &#039;&#039;&#039;device name&#039;&#039;&#039; instead of &#039;&#039;&#039;none&#039;&#039;&#039;. If multiple disks are chosen, [[Alpine_setup_scripts#RAID|RAID]] is used.&lt;br /&gt;
 &lt;br /&gt;
* At the &#039;&#039;&#039;Disk Mode&#039;&#039;&#039; stage, &#039;&#039;&#039;sda&#039;&#039;&#039; or relevant disk(s) must be chosen in the below screen:&lt;br /&gt;
** Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) &#039;&#039;&#039;sda&#039;&#039;&#039;&lt;br /&gt;
** Confirmation for the chosen disk(s) appears. &#039;&#039;The following disk is selected:&#039;&#039; &#039;&#039;&#039;sda    (128.0 GB JMicron  Tech ).&#039;&#039;&#039; &lt;br /&gt;
{{Warning|Pay close attention to the disk name and size. If you enter &#039;&#039;&#039;sys&#039;&#039;&#039; in the next step, no further questions will be asked and data on the chosen disk(s) will be overwritten!. Enter {{key|Ctrl}}+{{key|c}} to abort the installation process. Proceed only if you are 100% sure.}}&lt;br /&gt;
* How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) &#039;&#039;&#039;sys&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If &#039;&#039;&#039;sys&#039;&#039;&#039; is chosen, the &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; script will complete the traditional hard-disk installation of Alpine Linux on the chosen disk(s) without further questions.  Once the installation is complete, you can skip the next steps and proceed to [[#Reboot|reboot]] the system to boot into the newly installed Alpine Linux and [[Installation#Post-Installation|configure]] further.&lt;br /&gt;
&lt;br /&gt;
=== Custom partitioning  ===&lt;br /&gt;
&lt;br /&gt;
[[Setting_up_disks_manually#Manual_partitioning|Manual partitioning]] of the harddisk may be needed to prepare the harddisk for &amp;quot;sys&amp;quot; mode install using [[Setting_up_disks_manually|&amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt;]] and for storing the config file using [[Alpine_local_backup|&amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt;]] and package cache for [[Diskless Mode|Diskless]] and for /var mount for [[Data Disk Mode|Data disk]] mode installs. Refer [[Setting up disks manually|Setting up disks manually]] page for specific configurations related to [[Setting_up_disks_manually#RAID|RAID]], [[Setting_up_disks_manually#Encryption|encryption]], [[Setting_up_disks_manually#LVM|LVM]], etc...&lt;br /&gt;
&lt;br /&gt;
=== Preparing for the first boot ===&lt;br /&gt;
If [[#System_Disk_Mode|System Disk Mode]] of installation was performed, ignore this section and proceed to [[#Reboot|reboot]].&lt;br /&gt;
&lt;br /&gt;
If the new local system was configured to run in &amp;quot;diskless&amp;quot; or &amp;quot;data&amp;quot; mode, and you do not want keep booting from the initial (and possibly read-only) [[Installation#Preparing_installation_media|installation media]], create a  [[Create_a_Bootable_Device|customizable boot device]]. Once everything is in place, save your customized configuration with {{ic|lbu commit}} before rebooting.&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
First, remove the initial installation media from the boot drive, or detach it from the port it&#039;s connected to. The system may now be power-cycled or rebooted to confirm everything is working correctly. The relevant commands for this are {{ic|poweroff}} or {{ic|reboot}}. Login into the new system with the root account.&lt;br /&gt;
&lt;br /&gt;
=== Completing the installation ===&lt;br /&gt;
&lt;br /&gt;
The installation script installs only the base operating system. &#039;&#039;&#039;No&#039;&#039;&#039; applications e.g. web server, mail server, desktop environment, or web browsers are installed.&lt;br /&gt;
&lt;br /&gt;
Please look at [[Installation#Post-Installation|Post-Installation]], for some common things to do after installation.&lt;br /&gt;
&lt;br /&gt;
== Custom Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- COMMENT FOR EDITORS&lt;br /&gt;
Specific topics should be kept on separate pages and manageable category-pages only must get listed with direct reference on this general page.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* [[Installation on a headless host]]&lt;br /&gt;
* [[Kernels]] &#039;&#039;(kernel selection, e.g. for VMs or RPi)&#039;&#039;&lt;br /&gt;
* [[How to make a custom ISO image with mkimage]] &#039;&#039;(installation media with its own configuration)&#039;&#039;&lt;br /&gt;
* [[Directly booting an ISO file]] &#039;&#039;(without flashing it to a disk or device)&#039;&#039;&lt;br /&gt;
* [[Alpine Linux in a chroot]]&lt;br /&gt;
* [[Netboot Alpine Linux using iPXE]]&lt;br /&gt;
* [[:Category:Virtualization|Virtualization]]&lt;br /&gt;
* [[Using an answerfile with setup-alpine]]&lt;br /&gt;
&lt;br /&gt;
Also see other [[:Category:Installation|Installation category]] pages.&lt;br /&gt;
&lt;br /&gt;
== Post-Installation ==&lt;br /&gt;
&lt;br /&gt;
{{Tip|Alpine Linux packages stay close to the upstream design. Therefore, all upstream documentation about configuring a software package, as well as good configuration guides from other distributions that stay close to upstream, e.g. those in the [https://wiki.archlinux.org/ ArchWiki], or [https://wiki.gentoo.org/wiki/ Gentoo wiki] are to a large degree, also applicable to configuring the software on Alpine Linux, thus can be very useful.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- COMMENT FOR EDITORS&lt;br /&gt;
If you edit Post-Install,&lt;br /&gt;
&lt;br /&gt;
  * Consider that there are already [[Tutorials_and_Howtos#Post-Install]], [[Developer_Documentation#Package_management]] [[Daily driver guide]] and the Handbook, please work towards reducing duplication and providing an overview, and maintaining topic details of considerable size on their own pages.&lt;br /&gt;
  * Here, only the most relevant jumping off points are listed, not exact list duplicates!!!&lt;br /&gt;
  * Keep short-list of links here, as overview to more detailed topic specific pages.&lt;br /&gt;
  * Don&#039;t aggregate different topics at yet another place.&lt;br /&gt;
Any topic related to configuring Alpine as Desktop workstation i.e as a daily driver must go to the [[Daily driver guide]] or [[Tutorials_and_Howtos#Desktop|Desktop]]section. Links to Tutorial and How To&#039;s should be added to [[Tutorials_and_Howtos]] and not added here.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* [[Tutorials_and_Howtos#Desktop|Guide to daily drive]] Alpine Linux as a desktop OS&lt;br /&gt;
* [[Tutorials_and_Howtos#Services|Hosting services]] like mail/web/ssh/Firewall/VPN servers &lt;br /&gt;
* [[Tutorials_and_Howtos#Virtualization|Virtualization]] guide for using Alpine Linux as both guest and host&lt;br /&gt;
* Guide to [[OpenRC|OpenRC]] - Init system used to configure services&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Tutorials and Howtos]]&lt;br /&gt;
* [[Comparison with other distros]] &#039;&#039;(how common things are done on Alpine)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Wackbyte</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Alpine_local_backup&amp;diff=30619</id>
		<title>Alpine local backup</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Alpine_local_backup&amp;diff=30619"/>
		<updated>2025-07-30T19:05:41Z</updated>

		<summary type="html">&lt;p&gt;Wackbyte: add space&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Local backup utility ({{ic|lbu}}) is the Alpine Linux tool to manage [[Diskless Mode]] installations. For these installations, {{ic|lbu}} tool must be used to [[#Committing changes|commit the changes]] whenever [[Alpine Package Keeper]] is used.&lt;br /&gt;
&lt;br /&gt;
When Alpine Linux boots in diskless mode, it initially only loads a few required packages from the boot device. However, local adjustments to what-gets-loaded-into-RAM are possible, e.g. installing a package or adjusting the configuration files in {{path|/etc}}. The modifications can be saved with {{ic|lbu}} tool to an overlay file i.e [[Diskless Mode#Apkovl|apkovl]] file  that can be automatically loaded when booting, to restore the saved state.&lt;br /&gt;
&lt;br /&gt;
By default, an {{ic|lbu commit}} only stores modifications below {{Path|/etc}}, with the exception of the {{Path|/etc/init.d/}} directory. If a user was created during the {{ic|setup-alpine}} script, that user&#039;s home directory is also added to the paths that &amp;lt;code&amp;gt;lbu&amp;lt;/code&amp;gt; will backup up. However, [[#Include_special_files.2Ffolders_to_the_apkovl|lbu include]] enables modifying that set of included files, and can be used to specify additional files or folders.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;lbu&amp;lt;/code&amp;gt; tool has several subcommands to manage the .apkovl:&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| lbu commit &lt;br /&gt;
| lbu ci &lt;br /&gt;
| Create a backup of config to writeable media&lt;br /&gt;
|-&lt;br /&gt;
| lbu package &lt;br /&gt;
| lbu pkg&lt;br /&gt;
| Create backup package&lt;br /&gt;
|-&lt;br /&gt;
| lbu status &lt;br /&gt;
| lbu st &lt;br /&gt;
| Check what files have been changed since last commit&lt;br /&gt;
|-&lt;br /&gt;
| lbu list&lt;br /&gt;
| lbu ls&lt;br /&gt;
| Lists files that would go to tar package. Same as: {{Codeline|lbu package -v /dev/null}}&lt;br /&gt;
|-&lt;br /&gt;
| lbu diff&lt;br /&gt;
|&lt;br /&gt;
| Run a diff against last commit&lt;br /&gt;
|-&lt;br /&gt;
| lbu include&lt;br /&gt;
| lbu inc or lbu add&lt;br /&gt;
| Add filename(s) to include list{{Path|/etc/apk/protected_paths.d/lbu.list}}&lt;br /&gt;
|-&lt;br /&gt;
| lbu exclude&lt;br /&gt;
| lbu ex or lbu delete &lt;br /&gt;
| Add filename(s) to exclude list {{Path|/etc/apk/protected_paths.d/lbu.list}}&lt;br /&gt;
|-&lt;br /&gt;
| lbu list-backup&lt;br /&gt;
| lbu lb &lt;br /&gt;
| Show old commits&lt;br /&gt;
|-&lt;br /&gt;
| lbu revert&lt;br /&gt;
|&lt;br /&gt;
|Revert to older commit&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the examples below, you will find some characters with special meaning:&lt;br /&gt;
* &#039;&#039;&#039;|&#039;&#039;&#039; = &#039;&#039;&#039;or&#039;&#039;&#039; &#039;&#039;(&#039;lbu commit|ci&#039; means that you can type ether &#039;lbu commit&#039; or &#039;lbu ci&#039;)&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;[ ]&#039;&#039;&#039; = &#039;&#039;&#039;optional&#039;&#039;&#039; &#039;&#039;(In &#039;lbu commit|ci [-nv]&#039; you can skip the &#039;-n&#039;, &#039;-v&#039; or &#039;-nv&#039; part if you don&#039;t want it)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Committing changes ==&lt;br /&gt;
&lt;br /&gt;
When you &amp;quot;commit&amp;quot; or save changes you&#039;ve made to your system, &amp;lt;code&amp;gt;lbu&amp;lt;/code&amp;gt; will generate a file named something like {{Path|&amp;lt;var&amp;gt;myboxname&amp;lt;/var&amp;gt;.apkovl.tar.gz}} &#039;&#039;(&#039;myboxname&#039; will be the same as the hostname)&#039;&#039;.&lt;br /&gt;
The file (which contains your modifications) is called your &amp;quot;apkovl&amp;quot;.&lt;br /&gt;
You will need to save your apkovl on suitable media (floppy, usb, cf, etc.).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu commit|ci [-nv] [&amp;lt;media&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -d	Remove old apk overlay files.&lt;br /&gt;
  -e	Protect configuration with a password.&lt;br /&gt;
  -n	Don&#039;t commit, just show what would have been committed.&lt;br /&gt;
  -p &amp;lt;password&amp;gt;	Give encryption password on the command-line&lt;br /&gt;
  -v	Verbose mode.&lt;br /&gt;
&lt;br /&gt;
The following values for &amp;lt;media&amp;gt; are supported: floppy usb&lt;br /&gt;
If &amp;lt;media&amp;gt; is not specified, the environment variable LBU_MEDIA will be used.&lt;br /&gt;
&lt;br /&gt;
Password protection will use aes-256-cbc encryption. Other ciphers can be&lt;br /&gt;
used by setting the DEFAULT_CIPHER or ENCRYPTION environment variables.&lt;br /&gt;
For possible ciphers, try: openssl -v&lt;br /&gt;
&lt;br /&gt;
The password used to encrypt the file, can be specified with the -p&lt;br /&gt;
option or by using the PASSWORD environment variable.&lt;br /&gt;
&lt;br /&gt;
The environment variable can also be set in /etc/lbu/lbu.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an .apkovl &amp;quot;package&amp;quot; elsewhere than on the configured media ==&lt;br /&gt;
&lt;br /&gt;
To &amp;quot;commit&amp;quot; changes, but override the destination of the generated apkovl file, use &amp;lt;code&amp;gt;lbu package&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu package|pkg -v [&amp;lt;dirname&amp;gt;|&amp;lt;filename&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -v   Verbose mode.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;dirname&amp;gt; is a directory, a package named &amp;lt;hostname&amp;gt;.apkovl.tar.gz will&lt;br /&gt;
be created in the specified directory.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;filename&amp;gt; is specified, and is not a directory, a package with the&lt;br /&gt;
specified name will be created.&lt;br /&gt;
&lt;br /&gt;
If neither &amp;lt;dirname&amp;gt; nor &amp;lt;filename&amp;gt; is specified, a package named&lt;br /&gt;
&amp;lt;hostname&amp;gt;.apkovl.tar.gz will be created in the current working directory.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To create an apkovl from a client on a remote server, it&#039;s possible to use &amp;lt;code&amp;gt;lbu package&amp;lt;/code&amp;gt; via SSH with {{Path|-}} as the apkovl name on the server:{{Cmd|ssh root@client &amp;quot;lbu package -&amp;quot; &amp;gt; client.apkovl.tar.gz}}&lt;br /&gt;
&lt;br /&gt;
== Checking what will be added to your apkovl ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;lbu status&amp;lt;/code&amp;gt; lists what will be saved the next time you run &amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt;. Its default output is incremental, that is, it shows&lt;br /&gt;
only the files that have changed since the last commit. &amp;lt;br&amp;gt;&lt;br /&gt;
This can be overridden with the &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; flag:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu status|st [-av]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -a    Compare all files, not just since last commit.&lt;br /&gt;
  -v    show include and exclude lists.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option is &amp;lt;code&amp;gt;lbu list&amp;lt;/code&amp;gt;. This works like &amp;lt;code&amp;gt;lbu status -a&amp;lt;/code&amp;gt; but the format of the output is a bit different. (It&#039;s strictly equivalent to &amp;lt;code&amp;gt;lbu package -v /dev/null&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
 usage: lbu list|ls&lt;br /&gt;
&lt;br /&gt;
A third option is &amp;lt;code&amp;gt;lbu diff&amp;lt;/code&amp;gt;. This shows the same incremental changes that &amp;lt;code&amp;gt;lbu status&amp;lt;/code&amp;gt; (without &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt;) does, but in a different format.&lt;br /&gt;
&lt;br /&gt;
  usage: lbu diff&lt;br /&gt;
&lt;br /&gt;
== Include special files/folders to the apkovl ==&lt;br /&gt;
&lt;br /&gt;
Assume you have some files you want to save permanently, but they are not located in {{Path|/etc}}.&amp;lt;BR&amp;gt;&lt;br /&gt;
e.g. {{Path|/root/.ssh/authorized_keys}} (used by &amp;lt;code&amp;gt;sshd&amp;lt;/code&amp;gt; to authenticate ssh-users). Such files/folders can be added to lbu&#039;s &#039;&#039;include&#039;&#039; list with the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu include|inc|add [-rv] &amp;lt;file&amp;gt; ...&lt;br /&gt;
       lbu include|inc|add [-v] -l&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -l	List contents of include list.&lt;br /&gt;
  -r	Remove specified file(s) from include list.&lt;br /&gt;
  -v	Verbose mode.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|This information used to be maintained in {{Path|/etc/lbu/include}}. Now it&#039;s maintained together with the &#039;&#039;exclude&#039;&#039; list in {{Path|/etc/apk/protected_paths.d/lbu.list}}. Either way, the command &amp;lt;code&amp;gt;lbu include&amp;lt;/code&amp;gt; only modifies lbu&#039;s configuration. You will need to run &amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt; to actually create/modify your apkovl.}}&lt;br /&gt;
&lt;br /&gt;
== Exclude specific files/folders from the apkovl ==&lt;br /&gt;
&lt;br /&gt;
Assume you have some files located in {{Path|/etc}} or one of its subfolders you &#039;&#039;do not&#039;&#039; want to save.&lt;br /&gt;
It could be a log file or status file that for some reason isn&#039;t in {{Path|/var/log/}} but in a location that would otherwise be tracked by &amp;lt;code&amp;gt;lbu&amp;lt;/code&amp;gt;.&lt;br /&gt;
Such files/folders can be added to lbu&#039;s &#039;&#039;exclude&#039;&#039; list by manually editing the file or using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu exclude|ex|delete [-rv] &amp;lt;file&amp;gt; ...&lt;br /&gt;
       lbu exclude|ex|delete [-v] -l&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -l	List contents of exclude list.&lt;br /&gt;
  -r	Remove specified file(s) from exclude list.&lt;br /&gt;
  -v	Verbose mode.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note|As stated above, this information is now maintained in {{Path|/etc/apk/protected_paths.d/lbu.list}}. The command &amp;lt;code&amp;gt;lbu exclude&amp;lt;/code&amp;gt; also only modifies lbu&#039;s configuration. You will need to run &amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt; to actually create/modify your apkovl.}}&lt;br /&gt;
&lt;br /&gt;
== Multiple backup versions ==&lt;br /&gt;
&lt;br /&gt;
Lbu can keep multiple backups so you can revert back to older configurations. Set BACKUP_LIMIT in {{Path|/etc/lbu/lbu.conf}} to the number of backups you want to keep. Based on BACKUP_LIMIT, the previously active .apkovl will be renamed before creating the new file.&lt;br /&gt;
&lt;br /&gt;
You can list the currently available backups and revert to an older one with the following commands:{{Cmd|&amp;lt;nowiki&amp;gt;# lbu list-backup [&amp;lt;media&amp;gt;]&lt;br /&gt;
# lbu revert &amp;lt;filename&amp;gt; [&amp;lt;media&amp;gt;]&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Nothing is changed on your running system when &amp;quot;reverting&amp;quot;, it only affects which apkovl is loaded at the next boot.&lt;br /&gt;
&lt;br /&gt;
== Saving and loading ISO image customizations ==&lt;br /&gt;
&amp;lt;!-- This heading is retained here as certain bug reports refer this heading. --&amp;gt;&lt;br /&gt;
ISO boot images can save running states to [[Diskless Mode#Using an internal disk for persistent storage|system partitions]] and automatically loaded when booting the ISO boot image. &lt;br /&gt;
&lt;br /&gt;
== Execute a script as part of a backup ==&lt;br /&gt;
&lt;br /&gt;
Sometimes it&#039;s necessary to run a script before or after a backup.  Scripts in two optional directories enable that:&lt;br /&gt;
&lt;br /&gt;
 /etc/lbu/pre-package.d&lt;br /&gt;
 /etc/lbu/post-package.d&lt;br /&gt;
&lt;br /&gt;
Files in those directories are run using run-script rules (meaning they must have the executable bit set, they are run in alphabetical order, and cannot contain an extension. e.g. {{Path|runme}} works, but {{Path|runme.sh}} does not. Also the shebang line on the first line should be indicated, e.g. #!/bin/sh .)&lt;br /&gt;
&lt;br /&gt;
The scripts in {{Path|pre-package.d}} are run before apkovl is created. Scripts in {{Path|post-package.d}} are run after apkovl is created.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Rather than adding the raw database directories to {{Path|/etc/lbu/include}}, you can do a &amp;quot;database dump&amp;quot;.  e.g. {{Pkg|postgresql}}:&lt;br /&gt;
&lt;br /&gt;
* Create {{Path|/etc/lbu/pre-package.d/sqldump}} with the following contents: &amp;lt;pre&amp;gt;pg_dumpall -U postgres | gzip -c &amp;gt;/root/pgdatabases.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Mark the file executable: &amp;lt;code&amp;gt;chmod +x /etc/lbu/pre-package.d/sqldump&amp;lt;/code&amp;gt;&lt;br /&gt;
* Create {{Path|/etc/lbu/post-package.d/sqldumpdelete}} with the following contents: &amp;lt;pre&amp;gt;rm -f /root/pgdatabases.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Mark the file executable: &amp;lt;code&amp;gt;chmod +x /etc/lbu/post-package.d/sqldumpdelete&amp;lt;/code&amp;gt;&lt;br /&gt;
* Finally, add the database dump file to the list of files to back up: &amp;lt;code&amp;gt;lbu include root/pgdatabases.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when you do a &amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt;, the sql databases are dumped and gzipped to {{Path|/root/pgdatabases.gz}}.&lt;br /&gt;
The temporary file is deleted at the end of the lbu commit.&lt;br /&gt;
&lt;br /&gt;
On a catastrophic restore, the databases are not automatically restored (that&#039;s not lbu&#039;s job), but you will find a complete database dump in the {{Path|/root}} directory, where it can be restored manually.&lt;br /&gt;
&lt;br /&gt;
P.s. These scripts are also launched when starting the commands: diff, list-backup, package, revert, status.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [Diskless Mode]]&lt;br /&gt;
* [[Back Up a Flash Memory Installation]]&lt;br /&gt;
* [[Manually editing a existing apkovl]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Booting]]&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[category: Diskless]]&lt;/div&gt;</summary>
		<author><name>Wackbyte</name></author>
	</entry>
</feed>