Files
omarchy/install/firewall.sh
David Heinemeier Hansson 5c42f35839 Install and enable ufw firewall by default
Gotta be safe out there!
2025-07-16 16:46:35 -07:00

24 lines
488 B
Bash

#!/bin/bash
if ! command -v ufw &>/dev/null; then
yay -Sy --noconfirm --needed ufw ufw-docker
# Allow nothing in, everything out
sudo ufw default deny incoming
sudo ufw default allow outgoing
# Allow ports for LocalSend
sudo ufw allow 53317/udp
sudo ufw allow 53317/tcp
# Allow SSH in
sudo ufw allow 22/tcp
# Allow Docker containers to use DNS on host
sudo ufw allow in on docker0 to any port 53
# Turn on the firewall
sudo ufw enable
sudo ufw reload
fi