User Tools

This is an old revision of the document!


Quick & Dirty Gentoo Installation

Why Gentoo Linux? Because its lightweight, gives you full control on your server and can be much more secure than others bloated Linux distributions.

When installing Gentoo Linux you have the total freedom to choose any single piece of the system, including whether to install or not a Cron Daemon and even a logger daemon. No other distro gives you so much freedom. Moreover, while you can use SystemD and NetworkManager with Gentoo, you are not forced to use them, and in fact specially for small servers, they might both be uneeded.

For reference, always follow the Gentoo Handbook which is the Gentoo Bible.

Installing Gentoo Linux is less difficult than you might think. The great Gentoo Handbook is very well written and also fairly easy to follow if you don't rush it. I assume you are capable of following it up until you can boot a text-only system.

The fast&quick Gentoo Installation checklist

This is NOT a comprehensive installation guide rather a list of quick points to keep in mind while following the already mentioned Gentoo Handbook above.

Prerequisite: you already know where (on which disk/partition) you are going to install Gentoo and which IP address you want to use for your home (internal) network.

Get Ready for First Boot

Burn Gentoo installation ISO to a CD or a USB key.

Format your root partition on your PC harddrive Once inside, you will need to be root for all the subsequent steps.

Create a folder /mnt/gentoo:

 > mkdir /mnt/gentoo

Download Gentoo Stage 3 tarball from same link as installation ISO, then decompress it:

  • From Gentoo boot ISO, you can use <b>links</b> from text mode.
  • You will need to setup network, if not available. See the handbook above.
 > cd /mnt/gentoo
 >
 > tar xvfp stage3.blah-blah.tar.zy <-- note that the "p" is VERY important!

Prepare the chroot environment:

 > cp /etc/resolv.conf /mnt/gentoo/etc
 > modprobe efivarfs
 > for i in dev dev/pts sys run proc sys/firmware/efi/efivars; do mount /$i /mnt/gentoo/$i -o bind; done
 > chroot /mnt/gentoo /bin/bash
 > mkdir /boot 
 > mount /dev/sda1 /boot

Accept licenses, put this into <b>/etc/portage/make.conf</b>:

ACCEPT_LICENSE="-* @FREE @BINARY-REDISTRIBUTABLE @EULA"

echo “Europe/Brussels” > /etc/timezone emerge –config sys-libs/timezone-data /etc/locale.gen locale-gen

emerge –sync

eselect profile list

emerge -uv –deep –newuse @world

emerge -vp vim tmux cronie cpuid2cpuflags syslog-ng bash-completion chrony dosfstools io-scheduler-udev-rules intel-microcode emerge -vp genkernel gentoo-sources pci-utils usbutils mdadm

eselect kernel set 1

genkernel –mountboot –install all

passwd useradd user passwd user

edit /etC/conf/net rc-update add sshd default ln -s /etC/init.d/net.lo /etc/init.d/net.xxx rc-update add net.xxx default

A few notes to follow:

  • don't bother with setting up the external data disks, you will do it later
  • don't install any graphical user interface, you will not need it
  • don't install SystemD as all commands are not for SystemD (or install it and adapt the commands)

Note: i don't care for SystemD. It does fix a problem i don't have and never had. It's a complication i never had a need for, and Gentoo gives me the choice to not use it. Please use it yourself if you prefer, just adapt the commands where it is involved accordingly.

Specific installation finalization

You will need to create a special group called media which will be used to allow the different tools to access the respective data folders without compromising the security of your installation and media collection:

 > groupadd media

this will create a new group called media. You will need it later.

There are also a few specific tools we need to install for what comes ahead, let's do it:

 > emerge -v sys-fs/mdadm

mdadm are the software RAID tools.

Once you have Gentoo installed on your hardware, keep reading.

Docker

Refer to: Gentoo Docker

emerge –ask –verbose app-containers/docker app-containers/docker-cli docker-compose

rc-update add docker default rc-service docker start

user $sudo sysctl net.ipv4.ip_forward=1

A more permanent change can be made with: FILE /etc/sysctl.d/local.confEnable ip forwarding persistently

net.ipv4.ip_forward=1

docker run –rm hello-world

This website uses technical cookies only. No information is shared with anybody or used in any way but provide the website in your browser.

More information