Installation & Usage
The CLI is included with Homarr. Run commands using:- Docker
- Docker Compose
- Source
Available Commands
reset-password
Reset a user’s password and invalidate all their sessions. A new secure random password is automatically generated. Usage:--username, -u(required) - Username of the user whose password should be reset
- Credentials authentication provider must be enabled (
AUTH_PROVIDERSincludescredentials) - User must exist in the database with provider set to
credentials
recreate-admin
Create a new admin user when no credentials admin exists. Useful for account recovery or initial setup issues. Usage:--username, -u(required) - Username for the new admin account
- Credentials authentication provider must be enabled
- No existing credentials users with admin permissions
- Username must be valid according to Homarr’s username schema
- Username must not already exist in the database
- Log in with the generated credentials
- Navigate to Settings → Groups
- Rename the temporary group (shows as random ID) to something meaningful like “Administrators”
- Consider creating additional admin users
- Change the admin password from the UI
fix-usernames
Convert all credentials usernames to lowercase for consistency. This is useful after migrating from an older version or if username case issues exist. Usage:- Credentials authentication provider must be enabled
- After upgrading from older Homarr versions
- Fixing inconsistent username casing in the database
- Standardizing usernames before migrating authentication providers
Common Workflows
Recovering Lost Admin Access
-
Check if any admin exists:
-
If no admin exists, create one:
- Save the generated password and log in
- Create additional admins through the UI
Resetting a User’s Password
-
Reset the password:
- Provide the new password to the user
- User logs in and can change password in Settings
Cleaning Up Usernames
-
Run the username fix:
- Notify users to use lowercase usernames
- Verify users can log in with new lowercase usernames
Troubleshooting
Command not found
Command not found
Ensure you’re running the command inside the Homarr container:
Credentials provider is not enabled
Credentials provider is not enabled
The command only works when credentials authentication is enabled. Check your Or add credentials alongside other providers:
.env:User not found
User not found
For
reset-password:- Verify username is correct (case-sensitive)
- Ensure user exists and uses credentials provider
- Check the database for the user:
Admin already exists
Admin already exists
For
recreate-admin:- This is a safety measure to prevent accidental admin creation
- If you lost admin access, use
reset-passwordon an existing admin - If genuinely no admin exists but you get this error, check group permissions in the database
Database Requirements
All CLI commands require:- Valid database connection (via environment variables)
- Database migrations completed
- Credentials authentication provider enabled (for user management commands)
.env
Security Considerations
- Generated passwords are 48 characters long and cryptographically secure
- Password resets invalidate all existing sessions immediately
- Admin creation includes safety checks to prevent unauthorized access
- CLI access requires container/system access - secure your Docker host
Command Help
Get help for any command:Next Steps
- Authentication Providers - Configure auth methods
- Environment Variables - Complete variable reference
- Database Configuration - Database setup and maintenance
