How to Store Backup on Dropbox in Laravel 8 with Spatie

In this tutorial you will learn about the How to Store Backup on Dropbox in Laravel 8 with Spatie and its application with practical example.

In this How to Store Backup on Dropbox in Laravel 8 with Spatie Tutorial, I’ll show you how to take complete laravel application backup on DropBox using spatie laravel backup package. In this tutorial you will learn to store laravel site backup on dropbox using spatie in laravel. In this article I will guide you through process how to take daily automatic backup of your laravel application and store on dropbox using spatie laravel backup package. In this example we will be using spatie/laravel-backup package to take backup of complete laravel application. In this example I will also show you how to integrate DropBox in laravel 8 to store backup on DropBox.

How to Store Backup on Dropbox in Laravel 8 with Spatie

In this step by step tutorial I will demonstrate you how to integrate DropBox in laravel 8 to store backup using spatie. Please follow the instruction given below:

  • Step 1: Download Laravel Project
  • Step 2: Update Database Credentials
  • Step 3: Add Spatie Package in Laravel
  • Step 4: Configure Spatie Package
  • Step 5: Create Dropbox Token
  • Step 6: Set Up Dropbox File System
  • Step 7: Insert Dropbox Keys
  • Step 8: Store Backup on Dropbox

Install Laravel 8

First of all we need to create a fresh laravel project, download and install Laravel 8 using the below command

Setup Database Credentials

Now, lets create a MySQL database and connect it with laravel application. After creating database we need to set database credential in application’s .env file.

Install spatie/laravel-backup

In this step run the following command to install spatie/laravel-backup package in laravel 8:

Configure Spatie Package

Now configure your email id for backup:

Now we have to publish the backup.php file using the php artisan vendor command.


After executing the command, goto the newly generated config/backup.php and look for the destination array; and change the disks property to dropbox.

Create Dropbox Token

Create a dropbox project and get the access token.

Set Up Dropbox File System

Now, you need to run the following command to install a Filesystem adapter for DropBox:

Create a separate DropboxServiceProvider provider using following artisan command:


Now, go to config/app.php, and define the DropboxDriveServiceProvider class as following:


Now go to app/Providers/DropboxServiceProvider.php and update the following code into the file below.

Insert Dropbox Keys in Laravel

Go to config/filesystem.php file, define dropbox key, secret and authorization token within the disks and dropbox props.

Open .env file and define the dropbox auth token to make the laravel dropbox backup module work.

Clear Config Cache

Run Backup Command

In this step we are ready to take backup run the following command to check the backup file is created or not:

In this tutorial we have learn about the How to Store Backup on Dropbox in Laravel 8 with Spatie and its application with practical example. I hope you will like this tutorial.