Duplicator Documentation

Documentation, Reference Materials, and Tutorials for Duplicator

Want it done for you?

Let the Duplicator experts migrate your WordPress site for you — quick, safe, and hassle-free.

Get Migration Help

Installing a Backup From the Command Line


Do you have SSH access to your server and want to install a backup without opening the installer in a browser? Duplicator, our backup and migration plugin, lets you run installer.php from the command line, either with prompts or with every value set in advance.

In this guide, we’ll show you how to install a backup from the command line.

Requirements: To install a backup from the command line, you’ll need SSH (Secure Shell) or terminal access to the destination server, PHP CLI (the command-line version of PHP), and the archive file and installer.php of a backup created with Duplicator 5.2.0 or later. It works with Duplicator Lite and Duplicator Pro.

Before You Get Started

To begin, download the archive file and the installer of your backup. You’ll find both on the Backups page of the source site, or in the storage where you keep the backup.

Next, upload both files to the folder of the destination site, such as public_html. The installer file name must end in .php, so rename it to installer.php if it has another name.

Then, connect to the server with SSH and go to that folder:

cd /home/example/public_html

Note: The installer can’t run from inside a Backups folder, such as wp-content/duplicator-backups. The command stops there, because the installation lands in the folder of the installer.

Checking the Backup Before You Install

Before you install, it’s a good idea to check the backup. The --info option describes the backup and lists the installer parameters you can set from the command line, with their current values. It doesn’t install anything.

php installer.php --info

The first part of the output shows details about the backup:

Backup
  name:               20261110_examplecom_[hash]_20261110140132_archive.daf
  created:            2026-11-10 14:01:32
  site:               single site
  url:                https://old.example.com
  path:               /var/www/html
  table prefix:       wp_
  database only:      false
  no database:        false
  duplicator:         5.2.0
  wordpress:          7.1.3
  php:                8.2.35
  database:           12.3.3

Below that, you’ll see each parameter you can set in a --params file, with its type, a short description, its current value, and the accepted values. For example, dbaction lists what the installer can do with the database:

  dbaction (string): What to do with the database
    value: empty
    - create: Create New Database
    - empty: Empty Database
    - removetables: Overwrite Existing Tables
    - manual: Skip Database Extraction
    - rename: Backup and Rename Existing Tables
    - dbdonothing: Only Extract Files

Tip: You can add --format=json to get the same details as JSON (JavaScript Object Notation). With --params=install-params.json, it also checks your parameters file before the install. Passwords are always shown as (hidden).

Running the Install

To install the backup with prompts, run the installer with the URL of the new site:

php installer.php --url=https://example.com

The installer asks for each database value you didn’t pass. A value in brackets is the default, and pressing Enter keeps it. The password isn’t shown while you type.

Extracting the installer...
Database host [localhost]: localhost
Database name: example_db
Database user: example_user
Database password:
Validating...

After the validation, the installer shows a summary of the install and asks you to confirm:

  Run installer with these settings?
  Site Settings
  Install Type: single site
  New URL: https://example.com
  New Path: /home/example/public_html
  Database Settings
  Server: localhost
  Name: example_db
  User: example_user
  Data: No existing tables will be overwritten in the database
This process cannot be undone. Proceed? [y/N]:

To start the install, type y or yes and press Enter. Any other answer cancels the install.

If the validation finds warnings you need to accept, the installer stops, even on a terminal. After you check the warnings, run the command again with --accept-warnings.

Note: Running php installer.php with no options only shows the help. To start an install, pass at least 1 option, such as --url.

Installing Without Prompts

Do you want to run the install from a script, without any questions? You can pass every value as an option, or put the values in a --params file.

A --params file is a JSON file. Each key is an installer parameter, and each value goes inside "value". For example, create a file named install-params.json outside the site folder:

{
  "dbhost": {"value": "localhost"},
  "dbname": {"value": "example_db"},
  "dbuser": {"value": "example_user"},
  "dbpass": {"value": "your-database-password"},
  "dbaction": {"value": "empty"},
  "blogname": {"value": "Example Site"}
}

Then, run the installer with the file, the site URL, and --yes:

php installer.php --url=https://example.com --params=/home/example/install-params.json --yes

The installer shows each step as it runs. When it’s done, it prints the site URL and the path of the installer log:

Extracting the installer...
Validating...
  Run installer with these settings?
  Site Settings
  Install Type: single site
  New URL: https://example.com
  New Path: /home/example/public_html
  Database Settings
  Server: localhost
  Name: example_db
  User: example_user
  Data: No existing tables will be overwritten in the database
Setting the parameters...
Decompressing the database...
  100%
Extracting the files...
  100%
Installing the database...
  100%
Updating the site...
Running the final tests...
Finalizing...
Installation completed: https://example.com
Log: /home/example/public_html/wp-content/duplicator-backups/installer/dup-installer-log__[hash].txt

Note: Other users of the server can see command-line arguments. For this reason, put passwords in the --params file instead of using --dbpass. Options you pass on the command line take priority over the file.

Without a terminal, such as in a script or a cron job, the installer never asks anything. If a required value is missing, it stops with an error, such as Error: --dbname is required.

Note: Installing over an existing site or database replaces its files and tables, and this can’t be undone. The default database action is empty, which removes every table in the database. On a terminal, the installer asks you to confirm. Without a terminal, it stops with Error: the installation overwrites an existing site or database, pass --yes. Before you add --yes, make sure you have a backup of the existing site.

Command Options

The table below shows every option of installer.php and what it does:

OptionWhat it does
--url=<url>Sets the URL of the new site.
--dbaction=<action>Sets what to do with the existing database, such as empty or rename.
--dbhost=<host>Sets the database host, with :port when needed.
--dbname=<name>Sets the database name.
--dbuser=<user>Sets the database user.
--dbpass=<password>Sets the database password. For security, the --params file is a better place for it.
--params=<file>Reads installer parameters from a JSON file.
--archive-path=<path>Sets the folder of the archive, or the archive file itself. By default, it’s the installer folder.
--archive-password=<pwd>Sets the password of an encrypted archive.
--accept-warningsInstalls even when the validation shows warnings that need to be accepted.
--yesInstalls without asking for confirmation. It’s required without a terminal when the install overwrites an existing site or database.
--ignore-ownerRuns even when your user isn’t the owner of the installer folder.
--infoDescribes the backup and its parameters, then exits without installing.
--format=<format>Sets the output of --info: text (default) or json.
--helpShows the help.

Exit Status Codes

When the command ends, it returns an exit status. Scripts can use it to check the result:

  • 0: the backup was installed, or --info or --help ran.
  • 1: the install failed or was cancelled. The command shows the error and, when a log exists, the line Details are in with its path.
  • 2: the command was used the wrong way, such as an unknown option.

After the Install

Once the install completes, open the new site in your browser and log in to check it.

By default, the installer removes the installer files when it finalizes the install. It keeps its log in wp-content/duplicator-backups/installer/, and the Log: line shows the exact path.

If the output shows installer files kept or a can’t remove warning, remove the leftover files yourself. To learn which ones to delete, check out our guide on removing the installer files after an install.

Note: At the end, the installer loads the front end and the login page of the new site. If the server can’t reach the new URL yet, such as before a DNS (Domain Name System) change, it shows a test failed warning, but the install still completes.

FAQs

Below, we’ve addressed some of the most common questions regarding this feature.

Do I need to open the installer pages in a browser?
No. The command runs the same steps as the installer pages in a single run, so you don’t need a browser at any point.
Can I use it with Duplicator Lite?
Yes. The command works the same way in both Duplicator Lite and Duplicator Pro, for backups created with version 5.2.0 or later.
What if the archive is encrypted?
On a terminal, the installer asks for the Archive password, up to 3 times. Without a terminal, pass it with --archive-password, or the command stops with an error.
Why does it stop and ask me to pass --ignore-owner?
The command checks that your user owns the installer folder. Otherwise, the site might not be able to write the files it installs, so you’ll see an error such as Error: run as www-data, the owner of /home/example/public_html (now root), or pass --ignore-owner. The best fix is to run the command as the user it names. If you’re sure about the permissions, add --ignore-owner.

That’s it! You now know how to install a backup from the command line, with prompts or with a parameters file.

As a next step, check out our complete guide to the installer to learn what each installer setting does.


Was this article helpful?


Don't Let Another Day Pass Unprotected

Every hour without proper WordPress backups puts your site at risk • Every delayed WordPress migration costs you performance and growth

Get Duplicator Now
Duplicator Plugin

Wait! Don't miss your
exclusive deal!

As a customer, you get 60% OFF

Try Duplicator free on your site — see why 1.5M+ WordPress pros trust us. But don't wait — this exclusive 60% discount is only available for a limited time.

or
Get 60% Off Duplicator Pro Now →