Follow the steps in the article below to setup automatic (unattended) upgrades for your server:

How To Set Up Multi-Factor Authentication for SSH on Ubuntu 16.04 | DigitalOcean