Skip to content

Preparing new vps from scratch

clean up

remove snap

sudo apt autoremove --purge snapd gnome-software-plugin-snap && sudo apt-mark hold snapd

update

update the thing to current

apt update && apt upgrade && apt upgrade 

add swap

fallocate -l 2G /swapfile && chmod 600 /swapfile
mkswap /swapfile && swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
sysctl vm.swappiness=10
sysctl vm.vfs_cache_pressure=50

nano /etc/sysctl.conf

vm.swappiness=10
vm.vfs_cache_pressure=50

install basics

install the most basic of basics

apt install -y curl htop fail2ban docker.io net-tools make docker-compose

install portainer

cheatsheets/portainer-standalone/

add overlay

install zerotier

curl -s https://install.zerotier.com | sudo bash

add machine to overlay network

export INTERFACE=YOUR_ZEROTIER_NETWORK_ID
zerotier join $INTERFACE

allow traffic from all zerotier network devices

export INTERFACE=YOUR_ZEROTIER_NETWORK_ID
ufw allow in on $INTERFACE

add user

create mr user

adduser koad

make new user sudo

usermod -aG sudo koad

add user to docker group

sudo groupadd docker
sudo usermod -aG docker koad

lock down

cheatsheets/uncomplicated-firewall/

remove regular internet firewall rules, deny all

ufw status numbered
ufw delete [NUMBER]

Back to top