How to sync KeePassium with Google Drive

KeePassium supports two synchronization methods for Google Drive:

Method 1: Direct in-app Google Drive connection

2024-07-01: Temporarily unavailable

This is a new feature and we are still waiting for Google’s approval to enable it. During the process, you may see a “This app is blocked” message in the login screen. As a workaround, please use the Files app integration method instead.

With this method, KeePassium communicates directly with Google’s servers. This way, the app has full control over data transfer and does not depend on other apps. As a result, the direct connection is more reliable than via the Files app.

To sync your database from Google Drive, follow these steps:

  • Go to the list of databases, tap +Connect to Server
    • If asked, allow network access.
  • Select your storage type (personal or business)
  • The app will ask you to log into your Google account.
    • As a result, KeePassium would receive and store an access token that authorizes the app for future connections. The app will not see nor store your Google account password.
  • When asked, allow the app to access your Google Drive files.
    • Without permission, KeePassium will not be able to access your database.
  • Once you see your Google Drive contents, navigate to database file and select it.

Method 2: Google Drive/Files app integration

  1. Install Google Drive app and login into your account
  2. Open KeePassium
    • If the app was just installed, tap Add Existing Database
    • If you already have other databases, tap + and choose Open Database
  3. If Google Drive is not visible in the list, make it visible
  4. Select your database file
  5. That’s it!

Troubleshooting

Does not work offline

Google Drive does not work offline, even if the database file was “Made available offline”.

As a workaround, you can open Google Drive app, select your database, press Open In and then Copy to KeePassium. This will create a local in-app copy of the database, that will not be synchronized with Google Drive. To share any offline changes, you will need to export the database back to Google Drive.

“Unsupported file type” when selecting a database

This is caused by the Privacy Screen in Google Drive. This feature blocks access to files from other apps, such as KeePassium. When you open a file selection dialog in KeePassium, the system shows “Authentication required”. When you tap “Open Google Drive” in that dialog — you switch from KeePassium to Google Drive app. When you select a database, Google Drive complains it does not know anything about .kdbx files.

The solution is to turn off the Privacy Screen in Google Drive settings.

Google Drive does not respond

This often happens after you add your database to KeePassium and then enable the Privacy Screen in Google Drive. The Privacy Screen blocks access to Google Drive files from other apps. As a result, Google Drive does not respond to KeePassium’s attempts to read the database.

The solution is to turn off the Privacy Screen in Google Drive settings.

Limitations for shared files

Google Drive does not expose shared files to the Files app, so they cannot be added to KeePassium directly.

Partial workaround: Google Drive app → Shared button for the shared file → Add shortcut to Drive. This will make the database accessible to the file system, Files, and KeePassium. Unfortunately, shortcuts seem to be read-only, so KeePassium will not be able to save the database.

FUSE filesystem over Google Drive (google-drive-ocamlfuse)

If you use google-drive-ocamlfuse with KeePassXC, KeePassium might often complain that Google Drive does not respond. The detailed diagnostic info shows that the database file has been deleted:

Failed to access the file [
	fileProvider: com.google.Drive.FileProviderExtension, 
	systemError: 
		Error Domain=NSCocoaErrorDomain 
		Code=4101 "Geen communicatie mogelijk met een helperapp." 
		UserInfo={
			NSUnderlyingError=0x1234ABCD {
				Error Domain=trash 
				Code=0 "(null)"
			}
		}
]
The reason is that google-drive-ocamlfuse creates a new file ID when KeePassXC saves the database. Since KeePassium tries to access the database using an old reference, Google Drive repots that the old file has been deleted.

The solution is to open ~/.gdfuse/default/config and set mv_keep_target=true.


See also

Last Updated: 2024-07-01