Password Reset

How to reset your Supascale admin password.

How to reset your Supascale admin password if you've forgotten it or need to recover access.

Using the Reset Script

Supascale includes a password reset script that can be run from the command line.

Prerequisites

  • SSH access to your server
  • Access to the Supascale installation directory

Reset Steps

  1. SSH into your server:

    ssh user@your-server
    
  2. Navigate to the Supascale directory:

    cd /opt/supascale-web
    
  3. Stop the application:

    pm2 stop supascale-web
    
  4. Run the password reset script:

    node scripts/reset-password.js <username> <new-password>
    

    Example:

    node scripts/reset-password.js admin MyNewSecureP@ssw0rd!
    
  5. Restart the application:

    pm2 start supascale-web
    
  6. Log in with your new password

Password Requirements

Your new password must meet these requirements:

  • Minimum 8 characters
  • At least one uppercase letter
  • At least one lowercase letter
  • At least one number

For production environments, we recommend:

  • Minimum 12 characters
  • Include special characters (!@#$%^&*)
  • Avoid common words or patterns

Creating a New Admin User

If you need to create a completely new admin user instead of resetting an existing password:

cd /opt/supascale-web
pm2 stop supascale-web
node scripts/setup-admin.js <new-username> <password>
pm2 start supascale-web

Note: The setup-admin.js script only works when no users exist in the database. If users already exist, use the password reset script instead.

Troubleshooting

"User not found"

Error:

Error: User 'admin' not found

Solution: Check the correct username:

# View the database to find usernames
sqlite3 data/supascale.db "SELECT username FROM users;"

"Script not found"

Error:

Cannot find module 'scripts/reset-password.js'

Solution: Make sure you're in the correct directory:

# Find Supascale installation
find /opt -name "supascale-web" -type d 2>/dev/null

# Or check PM2 for the path
pm2 show supascale-web | grep "script path"

"Database locked"

Error:

SQLITE_BUSY: database is locked

Solution: Ensure the application is stopped:

pm2 stop supascale-web
pm2 list  # Verify it's stopped

# Then run the reset script
node scripts/reset-password.js admin newpassword

Permission Denied

Error:

EACCES: permission denied

Solution: Run with the correct user:

# Check who owns the files
ls -la /opt/supascale-web/data/

# Run as that user
sudo -u supascale node scripts/reset-password.js admin newpassword

Direct Database Reset (Advanced)

If the scripts are not available, you can reset the password directly in the database:

  1. Generate a password hash:

    node -e "console.log(require('bcryptjs').hashSync('YourNewPassword', 12))"
    
  2. Update the database:

    sqlite3 /opt/supascale-web/data/supascale.db
    
    UPDATE users SET password_hash = 'PASTE_HASH_HERE' WHERE username = 'admin';
    .quit
    
  3. Restart the application:

    pm2 restart supascale-web
    

Security Recommendations

After resetting your password:

  1. Check for unauthorized access in the activity log
  2. Review API keys and revoke any suspicious ones
  3. Update other credentials if you suspect a breach
  4. Enable strong passwords in Settings > Security

Emergency Access

If you've lost all admin access and the database is corrupted:

  1. Backup your data:

    cp -r /opt/supascale-web/data /opt/supascale-web/data.backup
    
  2. Reset the database:

    rm /opt/supascale-web/data/supascale.db*
    
  3. Restart Supascale - it will recreate the database

  4. Create a new admin:

    node scripts/setup-admin.js admin newpassword
    
  5. Restore your license via the web interface

Note: This will delete all settings, projects, and backups stored in Supascale. Your actual Supabase project data remains intact in their respective directories.