Back up and restore Docker workflows and credentials with Google Drive and SSH
Quick overview This workflow backs up n8n workflows and encrypted credentials from a self-hosted Docker instance via SSH, stores the exports as JSON files in structured Google Drive folders, and provides a Basic Auth–protected form to restore uploaded backups back into an n8n Docker container.
How it works Runs on a cron schedule to start a backup and set the target n8n Docker container name and timestamp. Creates a timestamped backup folder in Google Drive with subfolders for workflows and credentials. Connects over SSH and runs the n8n CLI inside the Docker container to export all workflows and all credentials as JSON. Uploads a full workflows-all.json export and also uploads each workflow as its own JSON file into the Google Drive workflows folder. Uploads a full credentials-all.json export and also uploads each credential as its own JSON file into the Google Drive credentials folder. Builds a combined workflows-credentials.json package from both exports and uploads it to the root of the Google Drive backup folder. Accepts one or more uploaded .json files through a Basic Auth–protected n8n form, detects whether they contain workflows or credentials, then copies a generated import file to the target container over SSH and runs n8n import:workflow and/or n8n import:credentials.
Setup Add a Google Drive OAuth2 credential and set the parent Google Drive folder ID where backup folders should be created. Add an SSH credential with access to the Docker host and ensure the SSH user can run docker exec and docker cp against the n8n container. Replace the Docker container name for both backup and restore configuration so the SSH commands target the correct n8n instance. Configure Basic Auth for the restore form and copy the form URL for the admins who will upload backup files. Ensure the destination n8n instance uses the same N8N_ENCRYPTION_KEY as the source if you plan to restore credentials.
Related Templates
Restore your workflows from GitHub
This workflow restores all n8n instance workflows from GitHub backups using the n8n API node. It complements the Backup ...
Build a Restaurant Voice Assistant with VAPI and PostgreSQL for Bookings & Orders
This n8n template demonstrates how to create a comprehensive voice-powered restaurant assistant that handles table reser...
Extract Named Entities from Web Pages with Google Natural Language API
Who is this for? Content strategists analyzing web page semantic content SEO professionals conducting entity-based anal...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments