Reset Command
Theuser-management:reset command resets the database to the default user state, making the instance owner the sole user and owner of all workflows and credentials.
Usage
What It Does
The reset command performs the following actions:- Transfers All Ownership: Makes the instance owner the owner of all workflows and credentials
- Deletes Other Users: Removes all users except the instance owner
- Resets Owner Details: Clears the owner’s personal information:
- First name →
null - Last name →
null - Email →
null - Password →
null(requires setup on next login) - Last active timestamp →
null
- First name →
- Handles Orphaned Data: Links any unassociated credentials to the owner’s personal project
Warning: This command is destructive and cannot be undone. All users except the instance owner will be permanently deleted, and the owner’s credentials will be reset.
Use Cases
- Development Reset
- Lost Owner Access
- Instance Handover
- Testing Scenarios
Clean up test users and data during development:Perfect for resetting a development instance to a clean state.
Behavior Details
Owner Identification
The command identifies the instance owner as:- The user with the
global:ownerrole - If no owner exists, creates a new default owner user
Personal Project Handling
The owner’s personal project is used for all ownership transfers:- All workflows are assigned to the owner’s personal project
- All credentials are assigned to the owner’s personal project
- Orphaned credentials (without any owner) are linked to this project
Default Owner State
After reset, the owner user has these properties:Post-Reset Setup
After running the reset command:-
Restart n8n:
-
Access Setup Wizard:
- Navigate to your n8n URL (e.g.,
http://localhost:5678) - You’ll be redirected to the setup wizard
- Create new owner credentials
- Navigate to your n8n URL (e.g.,
-
Configure Instance:
- Set owner email and password
- Configure instance settings
- Add additional users if needed
Safety Considerations
Backup Before Reset
Backup Before Reset
Always create a backup before running the reset command:
Production Warning
Production Warning
Never run this on a production instance unless you fully understand the consequences:
- All user accounts (except owner) will be deleted
- All user sessions will be invalidated
- All users will lose access immediately
- Owner credentials will be reset
- This operation cannot be undone
Data Preservation
Data Preservation
The reset command preserves:
- ✅ All workflows
- ✅ All credentials (data intact)
- ✅ Workflow execution history
- ✅ System settings
- ❌ All users except owner
- ❌ Owner’s personal information
- ❌ User sessions
- ❌ User preferences
Example Workflows
Development Reset Workflow
Emergency Access Recovery
If you’ve lost access to the instance owner account:Run Reset Command
Execute the reset command:This will reset the owner account while preserving all workflows and credentials.
User Management Alternatives
For less destructive user management, use the n8n UI:Via Web Interface
- Settings > Users: Manage user accounts
- Access Control: Configure user permissions
- User Roles: Assign roles to users
- Audit Log: Track user activities
Via API
For programmatic user management, use the n8n REST API:Troubleshooting
Reset command fails
Reset command fails
Problem: The reset command encounters an error.Solutions:
- Ensure n8n is stopped before running reset
- Check database connectivity
- Verify database permissions
- Check logs for specific error messages
Can't access after reset
Can't access after reset
Problem: Cannot access n8n UI after reset.Solutions:
- Ensure n8n was restarted after reset
- Clear browser cache and cookies
- Try accessing in incognito/private mode
- Check n8n logs for startup errors
Workflows still show old owners
Workflows still show old owners
Problem: Workflow metadata shows previous owner.Solution: This is expected. The reset command changes actual ownership (who can access/modify) but historical metadata may remain. The owner can access and modify all workflows.
Environment-Specific Considerations
- Docker
- Kubernetes
- npm Global
When running in Docker:Or if container is not running:
Best Practices
- Always backup first: Export workflows and credentials before reset
- Use in development: Primarily for dev/test environments, not production
- Communicate changes: Inform team members before running reset
- Document recovery: Keep emergency access recovery procedures documented
- Test restore: Verify backup/restore procedures work before emergencies
Related Commands
Other useful CLI commands for user and data management:n8n export:workflow: Export workflows for backupn8n export:credentials: Export credentials for backupn8n import:workflow: Restore workflows from backupn8n import:credentials: Restore credentials from backup
Next Steps
CLI Commands
View all CLI commands
Import & Export
Backup and restore data
User Management UI
Manage users via web interface
API Reference
Use the REST API for user management