Files and directories to backup in Ubuntu 18.04

Posted May 31, 2020 1.9k views
UbuntuMySQLServer OptimizationLAMP StackBackupsInitial Server SetupUbuntu 18.04

I am running a LAMP Ubuntu 18.04.
Recently I installed rclone to backup my files to google drive.

Currently what I do is, backup all databases using automysqlbackup and sync to google drive including /var/www directory.

What are the other files and directories to backup which I can restore easily without starting from the scratch?

Note: I use vertualhost also.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
4 answers

/etc/apache2/ ?
What else have you configured as part of your server setup

Okay. found another directory to backup if you use letsencrypt, making regular backups of /etc/letsencryptfolder is ideal. says in this page

So now backup

  • /var/www/
  • /etc/apache2/
  • /etc/letsencrypt/ (if use letsencrypt for ssl)
  • /var/lib/automysqlbackup/ (if use automysqlbackup mysql backup)

Anything else?

by Kathleen Juell
by Erika Heidi
Let's Encrypt is a Certificate Authority (CA) that provides an easy way to obtain and install free TLS/SSL certificates, thereby enabling encrypted HTTPS on web servers. In this tutorial, you will use Certbot to obtain a free SSL certificate for Apache on Ubuntu 18.04 and set up your certificate to renew automatically.


You can make sure that you backup the site/app database and the files/data as well. If you’re not making any changes to the virtual host and the Apache configuration this can be skipped as regular backup and only create a copy to save elsewhere if you make any changes to the setup itself.

Hope that this helps!