In this tutorial, I’ll share a few tips on how I keep my servers up to date.
Even though servers can work for ages without any updates, it is important to perform some maintenance occasionally
1. Check your backups
Make sure you back up your server at least once a week and store your backup on an external drive.
If you store your backups on the same machine and your system crashes or you get hacked – you won’t be able to restore your server.
You can set up automatic backups that will back up your config files, sites and databases and upload them to the external drive.
2. Upgrade packages
First of all, download the packages lists from the repositories to get information about the newest versions of packages by running the following command
➜ ~ apt-get update # Hit:1 http://nginx.org/packages/mainline/ubuntu xenial InRelease # Hit:2 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease # Ign:3 http://apt.newrelic.com/debian newrelic InRelease # Hit:4 http://apt.newrelic.com/debian newrelic Release # Hit:5 http://ppa.launchpad.net/webupd8team/unstable/ubuntu xenial InRelease # Hit:6 http://mirrors.digitalocean.com/ubuntu xenial InRelease # Hit:7 http://mirrors.digitalocean.com/ubuntu xenial-updates InRelease # Hit:8 http://mirrors.digitalocean.com/ubuntu xenial-backports InRelease # Get:9 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB] # Hit:10 https://repos.sonar.digitalocean.com/apt main InRelease # Fetched 109 kB in 0s (113 kB/s) # Reading package lists... Done
Now, install the latest versions of the packages
➜ ~ apt-get upgrade # Reading package lists... Done # Building dependency tree # Reading state information... Done # Calculating upgrade... Done # The following packages were automatically installed and are no longer required: # ... # Do you want to continue? [Y/n]
Hit “Y” and follow the instructions if necessary.
3. Check your OS version and monitor for security patches
Make sure you install security patches by installing the latest OS updates as vulnerabilities are discovered very often.
Want to share this with your friends?