Database Backup using SSH
In this guide, you’ll learn how to backup database using SSH
You can backup single or multiple databases on a server using SSH. If you are familiar with the SSH terminal then the setup process takes less than 5 minutes.
We will use a WordPress server hosted on DigitalOcean in this example. If you use any server management tool to deploy your server, you can still follow this guide.
For the SSH terminal, you can use any tool. We will use DigitalOcean console access. Most hosting providers have web-based SSH terminals available.
Database backups using SSH require a few command-line tools installed on your SSH server. So review the following guide before you proceed further.
1. On the integrations, page go to Databases.
2. Click on Setup Database Integration
3. Click on Setup Database Integration
You can use the Public or Private key to connect to your server. In this example, we will use the public key. Enable Use Public Key? toggle. The following table provides details about each field.
Field | Required | Details |
---|---|---|
Name | Yes | It's just the custom name you want to set for your integration. |
Endpoint | Yes | The endpoint is the server which will actually run your backup and upload data to storage. Choose an endpoint closer to your server location. |
Database Name | Yes (leave it empty if Multi-Database User toggle in ON) | Name of the database you want to backup. |
Database Type | It's the type of database server. The most common is MySQL and MariaDB. | |
Database Version | Yes | Use the best guess. Our system will automatically adjust it. |
Database Port | Yes | Port of your database. By default MariaDB and MySQL it's 3306 and for PostgreSQL, it's 5432 |
Database Host Name or IPv4 or IPv6 | Yes | Hostname or IP address of your database. When connecting using SSH set this to localhost or IP of your database if it's on another server. |
Database User | Yes | The user of database login. This user will be used for backup using mysqldump pr pg_dump |
Database Password | Optional | The password of the database user. Leave empty if your user doesn't require a password. |
Use Our Public Key? | Optional | Use a public key to connect to your database server. |
Use Your Private Key? | Optional | Use a private key to connect to your database server. |
SSH Server Hostname or IPv4 or IPv6 | Yes | This is the public hostname or IP address of your server. |
SSH Server Port | Yes | Your server SSH port. By default, it's mostly 22 |
SSH User | Yes | SSH user to login into SSH terminal. A public/private key will be added for this user. |
Multi-Database User? | Optional | If the database user can access multiple databases then you can use this option to use one integration to create multiple integrations. When you enable this then make the Database Name field empty. |
You can find most of the details in your wp-config.php file if you are using WordPress.

4. Copy the public key shown in the first purple box.

Updated 5 months ago