recettes/Homelab/Installer serveur Linux.md
gribse ecdfa2f7c4 Squashed 'temp-repo/' content from commit 6688605
git-subtree-dir: temp-repo
git-subtree-split: 6688605ad41f49d1eccead8d29421c658cad0100
2025-10-06 19:14:58 +02:00

6.3 KiB
Executable file
Raw Blame History

type date maturity
ressource 2025-02-18T10:25 graine
sudo apt install btop
sudo ubuntu-drivers autoinstall

Installing ZSH

Zsh

sudo apt install git fonts-font-awesome

sudo apt install zsh
chsh -s $(which zsh)

echo $SHELL

Installing ZSH · ohmyzsh/ohmyzsh Wiki · GitHub

Oh-my-zsh

Install

sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

Plugins

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

nvim ~/.zshrc

add :

plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

Themes

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

nvim ~/.zshrc
ZSH_THEME="`powerlevel10k/powerlevel10k`"

redémarrer zsh et suivre la configuration de powerlever10k

Source : Install and Setup ZSH on Ubuntu Linux

Docker and Docker Compose

Install Prerequisite Packages

Install the necessary packages to allow apt to use a repository over HTTPS.

sudo apt update && sudo apt upgrade
sudo apt install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common \
    gnupg

Add Dockers Official GPG Key

Add Dockers official GPG key to your system to ensure the authenticity of the packages.

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Set Up the Docker Repository

Add the Docker repository to APT sources.

echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install Docker

Update the package index again and install Docker.

sudo apt install docker-ce docker-ce-cli containerd.io

Verify Docker Installation

Check if Docker is installed correctly by running the hello-world image.

sudo docker run hello-world

Install Docker Compose

Download the current stable release of Docker Compose.

DOCKER_COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep -Po '"tag_name": "\K.*\d')
sudo curl -L "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Apply Executable Permissions to the Docker Compose Binary

Make the Docker Compose binary executable.

sudo chmod +x /usr/local/bin/docker-compose

Verify Docker Compose Installation

Check the version of Docker Compose to verify the installation.

docker-compose --version

Create docker group

  1. Add your user to the docker group:
sudo usermod -aG docker $USER
  1. Log out and log back in, or use the newgrp command:
newgrp docker
  1. Verify that your user is now part of the docker group:
groups

You should see docker listed in the output.

  1. Try running the Docker Compose command again:
docker compose up traefik

If you still encounter issues, ensure that the Docker daemon is running and accessible:

sudo systemctl status docker

Create docker networks

To create the external networks web and internal, you need to manually create them using the Docker CLI before running your docker-compose command. Here are the steps:

  1. Create the web network:
docker network create web
  1. Create the internal network:
docker network create internal

After creating these networks, you can run your docker-compose command without encountering errors related to missing networks.

docker compose up traefik

Mount remote directories

SSHFS :

sudo sshfs -o IdentityFile=~/.ssh/id_rsa -o allow_other -o reconnect gribse@217.128.128.22:/media/md0 /mnt/nestor-v3

NFS / CIFS :

sudo mount -t cifs //192.168.1.68/gribse -w -o username=gribse,password="a8t*wN3gx&akd0%tNjrdGtL4c0jy75kL",uid=gribse /mnt/TNAS

To ensure that these directories are mounted at startup, you can add entries to the fstab file. Here are the steps:

sudo nano /etc/fstab
  1. Add the SSHFS entry: Add the following line to mount the SSHFS directory at startup:

    gribse@217.128.128.22:/media/md0 /mnt/nestor-v3 fuse.sshfs IdentityFile=/home/gribse/.ssh/id_rsa,allow_other,reconnect 0 0
    
  2. Add the CIFS entry: Add the following line to mount the CIFS directory at startup:

    //192.168.1.68/gribse /mnt/TNAS cifs username=gribse,password=a8t*wN3gx&akd0%tNjrdGtL4c0jy75kL,uid=gribse 0 0
    
  3. Save and exit: Save the changes and exit the text editor (in nano, press Ctrl+X, then Y, and Enter).

  4. Test the fstab entries: Test the new entries by running:

    sudo mount -a
    

Example

fstab

file:

# <file system> <mount point> <type> <options> <dump> <pass>
gribse@217.128.128.22:/media/md0 /mnt/nestor-v3 fuse.sshfs IdentityFile=/home/gribse/.ssh/id_rsa,allow_other,reconnect 0 0
//192.168.1.68/gribse /mnt/TNAS cifs username=gribse,password=a8t*wN3gx&akd0%tNjrdGtL4c0jy75kL,uid=gribse 0 0

This will ensure that the SSHFS and CIFS directories are mounted automatically at startup.

Installing Immich

Transfer data

  • is tsdata needed ?

  • is pgdata needed ?

  • import library

    • ftp
  • choose storage tempate

  • spécifier uplads/library différent de iploads/thumbs, etc ? pour economiser bande passante et unsiquement stoquer els images sur TNAS

Configure

Deploy

  • stop immich

  • rsync v3 -> v4

  • move env

  • move pgdata

  • move tsdata

  • start local immich

  • stats prometheus ?