> ## Documentation Index
> Fetch the complete documentation index at: https://docs.strawberryfoundations.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Learn how to install StrawberryOS on your computer

## **1.**  Pre-installation

***

### Get the StrawberryOS Installation image

Currently, we only provide Installation Images via GitHub Actions.

### Prepare your boot medium

There are many different ways to start the StrawberryOS installer.
You can flash the image on a USB stick, burn a CD/DVD, boot from a PXE netboot server, or use Ventoy.

### Boot the Installer

Start from the StrawberryOS boot medium containing the installer.
You can do this by going to the boot menu after switching on your computer.
To do this, you usually have to press a specific key, for example F12.

***

### First steps

After you have started from your installation medium, you will land in a console where the bash shell is started.
If you are from a region outside the USA, you may want to change your keyboard layout.
The default keymap is US. Available layouts can be listed with:

```
# localectl list-keymaps
```

or

```
# ls /usr/share/keymaps/i386/<your_layout>
```

To select a different keyboard layout, you must enter the name of your desired keyboard layout as the argument of the loadkeys command. For the German keyboard layout as follows:

```
# loadkeys de-latin1
```

### Verify the boot mode

To check whether your computer supports UEFI, you can check the UEFI-Bitness.

```
# cat /sys/firmware/efi/fw_platform_size
```

If this command returns `64`, it means that your computer supports UEFI and you have booted with UEFI.
If the command fails, it means that your computer does not support UEFI or was not started with UEFI.

### Network

Make sure you are connected to the Internet if you want to continue with the installation.
You can execute the following command to enumerate your connections:

```
# ip link
```

You can then check whether your connection is working by pinging a server of your choice:

```
# ping strawberryfoundations.xyz
```

***

### Disk partitioning

Disk partitioning is an important part of the StrawberryOS installation.
You can use various tools to identify which hard disk you want to partition.
For example `lsblk` or `fdisk`:

```
# fdisk -l
# lsblk
```

Only hard disks named such as `sda`, `nvme0n1`, or `mmcblk0` are relevant.

#### Start partitioning your disk

To start the partitioning of your hard disk, we use the program fdisk.
If you want to use another program that you prefer, you can do so, but here we will only show you how to partition with fdisk.
To do this, run `fdisk /dev/the_disk_to_be_partitioned`

<Warning>
  During this process, all data on the hard disk is deleted.
  So be sure that the data on the hard disk is backed up!
</Warning>

<Tip>
  If your hard disk already has an EFI partition, do not create a new one.
  Use the existing one instead.
</Tip>

#### Example Layouts

These layouts are only example layouts.
You can change them according to your preferences. However, the basis of this layout should be adhered to

<AccordionGroup>
  <Accordion title="UEFI system with GPT" icon="hard-drive" iconType="duotone">
    | Mount point   | Partition             | Partition type     | Suggested size          |
    | ------------- | --------------------- | ------------------ | ----------------------- |
    | `/mnt/boot`   | `/dev/efi_partition`  | EFI System (FAT32) | 512MB                   |
    | `/mnt/system` | `/dev/base_partition` | Linux (ext4/btrfs) | At least 10GB           |
    | `/mnt/user`   | `/dev/data_partition` | Linux (ext4/btrfs) | Remainder of the device |
    | `[SWAP]`      | `/dev/swap_partition` | Linux swap         | At least 2GB            |
  </Accordion>

  <Accordion title="BIOS system with MBR" icon="hard-drive" iconType="duotone">
    | Mount point   | Partition             | Partition type     | Suggested size          |
    | ------------- | --------------------- | ------------------ | ----------------------- |
    | `/mnt/system` | `/dev/base_partition` | Linux (ext4/btrfs) | At least 10GB           |
    | `/mnt/user`   | `/dev/data_partition` | Linux (ext4/btrfs) | Remainder of the device |
    | `[SWAP]`      | `/dev/swap_partition` | Linux swap         | At least 2GB            |
  </Accordion>
</AccordionGroup>

### Filesystem structure

Here are 2 examples of successful layouts after you have started the system for the first time.
Currently they are not relevant, but can help to get a better understanding of the basic structure of StrawberryOS.

<AccordionGroup>
  <Accordion title="UEFI system with GPT" icon="hard-drive" iconType="duotone">
    | Mount point | Partition              | Partition type | Size   |
    | ----------- | ---------------------- | -------------- | ------ |
    | `/      `   | `rootfs` (`overlayfs`) | -              | -      |
    | `/boot`     | `/dev/sda1`            | Linux (ext4)   | 512MB  |
    | `/system`   | `/dev/sda2`            | Linux (ext4)   | 9,3GB  |
    | `/user`     | `/dev/sda3`            | Linux (ext4)   | 10,7GB |
    | `[SWAP]`    | `/dev/sda4`            | Linux swap     | 2GB    |
  </Accordion>

  <Accordion title="BIOS system with MBR" icon="hard-drive" iconType="duotone">
    | Mount point | Partition              | Partition type | Size   |
    | ----------- | ---------------------- | -------------- | ------ |
    | `/      `   | `rootfs` (`overlayfs`) | -              | -      |
    | `/system`   | `/dev/sda1`            | Linux (ext4)   | 9,3GB  |
    | `/user`     | `/dev/sda2`            | Linux (ext4)   | 10,7GB |
    | `[SWAP]`    | `/dev/sda3`            | Linux swap     | 2GB    |
  </Accordion>
</AccordionGroup>

### Format the partitions

<Info>
  Replace the placeholders base\_partition, data\_partition, swap\_partition and efi\_partition with the corresponding block devices!
</Info>

When you have created your partitions, you must first format them so that you can use them.
To format your base partition with ext4, you can use the following command, for example:

```
# mkfs.ext4 /dev/base_partition
```

And for your user data partition:

```
# mkfs.ext4 /dev/data_partition
```

If you have created a swap partition, you must also format it:

```
# mkswap /dev/swap_partition
```

If you have a computer that is equipped with UEFI, you still need to format your previously created EFI partition:

<Warning>
  Only format the partition if you have also created an EFI partition beforehand.
  Otherwise, you will delete the existing EFI partition and thus delete the possibility of creating other partitions!!
</Warning>

```
# mkfs.fat -F 32 /dev/efi_partition
```

***

### Mount your file systems

Now start mounting your freshly created file systems so you can start installing StrawberryOS!
Let's start with your base partition:

```
# mount --mkdir /dev/base_partition /mnt
```

For UEFI systems, mount the EFI system partition:

```
# mount --mkdir /dev/efi_partition /mnt/boot/efi
```

If you have created a swap partition, you can enable it with `swapon`:

```
# swapon /dev/swap_partition
```

***

## **2.**  Installation

Now we can finally start the installation.

### Bootstrapping your system

The first step to get the basic system is to download and configure StrawberryOS.
Our tool `os-bootstrap` will help you.

```
# os-bootstrap install -t /mnt/
```

This installs the basics (`base`) of StrawberryOS to `/mnt/`.
However, there are other packages that you can install to help you have a more complete system.
The following packages are available:

| Name       | Description                                        |
| ---------- | -------------------------------------------------- |
| `base`     | The minimum requirements to install StrawberryOS   |
| `base-dev` | Various development tools for software development |
| `utils`    | Useful tools                                       |
| `python3`  | The application & development kit for python3      |

***

## **3.**  Configuring your system

### Initramfs

Now we have to configure the Initram file system of our system.
Our `os-bootstrap` tool simplifies this task for you.

```
# os-bootstrap initramfs install -d /dev/data_partition -t /mnt/
```

### Entering your new system

We will now begin to fully configure your new system.
To do this, you must chroot in your new system.

```
# os-bootstrap chroot /mnt
```

<AccordionGroup>
  <Accordion title="Manual chroot" icon="computer" iconType="duotone">
    ```
    # mount --bind /dev /mnt/dev
    # mount --bind /sys /mnt/sys
    # mount --bind /proc /mnt/proc
    # chroot /mnt
    ```
  </Accordion>
</AccordionGroup>

### General configuration

**Time**

Configure your time zone with the following command:

```
# ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
```

Replace Region and City with your actual Region and City (e.g Europe/Berlin)

**Set root password**

Set your root password:

```
# passwd
```

## **4.**  Finalizing your system

You are almost finished and can start your new system right away!
Before that, however, there is one more important step to take, and that is to install a bootloader.

### Bootloader

Currently we only offer installation instructions for GRUB.
To install Grub correctly for StrawberryOS, a setting must be changed first.
Open the file `/etc/default/grub` and add an `overlay=yes` in the line where `GRUB_CMDLINE_LINUX=""` is written inside the quotation marks.
It should then look like this:

```bash /etc/default/grub theme={null}
GRUB_CMDLINE_LINUX="overlay=yes"
```

Before you continue, you must exit the chroot environment if you have not already done so.
You can easily do this with the `exit` command.
Now you can proceed with the installation of Grub for the respective platform.

<AccordionGroup>
  <Accordion title="UEFI system with GPT" icon="hard-drive" iconType="duotone">
    If not already done, mount your EFI partition:

    ```
    # mount --mkdir /dev/efi_partition /mnt/boot/efi
    ```

    ```
    # grub-install --efi-directory=/mnt/boot/efi --boot-directory=/mnt/boot/ --bootloader-id=StrawberryOS /dev/sda
    # os-bootstrap chroot /mnt
    # grub-mkconfig -o /boot/grub/grub.cfg
    ```
  </Accordion>

  <Accordion title="BIOS system with MBR" icon="hard-drive" iconType="duotone">
    ```
    # grub-install --boot-directory=/mnt/boot/ /dev/sda
    # os-bootstrap chroot /mnt
    # grub-mkconfig -o /boot/grub/grub.cfg
    ```
  </Accordion>
</AccordionGroup>

### Post-installation

Your new system should now be ready to use!
To restart, first exit the chroot by typing `exit` in the terminal or pressing `Ctrl+D`.
However, after starting your new system, you will only end up in a terminal shell.
If you want to install a graphical environment, have a look at the article on [General recommendations](/strawberry-os/recommendations).
