Locked out of your Odoo admin account? It happens — forgotten passwords, employee departures, or inherited systems with unknown credentials. The good news: resetting an Odoo admin password requires only database access, not knowledge of the current password.
Quick Answer
Run this SQL command against your Odoo PostgreSQL database to reset the admin password to newpassword:
UPDATE res_users
SET password = '$pbkdf2-sha512$600000$...'
WHERE login = 'admin';
But generating the correct hashed password is the tricky part. Read on for three complete methods.
Understanding Odoo Password Storage
Odoo stores passwords hashed using PBKDF2-SHA512 with 600,000 iterations (as of Odoo 16+). You cannot set a plaintext password directly in the database — it must be hashed first. That is why you can't just write SET password = 'mynewpassword'.
Method 1: Odoo Shell (Recommended)
The cleanest method. Uses Odoo's own password hashing without touching SQL directly.
Native Install
# Open the Odoo shell
sudo -u odoo odoo shell -d your_database_name
# In the Python shell that opens:
user = env['res.users'].search([('login', '=', 'admin')])
user.password = 'your_new_password'
env.cr.commit()
exit()
Docker
# Open the shell inside the container
docker compose exec odoo odoo shell -d your_database_name
# Same Python commands:
user = env['res.users'].search([('login', '=', 'admin')])
user.password = 'your_new_password'
env.cr.commit()
exit()
Odoo handles the hashing automatically when you set user.password. The env.cr.commit() saves the change to the database.
Method 2: Direct SQL via psql
Use this when you cannot run the Odoo shell (e.g., Odoo is completely broken but PostgreSQL is running).
Step 1: Generate a Password Hash
You need Python with the passlib library (which Odoo installs as a dependency):
# On the server or anywhere with Python + passlib
python3 -c "
from passlib.context import CryptContext
ctx = CryptContext(schemes=['pbkdf2_sha512'])
print(ctx.hash('your_new_password'))
"
This outputs something like:
$pbkdf2-sha512$25000$xyz...longstring...
Step 2: Update the Database
# Native install
sudo -u postgres psql odoo
# Docker
docker compose exec db psql -U odoo odoo
-- In the psql prompt:
UPDATE res_users
SET password = '$pbkdf2-sha512$25000$...'
WHERE login = 'admin'
RETURNING id, login, active;
The RETURNING clause confirms which row was updated. If it returns nothing, the admin user login may be different (check with SELECT login FROM res_users WHERE id = 1;).
Finding the Admin User ID
In Odoo, the superuser/admin is always user ID 1 in a standard installation. But the login name may vary:
-- Find admin users
SELECT id, login, name, active
FROM res_users
WHERE id = 1 OR login = 'admin';
Reset by ID if you're unsure of the login:
UPDATE res_users
SET password = '$pbkdf2-sha512$...'
WHERE id = 1;
Method 3: Reset via the Database Manager
If the Odoo database manager is accessible at /web/database/manager, and you know the master password (different from the admin user password), you can restore the database from a backup — but this is destructive and loses all data since the last backup.
For password reset, this method is not recommended. Use the Odoo shell or SQL method instead.
Resetting Other Users' Passwords
To reset any user's password (not just admin), use the same shell method with a different search:
# Reset by email/login
user = env['res.users'].search([('login', '=', '[email protected]')])
user.password = 'temporary_password_123'
env.cr.commit()
# Or by user ID
user = env['res.users'].browse(42)
user.password = 'temporary_password_123'
env.cr.commit()
Resetting via the Odoo UI (If You Can Log In)
If you have any other admin-level account, reset passwords from the UI:
- Go to Settings → Users & Companies → Users
- Open the user whose password you want to reset
- Click Action → Change Password
- Enter the new password and confirm
After Resetting: Security Steps
- Log in immediately and verify the reset worked
- Change the password again to a strong, unique value
- Enable two-factor authentication if your Odoo version supports it
- Check the audit log for any suspicious activity during the lockout period
- Review whether the original password should be rotated across other systems if it was shared
The admin_passwd in odoo.conf
This is frequently confused with the admin user password. admin_passwd in odoo.conf is the database manager master password — it controls access to the /web/database/manager interface and is completely separate from any Odoo user's login password.
See our guide on changing the Odoo master password for details on that setting.
How DeployMonkey Handles Admin Passwords
On DeployMonkey instances, admin password resets are available directly from the control panel — no SSH access or database commands required. Click "Reset Admin Password," enter a new password, and we apply it securely using the Odoo shell method.
We also enforce minimum password complexity for admin accounts and offer optional two-factor authentication for the DeployMonkey control panel itself.
Start a free instance with built-in admin password management.
Frequently Asked Questions
Can I reset the admin password if I don't have server access?
If you have neither Odoo UI access nor server/database access, your options are limited. Contact your hosting provider — on DeployMonkey, our team can reset admin passwords for verified instance owners. On a self-managed server, you need someone with SSH access to run the database commands.
Will resetting the admin password log out active sessions?
Yes. Changing a password in Odoo invalidates all existing sessions for that user. Anyone currently logged in with the admin account will be redirected to the login screen.
What if the admin user is archived/inactive?
If the admin user is inactive, you cannot log in even with the correct password. Reactivate it via SQL:
UPDATE res_users SET active = true WHERE id = 1;
Then reset the password using one of the methods above.
Is it safe to run the Odoo shell as root?
No. Always run the Odoo shell as the Odoo service user (typically odoo on native installs). Running as root can change file ownership in the data directory and cause permission errors. In Docker, the container's default user is already odoo.