Linux Server Initial Setup

Revision as of 05:34, 7 September 2024 by Maintenance script (talk | contribs) (Initial)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

With Docker

source: https://docs.docker.com/engine/install/debian/#install-using-the-repository

<syntaxhighlight lang="shell">apt install -y sudo sudo apt update sudo apt upgrade -y

unattended upgrades

sudo apt install -y unattended-upgrades sudo sh -c 'echo "APT::Periodic::Update-Package-Lists \"1\"; APT::Periodic::Unattended-Upgrade \"1\";" > /etc/apt/apt.conf.d/20auto-upgrades'

install basic tools

sudo apt install -y git ca-certificates curl rsync pass p7zip-full unzip fail2ban ufw sudo install -m 0755 -d /etc/apt/keyrings

set up docker

sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc

Add the repository to Apt sources:

echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt update sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin sudo usermod -aG docker $USER </syntaxhighlight>

Without Docker

<syntaxhighlight lang="shell">apt install -y sudo sudo apt update sudo apt upgrade -y sudo apt install -y git ca-certificates curl rsync pass p7zip-full unzip fail2ban ufw

unattended upgrades

sudo apt install -y unattended-upgrades sudo sh -c 'echo "APT::Periodic::Update-Package-Lists \"1\"; APT::Periodic::Unattended-Upgrade \"1\";" > /etc/apt/apt.conf.d/20auto-upgrades' systemctl reload postfix</syntaxhighlight>