When you first create a new Ubuntu server, there are a few configuration steps that you should take early on as part of the basic setup.

Update

  • Update packages
$ apt-get update
$ apt-get upgrade

Setup a Basic Firewall

  • Check available UFW applications:
    $ ufw app list
    
Output
Available applications:
	OpenSSH
  • Allow SSH connections:
    $ ufw allow OpenSSH
    
  • Enable UFW:
    $ ufw enable
    

Reference