Recover Admin Password
Lost access to your Odoo admin account? This guide shows you how to reset the administrator password using OEC.sh.
Method 1: Using OEC.sh Terminal (Recommended)
The easiest way to reset your admin password is through the built-in terminal.
Open Terminal
- Go to Environments in the sidebar
- Click on your environment
- Click the Terminal button in the header
Connect to Odoo Container
The terminal opens directly in your Odoo container.
Reset Password Using Odoo Shell
Run this command to reset the admin password:
odoo shell -d YOUR_DATABASE_NAME << 'EOF'
env['res.users'].browse(2).write({'password': 'NewPassword123!'})
env.cr.commit()
print("Password reset successfully!")
EOFReplace:
YOUR_DATABASE_NAMEwith your actual database nameNewPassword123!with your desired new password
Verify Access
- Go to your Odoo URL
- Log in with username
adminand your new password
Security Note: Choose a strong password with at least 12 characters, including uppercase, lowercase, numbers, and symbols.
Method 2: Using SQL (Direct Database Access)
If the Odoo shell method doesn't work, you can reset the password directly in PostgreSQL.
Open Terminal
Go to Environment → Terminal
Connect to PostgreSQL
psql -U odoo -d YOUR_DATABASE_NAMEUpdate Password
Odoo stores passwords as hashed values. Set a temporary password:
UPDATE res_users
SET password = 'temp_password_123'
WHERE id = 2;Exit and Login
\qChange Password in Odoo
- Log in with the temporary password
- Go to Settings → Users & Companies → Users
- Click on your admin user
- Set a new secure password
User ID 2 is typically the admin user created during database initialization. If you're unsure, query SELECT id, login FROM res_users WHERE login = 'admin';
Method 3: Using Odoo Configuration
For Odoo 12.0 and later, you can set an admin password via configuration.
Edit Odoo Configuration
In the terminal, edit the Odoo config:
nano /etc/odoo/odoo.confAdd Admin Password Line
Add or modify this line:
admin_passwd = your_master_passwordRestart Odoo
supervisorctl restart odooAccess Database Manager
- Go to
https://your-domain.com/web/database/manager - Use the master password to access database management
- From there you can reset user passwords
Finding Your Database Name
If you don't know your database name:
From OEC.sh Dashboard
- Go to Environments
- Click on your environment
- The database name is shown in the Overview tab
From Terminal
psql -U odoo -c "SELECT datname FROM pg_database WHERE datistemplate = false;"Common Issues
"User not found" Error
The admin user ID might not be 2. Find the correct ID:
SELECT id, login, active FROM res_users ORDER BY id;"Permission denied" Error
Ensure you're connected as the correct database user:
psql -U odoo -d YOUR_DATABASE_NAMEPassword Not Working After Reset
- Clear your browser cache and cookies
- Try an incognito/private window
- Check if 2FA is enabled on the account
Prevention: Best Practices
- Use a Password Manager - Store credentials securely
- Set Up Multiple Admins - Create backup admin accounts
- Document Credentials - Keep secure records of admin access
- Enable Password Recovery Email - Configure SMTP so Odoo can send password reset emails
Setting Up Password Recovery Email
To enable the "Forgot Password" feature in Odoo:
- Go to Settings → General Settings
- Configure Outgoing Mail Servers (SMTP)
- Ensure admin user has a valid email address
- Users can now use "Reset Password" on login page
With email configured, users can reset their own passwords without admin intervention.
Need Help?
If you're still unable to access your account:
- Check Logs - Go to Environment → Logs for error details
- Contact Support - Email support@oec.sh with your environment ID