User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
gentoo:installation [2024/02/29 08:14] – [The fast&quick Gentoo Installation checklist] willygentoo:installation [2025/03/13 14:49] (current) – [The fast&quick Gentoo Installation checklist] willy
Line 1: Line 1:
-====== Internal and External Servers Operating System ======+====== A) Gentoo Linux Installation ======
  
-The **internal** server should be GentooIf you prefer a different distributiongo aheadbut you will need to adapt all the future instruction as i will use Gentoo.+Why [[https://www.gwntoo.org|Gentoo Linux]]? In shortbecause its lightweightgives you full control on your server and can be much more secure than others bloated Linux distributions. More in detail.
  
-The **external** server again should be Gentoobut specially on VPSs you might not have freedom of choice. As far as it's a reliable Linux distributionyou should be fine. After all, you will only run tunnels on it.+These instructions are aimed at supporting you during the installation of your home server, the one on which mostor all, your self-hosted home services will run. This same page can be referred to when installing your //external// server(s), provided they don't already come pre-installed with some other flavour of Linux.
  
-All the following applies to the //internal// server. Most of it also the //external// serverif you are installing Gentoo there too. +This is not meant to be an exustive guide, as there are plenty of good resources on the topicspecially the amazing [[https://wiki.gentoo.org/wiki/Handbook:AMD64|Gentoo Handbook]] which is the Gentoo Bible for installation.
- +
-===== Quick & Dirty Gentoo Installation ===== +
- +
-Why [[https://www.gwntoo.org|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 unneeded. 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 unneeded.
- 
-For reference, always follow the [[https://wiki.gentoo.org/wiki/Handbook:AMD64|Gentoo Handbook]] which is the Gentoo Bible. 
  
 Installing Gentoo Linux is less difficult than you might think. The great [[https://wiki.gentoo.org/wiki/Handbook:AMD64|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. Installing Gentoo Linux is less difficult than you might think. The great [[https://wiki.gentoo.org/wiki/Handbook:AMD64|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 ===== ===== The fast&quick Gentoo Installation checklist =====
Line 22: Line 17:
  
 **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. **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.
 +
 +I will assume your home server has one drive dedicated to the Gentoo installation. Data, media, and other files will be stored on a separate RAID array of some kind.
 +
 +Please do not configure that RAID array now, but read the [[gentoo:storage|Storage Setup]] page.
  
 === Get Ready for First Boot === === Get Ready for First Boot ===
Line 33: Line 32:
 Mount your root folder: Mount your root folder:
 <code bash> <code bash>
- > mount /dev/sda2 /mnt/gentoo+mount /dev/sda2 /mnt/gentoo
 </code> </code>
  
Line 40: Line 39:
 Decompress the Stage 3, be careful to specify the following options (the 'p' one is critical!): Decompress the Stage 3, be careful to specify the following options (the 'p' one is critical!):
 <code bash> <code bash>
- > cd /mnt/gentoo +cd /mnt/gentoo 
- tar xvfp stage3.blah-blah.tar.zy +tar xvfp stage3.blah-blah.tar.zy 
 </code> </code>
  
 Prepare and enter the chroot environment: Prepare and enter the chroot environment:
 <code bash> <code bash>
- > cp /etc/resolv.conf /mnt/gentoo/etc +cp /etc/resolv.conf /mnt/gentoo/etc 
- modprobe efivarfs +modprobe efivarfs 
- for i in dev dev/pts sys run proc sys/firmware/efi/efivars; do mount /$i /mnt/gentoo/$i -o bind; done +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 +chroot /mnt/gentoo /bin/bash 
- source /etc/profile+source /etc/profile
 </code> </code>
  
Line 57: Line 56:
 You also need, now, to mount the boot/efi partition in side the chroot (let's assume it's **/dev/sda1**), so something like: You also need, now, to mount the boot/efi partition in side the chroot (let's assume it's **/dev/sda1**), so something like:
 <code bash> <code bash>
-mkdir /boot +mkdir /boot 
- mount /dev/sda1 /boot+mount /dev/sda1 /boot
 </code> </code>
  
Line 70: Line 69:
 It's time to populate the portage tree: It's time to populate the portage tree:
 <code bash> <code bash>
- > emerge --sync+emerge --sync
 </code> </code>
  
 Configure your timezone (choose the correct one): Configure your timezone (choose the correct one):
 <code bash> <code bash>
- > echo "Europe/Brussels" > /etc/timezone +echo "Europe/Brussels" > /etc/timezone 
- emerge --config sys-libs/timezone-data+emerge --config sys-libs/timezone-data
 </code> </code>
  
 Configure your locales by editing the file **/etc/locale.gen** and running: Configure your locales by editing the file **/etc/locale.gen** and running:
 <code bash> <code bash>
- > locale-gen+locale-gen
 </code> </code>
  
 And select your preferred profile. I would choose a plain basic profile like **default/linux/amd64/17.1** or a **selinux/hardened** one if you feel adventurous: And select your preferred profile. I would choose a plain basic profile like **default/linux/amd64/17.1** or a **selinux/hardened** one if you feel adventurous:
 <code bash> <code bash>
- > eselect profile list+eselect profile list
 </code> </code>
  
 Install and properly setup your CPU flags: Install and properly setup your CPU flags:
 <code bash> <code bash>
- > emerge -vp cpuid2cpuflags +emerge -vp cpuid2cpuflags 
- echo "*/* $(cpuid2cpuflags)" > /etc/portage/package.use/00cpu-flags+echo "*/* $(cpuid2cpuflags)" > /etc/portage/package.use/00cpu-flags
 </code> </code>
  
 Now reinstall/recompile the basic system according to your selections: Now reinstall/recompile the basic system according to your selections:
 <code bash> <code bash>
- > emerge -uv --deep --newuse @world+emerge -uv --deep --newuse @world
 </code> </code>
  
 And it's time to install some basic stuff (pick your own! there are also many choices): And it's time to install some basic stuff (pick your own! there are also many choices):
 <code bash> <code bash>
- > emerge -vp genkernel gentoo-sources pci-utils usbutils mdadm vim tmux cronie  syslog-ng bash-completion chrony dosfstools  io-scheduler-udev-rules intel-microcode + > emerge -vp genkernel gentoo-sources pciutils usbutils mdadm vim tmux cronie  syslog-ng bash-completion chrony dosfstools  io-scheduler-udev-rules intel-microcode 
 </code> </code>
 Research each one and pick yours. Research each one and pick yours.
Line 108: Line 107:
 Now it's time to build the kernel: Now it's time to build the kernel:
 <code bash> <code bash>
- > eselect kernel set 1 +eselect kernel set 1 
- genkernel --mountboot --install all+genkernel --mountboot --install all
 </code> </code>
  
 Then create a user and set root password: Then create a user and set root password:
 <code bash> <code bash>
- > passwd +passwd 
- useradd user +useradd user 
- passwd user+passwd user
 </code> </code>
  
 Setup network and ensure SSH starts by default on boot (i assume your ethernet device is called xxx, you can check in /sys/class/net): Setup network and ensure SSH starts by default on boot (i assume your ethernet device is called xxx, you can check in /sys/class/net):
 <code bash> <code bash>
- > vi /etc/conf/net +vi /etc/conf/net 
- rc-update add sshd default +rc-update add sshd default 
- ln -s /et/init.d/net.lo /etc/init.d/net.xxx +ln -s /et/init.d/net.lo /etc/init.d/net.xxx 
- rc-update add net.xxx default+rc-update add net.xxx default
 </code> </code>
  
 Last, setup boot loader (Grub2 here): Last, setup boot loader (Grub2 here):
 <code bash> <code bash>
- > +grub-install --target=x86_64-efi --efi-directory=/boot
 </code> </code>
  
Line 148: Line 147:
 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. 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 for the Internal Server =====+===== Specific installation finalization =====
  
 (not needed for the **external** server) (not needed for the **external** server)
Line 155: Line 154:
  
 <code bash> <code bash>
- > groupadd media+groupadd media
 </code> </code>
  
Line 162: Line 161:
 There are also a few specific tools we need to install for what comes ahead, let's do it: There are also a few specific tools we need to install for what comes ahead, let's do it:
 <code bash> <code bash>
- > emerge -v sys-fs/mdadm+emerge -v sys-fs/mdadm
 </code> </code>
  

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