Hello everyone, so in this tutorial we
are going to check how to configure Ubuntu firewall in DigitalOcean droplet.
Alright so in order to do this we need to run some commands so that we can
configure it. The first command that we need to run is sudo ubuntu firewall
status, so it will basically check what is the status of ubuntu firewall right
now. So by default it is inactive. Alright. So the next command is ufw
disable. Now why are you disabling is that because we need to configure it in
such a way so that it can work for us as per our requirement. So is pretty much
required to disable it first and after the configuration is done we will enable
it again. So this press Enter, it has stopped it.
Now the next command is this which is saying as a ubuntu firewall default allow
outgoing. So what we are doing here is that we are allowing all the outgoing
connections from this server to the outside world so that is okay. The only
issue is the when it comes in the incoming where we will apply some rules.
Right so just press Enter so it has applied the policy. Now next is Ubuntu
default deny incoming. So what we are doing is we are denying all the incoming
connections to this server at this point. Now why we are doing it we will get to
know soon, just press enter, so it has done that. Now what we are going to do is
we are only going to allow SSH connection in the incoming, so that we
are able to connect to the server. Alright so just press it and it has
applied the rules. Now the next thing is that we need to allow in the incoming
would be is Ubuntu allow “Nginx Full” because obviously we are installing
Nginx in our cloud servers, so we need to allow
the connections to it so just press Enter. So it has applied that as well. Now once all the configuration is done we can
safely enable the Ubuntu firewall as well. So this copy this command and paste it, so it is also mean to type yes and it is active. Now in order to see the status
now we can simply run this command again that we run previously and it shows that
it is like only allowing TCP and Nginx for the ipv4 and ipv6 addresses and there
one more command which also gives the list of the apps which are actually
allowed in the Ubuntu firewall is this which is Ubuntu firewall app list. So
it basically gives the list of applications which are allowed. So this
is how we basically configure the Ubuntu firewall for our cloud server. In the
next tutorial, we are going to check how to install let’s encrypt SSL for your
domain in DigitalOcean droplet.