Ubuntu VPS on PVE

Memory

  • 1024
  • 2048
  • 4096
  • 8192
  • 16384

LVM Space

lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

Quest agent

apt install qemu-guest-agent -y

Disable resolver

systemctl disable systemd-resolved.service

systemctl stop systemd-resolved

Sudoers

user   ALL=(ALL) NOPASSWD:ALL

Update and upgrade packages

apt-get update
apt-get upgrade -y
apt-get dist-upgrade -y
apt-get autoremove -y

Install some packages

apt-get install curl htop mc screen mtr tmux git vim build-essential zsh net-tools fail2ban mlocate -y

fzf

git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf

~/.fzf/install

Samba, NFS

apt install cifs-utils -y
apt install nfs-common -y

Firewall

ufw allow http
ufw allow https
ufw allow ssh
ufw enable
ufw status

Docker

apt-get install apt-transport-https ca-certificates software-properties-common -y
curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
usermod -aG docker dock

Docker Compose


curl -L "https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

chmod +x /usr/local/bin/docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

Purge all uninstalled

apt-get purge $(dpkg -l | grep '^rc' | awk '{print $2}')

ZSH Prompt

PROMPT='%{$fg[$NCOLOR]%}%B%n%b@%m%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '