UFW stands for Uncomplicated FireWall. It is a program in charge of the fate of the internet packets coming to the server and what do to with them.
📖 Resources
One famous thing for servers (and for a lot of things IT-related) is:
Never trust what you don't control
So the philosophy to adapt when dealing with networks, could be summarized as:
- block everything by default
- allow specific traffic
UFW is installed by default on Ubuntu, but may not be enabled. The first step is to enable UFW:
ufw enable
You can check the current configuration with:
ufw status verbose
ufw default deny incoming
ufw allow 22
ufw allow 80
ufw allow 443
ℹ️ information
- port 22 is the default port for SSH, not enabling it and disallowing all the other ports could lock you out of your own server (
⚠️ )- port 80 is the default port for the Web (HTTP), when your browser access a URL with no specified port, it will default to 80
- port 443 is the default port for HTTPS
We have a more or less secure server, let's try to do something with it now, by installing a web server.