How to Backup Ubuntu Files and Folders

Keep your files safe and secure on Ubuntu

The Deja Dup backup-and-restore tool for Ubuntu creates backups of your files on-demand or schedules automatic backups to run regularly on your system. Deja Dup also offers access to cloud backups, to store your files somewhere else securely.

A person backing up Linux on their computer
Lifewire / Derek Abella

How to Set Up Your Ubuntu Backups

Follow this procedure to create new backup rules:

  1. Press the Show Applications icon in the lower-left corner of the Ubuntu desktop.

    Show Applications icon in Ubuntu
  2. When the application browser opens, go to the search box at the top of the screen and enter Backups.

    Search bar in Ubuntu
  3. Deja Dup, the Ubuntu default backup utility, should be the only result unless you installed something else. It's listed as Backups with a safe icon. Press it to launch the backup app.

    Deja Dup in Ubuntu
  4. Deja Dup backup opens to the Overview tab. It provides the key controls to create backups and restore a backup you made. In the left pane, select the Folders to save tab.

    Folders to Save tab in Ubuntu
  5. Choose which folders Ubuntu will automatically back up. By default, the Home folder is added.

    Ubuntu backups select folders
  6. Select the Folders to ignore tab to choose the folders you want the backups to exclude from within the Home and other folders you selected to back up. By default, the Trash and Downloads folders are set up to be ignored.

    Folders to Ignore tab in Ubuntu
  7. To omit a folder, press the plus sign at the bottom of the screen and access the folder you wish to ignore. Repeat this process for every folder that you don't want to back up.

    If a folder is listed as being ignored and you want to include it in the backup, select its name in the box and press the minus sign.

    Add and subtract buttons in Folders to Ignore
  8. Select Storage location.

    Storage Location in Ubuntu
  9. Identify a location to store the backups.

    If you store the backups on the same drive as the files and the hard drive fails, you will lose the backups as well as the original files.

    Ubuntu backup location

    Back up the files to an external device such as an external hard drive or network-attached storage device. The cloud is probably the best option since the backups are stored at a different location. Deja Dup supports both Google Drive and Nextcloud.

    Ubuntu backup networked server

    Whichever option you choose, configure everything the way you need it. The utility won't ask again before making a backup.

  10. Choose Scheduling to set up automatic backups.

    Scheduling tab in Ubuntu
  11. If you do a lot of work on your computer, schedule backups to occur regularly so that you won't lose much data.

There are three options on this page:

  • Automatic backup on or off.
  • How often the backups will occur.
  • How long to keep the backups.

To use scheduled backups, move the toggle switch into the On position.

Backups can be scheduled to take place every day or every week.

You can determine how long to keep the backups. The options are at least 6 months, at least a year, and forever.

Old backups are deleted sooner if the backup location is low on space.

Scheduling backup options in Ubuntu

Make a Backup in Ubuntu

Follow this procedure to create a new backup.

  1. With Deja Dup open, go to the Overview tab.

    Overview tab in Ubuntu
  2. Press Back Up Now to get started.

    Back Up Now button in Ubuntu
  3. Several software packages may require installation. If you receive a message asking you to install these packages, press Install in the upper-right corner. You're asked for a password to complete the process.

    Install button for additional packages in Ubuntu
  4. The Ubuntu backup prepares your files. This cycle may take a few minutes, depending on the system and the number of files.

    Ubuntu backing up files
  5. The utility prompts you to secure the backup with a password. Choose a password or bypass it, then select Forward to finish the backup.

    Forward button in Ubuntu
  6. The backup runs for a few more minutes. When it's done, the backup window closes, and you're returned to the Overview tab.

How to Restore Ubuntu Backups

Follow this procedure to restore a backup file.

  1. To restore a backup, go to the Overview tab and select Restore.

    Restore button in Ubuntu
  2. Choose the backup location. Select Forward to continue.

    Forward button in Ubuntu
  3. Choose the backup file by its date, then select Forward.

    Forward button in Restore window in Ubuntu
  4. Choose a restoration protocol. The options are to restore to the original location or to restore to another folder. Select Forward.

    To restore to a different folder, select the Restore to specific folder option, then choose the location that you wish to restore to. Use this alternative when you need to obtain one or two old versions of critical files without overwriting everything else with the backup dataset.

    Restore options and Forward button in Ubuntu
  5. Verify the summary screen.

    Ubuntu restore backup summary window
  6. If you are happy with the summary, select Restore

    Restore button of backup summary window in Ubuntu