Difference between revisions of "Installation"

From Alpine Linux
Jump to: navigation, search
m
(3. Boot and install process: variant keyboard are not same response as main layout, CAREFULLY with this)
 
(28 intermediate revisions by 6 users not shown)
Line 1: Line 1:
Please do help with sorting out the current wiki documentation, as soon as exploring around the further pages gives you a grasp good enough to sort out the further things precisely and nicely as well.
+
Alpine Linux can be installed as the main operating system on a physical machine ("bare metal"), including on embedded devices. For example, [https://en.wikipedia.org/wiki/PostmarketOS PostmarketOS] is a smartphone operating system based on Alpine, and [https://www.adelielinux.org/ Adélie Linux] is a complete end-user distribution based on Alpine Linux. While this use case is less common than Alpine Linux's main use as a base system for container images in systems like Docker, this document describes how Alpine can be installed as the primary operating system for a computer.
[[Image:hdd_mount.png|left|link=]]
 
<br />
 
  
 +
Alpine in fact works as a [https://en.wikipedia.org/wiki/Live_USB live system]&mdash;any install disk of Alpine can also be run without installing to local storage of the machine it's booted on, running directly from the install media!
  
 +
__TOC__
 +
__FORCETOC__
  
 +
= Quick Requirements =
  
This page will get you started, but it can also help to skim through the [[Alpine_Linux:FAQ| Frequenty Asked Questions (FAQ)]] (also part of the left sidebar).
+
Nearly any hardware should run Alpine Linux but the following basic requirements are recommended:
== Typical Hardware Requirements ==
 
  
* At least 100 MB of RAM (A graphical desktop system may require up to 1 GB minimum.)
+
* At least 128MB of RAM for server without GUI, or at least 1.6GB for graphical desktop
* A writable storage device. (Required for the "sys" or "data" runtime modes (see below). Optional for saving the configuration of systems running in "diskless" mode.)
+
* At least 1GB storage device for server without GUI, or at least 10GB for graphical desktop with web browsing
  
== Installation Overview ==
+
For more information, see [[Requirements]].
(To install on ARM systems that do not support .iso images refer to [[Alpine_on_ARM|Alpine on ARM]] instead.)
 
  
As with most linux distributions, the first installation steps usually consist of:<br>
+
[[File:Installation-alpine-alpine-setup-2-boot.png|350px|thumb|right|Installation : setup-alpine : booting process until login prompt]]
([[Installation#additional details|additional details]] below)
 
  
 +
= Installation Overview =
  
'''1.)''' Downloading and verifying the proper [http://alpinelinux.org/downloads stable-release ISO image] for your computer's architecture, and the corresponding <code>sha256</code> (checksum) and <code>GPG</code> (signature) files.  
+
The following steps are brief and intended for the common case; for complete info and other architectures, please consult the [[Alpine newbie install manual]].
  
'''2.)''' Either burning the ISO image onto a blank CD/DVD/Blue-ray disk with your favorite disk burning software, or flashing the image onto a bootable storage device (USB-device, CF-/MMC-/SD-card, floppy, ...).
+
== 1. Download the media source ==
  
'''3.)''' Booting the computer from the prepared disk or storage device.
+
The most common is to grab an ISO from [http://alpinelinux.org/downloads]. Take note of architectures in green buttons.
  
 +
== 2. Dump, burn or flash the image ==
  
The boot process first copies the entire system into the RAM memory, and then runs it completely from RAM. So that the started command line environment does not depend on reading from the (slow) initial boot media anymore.
+
Dump the ISO image onto a media source like USB/SD flashing; or CD/DVD/BR disk with burning software.
 +
In Linux, you can use <code><nowiki>dd if=<your iso filename> of=<your target media> bs=1M; sync</nowiki></code>, to flash a USB drive or SD card as target media install.
  
Log-in as the user <code>root</code> with its initially empty password.
+
== 3. Boot and install process ==
  
Now an interactive script called <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code>, as well as more specific [[Alpine_setup_scripts|setup-scripts]], the [[Alpine_Linux_package_management|apk package manager]], and all the general command line tools of course, can be used to configure the initial Alpine Linux system, to install further packages, and to prepare the system for the next boot.
+
Log in as the user <code>root</code> by typing <code>root</code> and hitting ''enter''. Then execute <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code>, answering the questions and hitting ''enter'' after each:
  
Note that <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> supports to configure the system to boot into one of three general '''Alpinelinux runtime modes''':
+
[[File:Installation-alpine-alpine-setup-3-setup-scripts.png|350px|thumb|right|Installation : setup-alpine : complete process single install]]
  
'''diskless mode''' This is the default boot mode of the .iso images. <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> configures this if selecting to install to "disk=none", and it means that the whole  operating system and the applications run extremely fast from within RAM (saving unnecessary disk spin-ups, power and wear). A customized configuration and package selection may still be completely preserved on permanent storage media by using the "local backup utility" <code>[[Alpine_local_backup|lbu]]</code> and a [[Alpine_Linux_package_management#Local_Cache|local package cache]]. [Fixme: <code>setup-alpine</code> still needs [[Alpine_local_backup#Saving_and_loading_ISO_image_customizations| this detour]] to prepare a partition for this:] In setup-alpine, select to store configs and the package cache on a partition. (That mounted partition may later also be used by configuring some important applications to keep their data on it.)
+
* '''Select keyboard layout''': Choose your keyboard layout, e.g. ''us'' or ''es''.
 +
** '''Select variant''': Choose your keyboard layout variant,  e.g. ''us-nodeadkeys'' or ''es-winkeys''.
 +
* '''Enter system hostname''': Choose the name of your computer; '''localhost''' is good enough and recommended for starting.
 +
* '''Initialize network cards''': Here most people can just go with the default (just press enter).
 +
** '''Any manual configuration''': Perform other configuration if needed, otherwise just type "no" and hit enter.
 +
** '''Select domain name''': This is not commonly asked, you can just hit enter.
 +
* '''DNS nameservers?''': If asked, <code>8.8.8.8</code> is a recommended default that will be good for most people.
 +
* '''Changing password for root''': Next a root password must be defined. Input a passphrase; what you type won't be shown on the screen.
 +
** '''Retype password''': Type the same passphrase to confirm the root password; what you type won't be shown on the screen.
 +
* '''Which timezone to choose?''': Set it to your local time zone or hit enter for <code>UTC</code>.
 +
* '''Proxy chooser''': Type <code>none</code> and hit enter if you're not using a proxy.
 +
* '''Which NTP client to run?''': This is for keeping the system clock in sync. The default is good enough for most people.
 +
* '''Enter mirror number''': <code>1</code> is a good choice for most people.
 +
* '''Which SSH server?''': An SSH server allows you to remotely manage your machine. The default is good enough for most people.
 +
* '''Disk Setup''' Choose how to set up your disks.
 +
** '''Which disks would you like to use?''': Choose the disk where files will be installed. Usually <code>sda</code> is the hard disk and <code>sdb</code> is the USB boot or CD/DVD image.
 +
** '''How would you like to use it?''': Type "sys" and then press enter. This will cause the OS to be installed to the chosen disk&mdash;similar to how other distributions work.
  
'''data mode''' This mode is still accelerated by running the system from RAM, however swap storage and the whole {{Path|/var}} directory tree gets mounted from a persistent storage device (two newly created partitions). This location holds e.g. all log files, mailspools, databases, etc., as well as <code>[[Alpine_local_backup|lbu]]</code> backup commits and the package cache. The mode is useful for having RAM accelerated servers with amounts of variable user-data that exceed the available RAM size, and to let the entire current system state (not just the boot state) survive a system crash according to the particular filesystem's guarantees. [Fixme: Storing lbu configs to disk is not auto-configured after configuring the data partition, one still has to select saving configs to "none" first (the new data partition is not listed), and to manually set e.g. LBU_MEDIA=sda2 in /etc/lbu/lbu.conf and <code>echo "/dev/sda2 /media/sda2 vfat rw 0 0" >> /etc/fstab</code> afterwards.] The boot device may remain to be the one initially used, and can even be immutable (read-only).
+
Take care that '''all data on your chosen disk will be erased'''. A final question will prompt you to continue. After confirming by typing 'y' and hitting enter, you cannot turn back.
  
'''sys mode''' This is a traditional hard-disk install. If this mode is selected, the <code>[[setup-alpine]]</code> script defaults to create three partitions on the selected storage device, {{Path|/boot}}, {{Path|swap}} and {{Path|/}} (the filesystem root). This mode may be used for generic [[Desktops|desktop]] and development machines, for example.
+
After the script finishes installing the system, it will tell you to reboot. Note that:
  
== Questions asked by <code>setup-alpine</code> ==
+
* If the configured [[Alpine_setup_scripts#sys_mode|runtime mode was "sys"]], then remove the initial installation media to boot the newly installed system.
 +
* If the configured [[Alpine_setup_scripts#diskless_mode|runtime mode was "data"]], then keep the installation media inserted to boot the newly installed system.
  
The <code>[[setup-alpine]]</code> script offers to configure:
+
To reboot, type <code>reboot</code> and hit enter. If you just wish to turn off the machine after installing, type <code>poweroff</code> instead.
 
 
* Keyboard map (e.g. ''us'' and variant of ''us-nodeadkeys'')
 
* Hostname (The name for the computer.)
 
* Network (e.g. automatic DHCP IP address discovery)
 
* DNS Servers (For privacy reasons, it is NOT recommended to use servers like google's 8.8.8.8 etc.)
 
* Timezone
 
* Proxy ("None" for direct connections to the internet.)
 
* SSH (Openssh is part of the default images.)
 
* NTP (Chrony is part of the default images.)
 
* Runtime Mode (Select between "diskless" (disk=none), "data" or "sys", all described above.)
 
 
 
== Additional Details ==
 
 
 
{{Expand|  }}
 
 
 
This "Additional Details" section needs to be consolidated with the work at '''[https://docs.alpinelinux.org https://docs.alpinelinux.org] (not finished)'''
 
(Restructuring things there, moving and linking from here or there?).
 
 
 
=== Verifying the downloaded image file ===
 
 
 
{|  class="wikitable" style="width:95%; align=center"
 
|+ Commands to verify the checksum and GPG signature of a downloaded image file on different systems.
 
|-
 
! width=100px |  OS type
 
<code>sha265</code> check !! <code>sha265</code> calculation (to be compared manually) !! <code>GPG</code> signature verification
 
|-
 
! Linux
 
| <code>sha256sum -c alpine-*.iso.sha256</code> ||        || <code>curl https://alpinelinux.org/keys/ncopa.asc &#124; gpg --import ;</code>
 
<code> gpg --verify alpine-<version>.iso.asc alpine-<version>.iso</code>
 
|-
 
! Windows (PowerShell installed)
 
|                - ? -            || <code>Get-FileHash .\alpine-<image-version>.iso -Algorithm SHA256</code> || - ? -
 
|}
 
 
 
=== Booting from external devices ===
 
 
 
Insert the boot media to a proper drive or port of the computer and turn the machine on, or restart it, if already running.
 
 
 
If the computer does not automatically boot from the desired device, one needs to bring up the boot menu selection for choosing the media to boot from. Depending on the computer the menu may be accessed by quickly (repeatedly) pressing a key when booting starts, or sometimes it is needed to press the button before starting the computer and keep holding it when it boots. Typical keys are:  `F9`-`F12`, sometimes `F7` or `F8`. If these don'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: `Del.` `F1` `F2` `F6` or `Esc.`
 
 
 
=== Rebooting and testing the new system ===
 
 
 
After the installation is completed, the system may be power-cycled or rebooted to confirm that everything is working.
 
If the configured runtime mode was "sys", then remove the initial installation media to boot the newly installed system.
 
 
 
The relevant commands for this are <code>reboot</code> or  <code>poweroff</code>.
 
  
 
= Further Documentation =
 
= Further Documentation =
  
=== Installing ===
+
The installation script only installs the base operating system. Applications such as a web server, mail server, desktop environment, or web browser are not installed and <code>root</code> is the only normal user. For instructions on proceeding after installation, please see [[Tutorials_and_Howtos#Post-Install|Tutorials_and_Howtos Post-Install section]].
 
 
* [[Directly booting an ISO file]] ''(without flashing it to a disk or device)''
 
* [[Tutorials_and_Howtos#Networking|Setting up Networking]] ''(incl. non-standard configurations)''
 
 
 
 
 
=== Post-Install ===
 
  
<!-- If you edit post-install, also consider [[Tutorials_and_Howtos#Post-Install]], [[Developer_Documentation#Package_management]] and the Handbook. These are not exact duplicates. -->
+
More specific instructions and instructions for other architectures or machines (e.g. ARM, RPi, etc) are defined in [[Tutorials_and_Howtos#Installation:_Use_cases|Installation:_Use_cases]]. Also see the following wiki pages for more information:
 
 
 
 
* [[Setting up a new user]]
 
 
 
* [[Enable Community Repository]] ''(Providing additional packages)''
 
* [[Alpine Linux package management|Package Management (apk)]] ''(general search/add/del packages etc.)''
 
* [[Alpine setup scripts#setup-xorg-base|<code>setup-xorg-base</code>]] ''(display graphics, if required)''
 
** [[Xfce_Setup]] / [[Desktop-notes]] / [[Xfce_Desktop]]
 
 
 
* [[Alpine_local_backup|Local backup utility <code>lbu</code>]] ''(persisting RAM system configurations)''
 
** [[Back Up a Flash Memory Installation]] ''("diskless mode" systems)''
 
** [[Manually_editing_a_existing_apkovl]] ''(the stored custom configs)''
 
* [[Alpine Linux Init System|Init System (OpenRC)]] ''(Configure a service to automatically boot at next reboot)''
 
** [[Multiple Instances of Services]]
 
** [[Writing Init Scripts]]
 
 
 
* [[Hosting services on Alpine]] ''(Links to several mail/web/ssh server setup pages)''
 
* Runnig programs and services in their own [[Firejail Security Sandbox]]
 
 
 
* [[Alpine_Linux_package_management#Upgrade_a_Running_System|Upgrading Alpine]] ''(checking for and installing updates)''
 
* [[How_to_make_a_custom_ISO_image_with_mkimage]]
 
 
 
=== Further Help and Information ===
 
 
 
* [[Running glibc programs]] ''(Installation and development)''
 
 
 
<!-- * [[setup-acf]] ''(Configures ACF (webconfiguration) so you can manage your box through https)''
 
* [[Changing passwords for ACF|Changing passwords]]
 
-->
 
  
 
* [[FAQ|FAQs]]
 
* [[FAQ|FAQs]]
 
* [[Tutorials and Howtos]]
 
* [[Tutorials and Howtos]]
 
 
* [[Contribute|How to Contribute]]
 
* [[Contribute|How to Contribute]]
 
* [[Developer Documentation]]
 
* [[Developer Documentation]]
* [[Alpine_Linux:Wiki_etiquette|Wiki etiquette]] ''to collaborate on this documentation''
+
* [[Newbie Alpine Ecosystem]]
 
+
* [https://mckayemu.github.io/alpineinstalls/ https://mckayemu.github.io/alpineinstalls/ All informatin for Spanish users]
 
 
 
 
{{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, like e.g. in the [https://wiki.archlinux.org/ Arch Wiki], are to a large degree also well applicable to configure the software on alpine linux, thus can be very useful.}}
 
 
 
= See Also =
 
 
 
There may still be something useful to find and sort out of the newbie's install notes in this wiki, moving godd things into the structured handbook style documentation.
 
 
 
# [[Newbie_Alpine_Ecosystem]]
 
# [[Alpine newbie install manual]]
 
# [[Alpine_newbie#Install|Alpine_newbie Install section]]
 
# [https://mckayemu.github.io/alpineinstalls/ https://mckayemu.github.io/alpineinstalls/ All informatin for Spanish users]
 
  
 
[[Category:Installation]]
 
[[Category:Installation]]

Latest revision as of 14:53, 29 July 2020

Alpine Linux can be installed as the main operating system on a physical machine ("bare metal"), including on embedded devices. For example, PostmarketOS is a smartphone operating system based on Alpine, and Adélie Linux is a complete end-user distribution based on Alpine Linux. While this use case is less common than Alpine Linux's main use as a base system for container images in systems like Docker, this document describes how Alpine can be installed as the primary operating system for a computer.

Alpine in fact works as a live system—any install disk of Alpine can also be run without installing to local storage of the machine it's booted on, running directly from the install media!


Quick Requirements

Nearly any hardware should run Alpine Linux but the following basic requirements are recommended:

  • At least 128MB of RAM for server without GUI, or at least 1.6GB for graphical desktop
  • At least 1GB storage device for server without GUI, or at least 10GB for graphical desktop with web browsing

For more information, see Requirements.

Installation : setup-alpine : booting process until login prompt

Installation Overview

The following steps are brief and intended for the common case; for complete info and other architectures, please consult the Alpine newbie install manual.

1. Download the media source

The most common is to grab an ISO from [1]. Take note of architectures in green buttons.

2. Dump, burn or flash the image

Dump the ISO image onto a media source like USB/SD flashing; or CD/DVD/BR disk with burning software. In Linux, you can use dd if=<your iso filename> of=<your target media> bs=1M; sync, to flash a USB drive or SD card as target media install.

3. Boot and install process

Log in as the user root by typing root and hitting enter. Then execute setup-alpine, answering the questions and hitting enter after each:

Installation : setup-alpine : complete process single install
  • Select keyboard layout: Choose your keyboard layout, e.g. us or es.
    • Select variant: Choose your keyboard layout variant, e.g. us-nodeadkeys or es-winkeys.
  • Enter system hostname: Choose the name of your computer; localhost is good enough and recommended for starting.
  • Initialize network cards: Here most people can just go with the default (just press enter).
    • Any manual configuration: Perform other configuration if needed, otherwise just type "no" and hit enter.
    • Select domain name: This is not commonly asked, you can just hit enter.
  • DNS nameservers?: If asked, 8.8.8.8 is a recommended default that will be good for most people.
  • Changing password for root: Next a root password must be defined. Input a passphrase; what you type won't be shown on the screen.
    • Retype password: Type the same passphrase to confirm the root password; what you type won't be shown on the screen.
  • Which timezone to choose?: Set it to your local time zone or hit enter for UTC.
  • Proxy chooser: Type none and hit enter if you're not using a proxy.
  • Which NTP client to run?: This is for keeping the system clock in sync. The default is good enough for most people.
  • Enter mirror number: 1 is a good choice for most people.
  • Which SSH server?: An SSH server allows you to remotely manage your machine. The default is good enough for most people.
  • Disk Setup Choose how to set up your disks.
    • Which disks would you like to use?: Choose the disk where files will be installed. Usually sda is the hard disk and sdb is the USB boot or CD/DVD image.
    • How would you like to use it?: Type "sys" and then press enter. This will cause the OS to be installed to the chosen disk—similar to how other distributions work.

Take care that all data on your chosen disk will be erased. A final question will prompt you to continue. After confirming by typing 'y' and hitting enter, you cannot turn back.

After the script finishes installing the system, it will tell you to reboot. Note that:

  • If the configured runtime mode was "sys", then remove the initial installation media to boot the newly installed system.
  • If the configured runtime mode was "data", then keep the installation media inserted to boot the newly installed system.

To reboot, type reboot and hit enter. If you just wish to turn off the machine after installing, type poweroff instead.

Further Documentation

The installation script only installs the base operating system. Applications such as a web server, mail server, desktop environment, or web browser are not installed and root is the only normal user. For instructions on proceeding after installation, please see Tutorials_and_Howtos Post-Install section.

More specific instructions and instructions for other architectures or machines (e.g. ARM, RPi, etc) are defined in Installation:_Use_cases. Also see the following wiki pages for more information: