Difference between revisions of "Installation"

From Alpine Linux
Jump to: navigation, search
(add link to Rackspace install doc)
(cited two times the more complete reference for install manual)
 
(255 intermediate revisions by 27 users not shown)
Line 1: Line 1:
The following information will assist you with the installation of [http://alpinelinux.org/about Alpine Linux].
+
While Alpine Linux is often used as base image for linux containers, it can of course be also installed on bare metal machine as well. That is the focus of this document.
[[Image:hdd_mount.png|left|link=]]
 
<br />
 
  
== Installation Quick-Start in 3 Easy Steps ==
+
So remenber, this first document is a general use case, '''[[Alpine newbie install manual]]''' is the main reference to more ways to perform installation or permanent data saving on a device, for others hardware and use case
<div style="float:left; font-size:30px; font-weight:bold;">
 
1st
 
</div>
 
<div style="margin-left:65px; background-color:#EDF2F2; border-style:solid; border-color:#6F7C91; border-width:0px; border-left-width:5px; min-height:55px; padding:5px;">
 
[http://alpinelinux.org/downloads Download] the latest stable-release ISO.
 
</div>
 
  
 +
__TOC__
 +
__FORCETOC__
  
<div style="float:left; font-size:30px; font-weight:bold;">
+
= Quick Requirements =
2nd
 
</div>
 
<div style="margin-left:65px; background-color:#E0E9E9; border-style:solid; border-color:#606A82; border-width:0px; border-left-width:5px; min-height:55px; padding:5px;">
 
[[Burning ISOs|Burn the ISO onto a blank CD]] using your favorite CD burning software.
 
</div>
 
  
 +
Nearly any hardware should run Alpine Linux but the following basic requirements are recommended:
  
<div style="float:left; font-size:30px; font-weight:bold;">
+
* At least 128MB of RAM for server without GUI, or at least 1.6GB for graphical desktop
3rd
+
* At least 1GB storage device for server without GUI, or at least 10GB for graphical desktop with web browsing
</div>
 
<div style="margin-left:65px; background-color:#9faecc; border-style:solid; border-color:#324065; border-width:0px; border-left-width:5px; min-height:55px; padding:5px;">
 
Boot from the CD, login as root with no password, and voilà! Enjoy Alpine Linux!
 
</div>
 
  
{{Clear}}
+
For more information, see [[Requirements]].
One of the [[Installation#Post-Install|first commands you might want to use]] is <code>[[setup-alpine]]</code>.
 
  
== Installation Handbook ==
+
[[File:Installation-alpine-alpine-setup-2-boot.png|350px|thumb|right|Installation : setup-alpine : booting process until login prompt]]
=== Basics ===
 
Alpine can be used in any of three modes:
 
<dl>
 
<dt>diskless mode
 
<dd>You'll boot from read-only medium such as the installation CD, a [[Create a Bootable USB|USB key]], or a [[Create a Bootable Compact Flash|Compact Flash card]]. {{Tip| To prepare either a USB or Compact Flash card, you can use the <code>[[setup-bootable]]</code> script; see the pages linked above for details.}} When you use Alpine in this mode, you need to use [[Alpine local backup|Alpine Local Backup (lbu)]] to save your modifications between reboots. That requires some writable medium, usually removable. {{Note| When the <code>[[setup-alpine]]</code> script asks for a disk, say "none". It will then prompt whether you'd like to preserve modifications on any writable medium.}}
 
<dt>data mode
 
<dd>As in diskless mode, your OS is run from a read-only medium. However, here a writable partition (usually on a hard disk) is used to store the data in {{Path|/var}}. That partition is accessed directly, rather than copied into a tmpfs; so this is better-suited to uses where large amounts of data need to be preserved between reboots. {{Note| The <code>[[setup-alpine]]</code> script handles installing Alpine in this mode, too, when you supply a writable partition instead of "none", and request mode "data".}} This mode may be used for mailspools, database and log servers, and so on.
 
<dt>sys mode
 
<dd>This is a [[Install to disk|traditional hard-disk install]] (see link for details). <!-- includes [[Installing Alpine on HDD overwriting everything]] --> Both the boot system and your modifications are written to the hard disk, in a standard Linux hierarchy. {{Note| The <code>[[setup-alpine]]</code> script handles installing Alpine in this mode, too, when you supply a writable partition instead of "none", and request mode "sys". By default, it will create three partions on your disk, for {{Path|/boot}}, {{Path|/}}, and {{Path|swap}}; however you can also [[Setting up disks manually|partition your disk manually]].
 
}} This mode may be used for desktops, development boxes, and virtual servers.
 
    <!-- [[Native Harddisk Install 1.6]] Obsolete -->
 
</dl>
 
  
=== Advanced ===
+
= Installation Overview =
* [[Tutorials_and_Howtos#Storage|Setting up storage with RAID, LVM, LUKS encryption, iSCSI, or suchlike]]
 
* [[Setting up disks manually]]
 
* [[Bootmanagers]]
 
* [[Migrating data]]
 
* Details about [[Alpine setup scripts]]
 
  
* [[Installing Alpine on HDD dualbooting|Install to HDD with dual-boot]]
+
The following steps are brief and intended for the common case; for complete info and other architectures, '''[[Alpine newbie install manual]]''' is the main reference to more ways to perform installation or permanent data saving on a device, for others hardware and use cases.
* [[Replacing non-Alpine Linux with Alpine remotely]]
 
<!-- [[Installing Xubuntu using Alpine boot floppy]] Obsolete -->
 
<!-- [[Installing Alpine Linux on USB Automated]] Obsolete -->
 
  
<!-- If you edit the following, please coordinate with Developer_Documentation#Configuring_your_system.  Note that these two sections are not exact duplicates. -->
+
== 1. Download the installation image ==
* [[Installing Alpine Linux in a chroot]]
 
  
* Install Alpine on [[Install Alpine on VirtualBox|VirtualBox]], [[Install Alpine on VMware|VMware]], [[Install Alpine on coLinux|coLinux]], [[Qemu]], <!-- includes [[Install Alpine in Qemu]], [[Running Alpine in Qemu Live mode]], [[Running Alpine Linux As a QEMU networked Guest]] -->, [[Install Alpine on Amazon EC2|Amazon EC2]], or [[Install Alpine on Rackspace|RackSpace]]
+
You need to acquire installation image, usually from [http://alpinelinux.org/downloads]. Most likely you will want the standard edition. Make sure you download the image for correct architecture.
  
* [[Xen Dom0]] ''(Setting up Alpine as a dom0 for Xen hypervisor)''
+
== 2. Create the installation medium ==
** [[Xen Dom0 on USB or SD]]
 
** [[Create Alpine Linux PV DomU]]
 
** [[Xen LiveCD]]
 
  
* [[Setting up a basic vserver]]
+
Either you can burn the image onto CD/DVD, you use usb stick for the installation.
* [[Setting up the build environment on HDD]]
 
* [[Setting up a compile vserver]] for official or for [[Setting up a compile vserver for third party packages|third party]] packages
 
<!-- [[Create an Alpine 1.9 vserver template]] -->
 
  
=== Post-Install ===
+
Under linux, you can use the dd for that:
<!-- If you edit this, please coordinate with and Tutorials_and_Howtos#Post-Install and Developer_Documentation#Package_management. Note that these three sections are not exact duplicates. -->
 
  
<!-- [[Configure Networking]] -->
+
<code><nowiki>dd if=<source iso> of=<target device> bs=4M; sync</nowiki></code>
* [[Tutorials_and_Howtos#Networking|Setting up Networking]]
 
* [[Alpine Linux package management|Package Management (apk)]] ''(How to add/remove packages on your Alpine)''
 
  <!-- [[Alpine Linux package management#Local_Cache|How to enable APK caching]] -->
 
* [[Alpine local backup|Alpine local backup (lbu)]] ''(Permanently store your modifications in case your box needs reboot)''
 
** [[Back Up a Flash Memory Installation]]
 
** [[Manually editing a existing apkovl]]
 
* [[Alpine Linux Init System|Init System (OpenRC)]] ''(Configure a service to automatically boot at next reboot)''
 
** [[Multiple Instances of Services]]
 
  <!-- [[Writing Init Scripts]] -->
 
  
* [[Upgrading Alpine]]
+
Make sure that the device '''does not''' include partition number, so example from my machine:
<!-- Obsolete
 
[[Upgrading Alpine - v1.9.x]]
 
[[Upgrading Alpine - CD v1.8.x]]
 
[[Upgrading Alpine - HD v1.8.x]]
 
[[Upgrade to repository main|Upgrading to signed repositories]]
 
-->
 
  
* [[Setting up a ssh-server]] ''(Using ssh is a good way to administer your box remotely)''
+
<code><nowiki>dd if=~/Downloads/alpine-standard-3.10.2-x86_64.iso of=/dev/sdb bs=4M</nowiki></code>
* [[setup-acf]] ''(Configures ACF (webconfiguration) so you can manage your box through https)''
 
* [[Changing passwords for ACF|Changing passwords]]
 
  
<!-- [[Running glibc programs]] Installation and Dev -->
+
The target device '''will be erased''', so make sure you use something without any data you do not
 +
want to lose.
  
 +
== 3. Boot and install process ==
  
=== Install based on eglibc ===
+
Log in as the user <code>root</code> and execute [[Alpine_setup_scripts#setup-alpine|setup-alpine]] and answer all the questions asked. Quick step-by-step walkthrough (go read [[Alpine_setup_scripts#setup-alpine|setup-alpine]] for more in-depth explanation):
* [[Setting the timezone]]
+
 
 +
[[File:Installation-alpine-alpine-setup-3-setup-scripts.png|350px|thumb|right|Installation : setup-alpine : complete process single install]]
 +
 
 +
===== Keyboard layout and variant =====
 +
 
 +
As you would expect, this is keyboard layout you want. If you are not sure, answering <code>us</code> to both layout and variant will get you started and you can change it later.
 +
 
 +
===== System hostname =====
 +
 
 +
Pick the name of your computer, while not mandatory, something unique if prefered. Or you can just use <code>localhost</code> if you do not care.
 +
 
 +
===== Network configuratinon =====
 +
 
 +
You will be asked ''which'' network interface you want to configure, if you are not sure, picking the offered default would likely work. Once selected, you will be asked <code>Ip address for XXX?</code>, you can either assign an IP address or write <code>dhcp</code>, which will mean take configuration from the network (the <code>dhcp</code> works great for home networks where you do not care about IP of your machine).
 +
 
 +
Assuming you decided to configure network yourself with IP address, you will also be asked for netmask, gateway, dns domain name and dns server IP. Correct values for there are beyond the scope of this document, please refer to your network administrator for guidance instead.
 +
 
 +
===== Password for root =====
 +
 
 +
Well this one is obvious.
 +
 
 +
===== Timezone =====
 +
 
 +
For servers, it is common to use UTC, for non-server machines, your local timezone should be likely used. Notice that you can use <code>?</code> to list the timezone.
 +
 
 +
===== HTTP/FTP Proxy =====
 +
 
 +
Most likely default (<code>none</code>) is the correct choice.
 +
 
 +
===== NTP client =====
 +
 
 +
Which client to use for keeping the system clock in sync, default works for most people.
 +
 
 +
===== Mirror =====
 +
 
 +
Pick mirror from which to download updates, <code>1</code> is CDN backed by Fastly, so reasonable choice for most people.
 +
 
 +
===== SSH server =====
 +
 
 +
Which SSH server do you want to configure on your machine. If you know that you will '''not''' connect to your machine remotely (most laptops for example), <code>none</code> should be used. Otherwise, the default (<code>openssh</code>) is a good pick.
 +
 
 +
===== Disk setup =====
 +
 
 +
Here your can pick the device to install the system on and also the mode in which it should be installed. For overview of the modes, see [[Alpine_setup_scripts#setup-modes|this]]. If you are not sure or just starting up, <code>sys</code> is likely what you want, it is the same mode that other distributions use for installation.
 +
 
 +
'''All data on the chosen device will be erased!'''
 +
 
 +
===== Reboot =====
 +
 
 +
After the script finishes installing the system, it will tell you to reboot. Note that:
 +
 
 +
* 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.
 +
 
 +
Then execute <code>reboot</code> and once the machine restarts and finishes booting up, you should see login prompt of your new Alpine Linux installation.
 +
 
 +
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]].
 +
 
 +
= Further Documentation =
 +
 
 +
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:
  
=== Further Help and Information ===
 
 
* [[FAQ|FAQs]]
 
* [[FAQ|FAQs]]
 
* [[Tutorials and Howtos]]
 
* [[Tutorials and Howtos]]
 
* [[Contribute|How to Contribute]]
 
* [[Contribute|How to Contribute]]
 
* [[Developer Documentation]]
 
* [[Developer Documentation]]
 +
* [[Newbie Alpine Ecosystem]]
 +
 +
== External links ==
 +
 +
* [https://mckayemu.github.io/alpineinstalls/ More information, in Spanish]
  
 
[[Category:Installation]]
 
[[Category:Installation]]

Latest revision as of 01:44, 4 November 2020

While Alpine Linux is often used as base image for linux containers, it can of course be also installed on bare metal machine as well. That is the focus of this document.

So remenber, this first document is a general use case, Alpine newbie install manual is the main reference to more ways to perform installation or permanent data saving on a device, for others hardware and use case


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, Alpine newbie install manual is the main reference to more ways to perform installation or permanent data saving on a device, for others hardware and use cases.

1. Download the installation image

You need to acquire installation image, usually from [1]. Most likely you will want the standard edition. Make sure you download the image for correct architecture.

2. Create the installation medium

Either you can burn the image onto CD/DVD, you use usb stick for the installation.

Under linux, you can use the dd for that:

dd if=<source iso> of=<target device> bs=4M; sync

Make sure that the device does not include partition number, so example from my machine:

dd if=~/Downloads/alpine-standard-3.10.2-x86_64.iso of=/dev/sdb bs=4M

The target device will be erased, so make sure you use something without any data you do not want to lose.

3. Boot and install process

Log in as the user root and execute setup-alpine and answer all the questions asked. Quick step-by-step walkthrough (go read setup-alpine for more in-depth explanation):

Installation : setup-alpine : complete process single install
Keyboard layout and variant

As you would expect, this is keyboard layout you want. If you are not sure, answering us to both layout and variant will get you started and you can change it later.

System hostname

Pick the name of your computer, while not mandatory, something unique if prefered. Or you can just use localhost if you do not care.

Network configuratinon

You will be asked which network interface you want to configure, if you are not sure, picking the offered default would likely work. Once selected, you will be asked Ip address for XXX?, you can either assign an IP address or write dhcp, which will mean take configuration from the network (the dhcp works great for home networks where you do not care about IP of your machine).

Assuming you decided to configure network yourself with IP address, you will also be asked for netmask, gateway, dns domain name and dns server IP. Correct values for there are beyond the scope of this document, please refer to your network administrator for guidance instead.

Password for root

Well this one is obvious.

Timezone

For servers, it is common to use UTC, for non-server machines, your local timezone should be likely used. Notice that you can use ? to list the timezone.

HTTP/FTP Proxy

Most likely default (none) is the correct choice.

NTP client

Which client to use for keeping the system clock in sync, default works for most people.

Mirror

Pick mirror from which to download updates, 1 is CDN backed by Fastly, so reasonable choice for most people.

SSH server

Which SSH server do you want to configure on your machine. If you know that you will not connect to your machine remotely (most laptops for example), none should be used. Otherwise, the default (openssh) is a good pick.

Disk setup

Here your can pick the device to install the system on and also the mode in which it should be installed. For overview of the modes, see this. If you are not sure or just starting up, sys is likely what you want, it is the same mode that other distributions use for installation.

All data on the chosen device will be erased!

Reboot

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.

Then execute reboot and once the machine restarts and finishes booting up, you should see login prompt of your new Alpine Linux installation.

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.

Further Documentation

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:

External links