Skip to content
Back to blog

Magichosting

Using UFW without locking yourself out

E
Elias Bieber
Estimated reading time: 1 min

Protect SSH first, scope rules by source and protocol, then test externally: a careful UFW workflow for Debian and Ubuntu.

LinuxUFWFirewallPortsDebian

Install UFW

With UFW (Uncomplicated Firewall) you can manage ports on Linux easily.

sudo apt install ufw

Open and close ports

Open port (example 8080):

ufw allow 8080

Close port:

ufw deny 8080
  • ufw status: Shows firewall status
  • ufw enable: Enables the firewall
  • ufw disable: Disables the firewall
  • Important: Do not block port 22 (SSH) or you will lose access!

Was this post helpful?

MagicHosting – Hosting with real value

Hosting pays off with MagicHosting: fair pricing, current deals and operation in SkyLink RZ. Servers, domains and personal support – no hidden costs.

  • Current limited offers from our server exchange
  • Affordable domains with transparent pricing and great offers
  • Powerful DDoS protection for maximum availability
  • Personal support when you have questions or issues