Menu
 

Restore Lost Admin Access

Restore Lost Admin Access

Losing admin privileges on your Project Zomboid server can be frustrating, especially when you need to manage your community or fix issues. This comprehensive guide covers multiple methods to restore admin access, explains what causes admin loss, and provides preventive measures to avoid future problems.

Why Admin Access Gets Lost

Admin access can be lost for several reasons:

  • Database Corruption - Server crashes or improper shutdowns can corrupt pzserver.db
  • Username Changes - Changing your Steam name without updating admin files
  • Manual File Edits - Typos in admin username files or config files
  • Mod Conflicts - Certain mods interfere with permission systems
  • Server Updates - Game updates occasionally reset admin databases
  • File Permission Errors - Incorrect file permissions preventing database writes

Method 1: Database Reset (Recommended)

This method resets all server permissions to default. It's the fastest and most reliable solution.

What This Method Does

WARNING: Deleting pzserver.db will remove:

  • All admin permissions and access control lists
  • All banned players (IP and Steam ID bans)
  • All whitelisted players (if whitelist is enabled)
  • Player tickets and support requests
  • User activity logs

What is NOT affected:

  • Player characters and inventories (stored in players.db)
  • World save data (stored in map_*.bin files)
  • Server configuration files (pzserver.ini, sandbox settings)
  • Installed mods

Step-by-Step Database Reset

  1. Backup Current Database (Optional but Recommended)
    • Navigate to /server-data/db/ in File Manager
    • Right-click pzserver.db and select "Download" to backup
    • Store the backup in case you need to restore ban lists later
  2. Open File Manager

    File Manager button in control panel

  3. Navigate to Database Directory
    • Go to /server-data/db/
    • This folder contains all server database files

    Navigating to server-data/db/ folder in File Manager

  4. Delete the Admin Database
    • Find pzserver.db
    • Right-click and select "Delete"
    • Confirm deletion when prompted

    Deleting pzserver.db file

  5. Restart Your Server
    • Click the "Restart" button in your control panel
    • Wait for the server to fully restart (30-60 seconds)
    • The server will automatically generate a new pzserver.db

    Restart button in server control panel

  6. Verify Admin Access Restored
    • Join your server with your admin account
    • Look for the admin wrench icon in top-left corner
    • Click it to open the admin panel
    • If the icon appears, admin access is restored

Method 2: Manual Admin File Fix

If you don't want to lose ban lists and whitelist data, you can manually fix the admin username file.

When to Use This Method

  • You have many banned players you don't want to lose
  • Your whitelist has many approved users
  • You know the exact issue (e.g., typo in username)
  • Database is not corrupted, just misconfigured

Step-by-Step Manual Fix

  1. Locate Admin File
    • Open File Manager
    • Navigate to /server-data/Server/
    • Find file named pzserver_admin.txt
  2. Edit Admin Username
    • Right-click pzserver_admin.txt and select "Edit"
    • Ensure your exact Steam username is listed (case-sensitive)
    • Remove any extra spaces or special characters
    • Save the file
  3. Check Alternate Admin Files

    Project Zomboid uses multiple admin permission files:

    • pzserver_admin.txt - Full admin privileges
    • pzserver_moderator.txt - Limited moderation access
    • pzserver_access.txt - Basic access permissions

    Ensure your username is in pzserver_admin.txt, NOT in the moderator file.

  4. Restart Server
    • Restart from control panel
    • Wait for full restart
    • Join and verify admin icon appears

Method 3: Database Repair (Advanced)

If your database is corrupted but you want to preserve data, you can attempt repair.

Using SQLite Database Repair

  1. Download the Database
    • Navigate to /server-data/db/
    • Download pzserver.db to your computer
  2. Install SQLite Browser
  3. Open and Repair
    • File → Open Database → select pzserver.db
    • If corruption detected, the tool will prompt for repair
    • Click "Yes" to attempt automatic repair
    • File → Write Changes to save repaired database
  4. Re-upload Database
    • Upload the repaired pzserver.db back to /server-data/db/
    • Overwrite the existing corrupted file
    • Restart server

Note: Database repair doesn't always work. If repair fails, use Method 1 (database reset).

Method 4: Console Command (If Partial Access)

If you can join the server but don't have admin icon, try console commands.

Using In-Game Console

  1. Enable Debug Mode
    • Join your server
    • Press F11 to open console (may not work if permissions are fully locked)
  2. Grant Admin via Console
    • Type: /grantadmin "YourUsername"
    • Replace YourUsername with your exact character name
    • Press Enter

Limitation: This only works if you have partial access or if another admin can execute the command for you.

Preventing Future Admin Loss

Best Practices

  • Regular Backups - Backup /server-data/ directory weekly
  • Graceful Shutdowns - Always use "Stop" button, never kill the process
  • Document Admin Usernames - Keep a list of admin Steam usernames
  • Multiple Admins - Add at least 2-3 trusted admins to prevent lockouts
  • Test After Updates - Verify admin access after game updates
  • Monitor Server Logs - Check logs for database errors or warnings

Setting Up Backup Admin Accounts

  1. Open /server-data/Server/pzserver_admin.txt
  2. Add multiple usernames (one per line):
    AdminUsername1
    AdminUsername2
    BackupAdmin3
  3. Save and restart server
  4. Verify all admins can access admin panel

Troubleshooting Common Issues

Admin Icon Still Not Appearing

Symptoms: Followed all steps but no admin wrench icon

Solutions:

  • Verify you're using the exact Steam username (check Steam profile)
  • Ensure no spaces before/after username in admin file
  • Check username is in pzserver_admin.txt, not pzserver_moderator.txt
  • Log out and log back into the server
  • Try deleting pzserver.db again and restart twice
  • Check server logs for "admin" or "permission" error messages

Database Keeps Regenerating with Same Problem

Cause: Config file corruption or mod interference

Solutions:

  • Disable all mods temporarily and test admin access
  • Delete pzserver.ini to reset server config (will reset ALL settings)
  • Check file permissions - server must have write access to /server-data/db/
  • Verify no other admin management mods are installed

Can Access Admin Panel But Commands Don't Work

Cause: Moderator permissions instead of full admin

Solutions:

  • Check you're listed in pzserver_admin.txt not pzserver_moderator.txt
  • Remove your username from moderator file if present
  • Moderators have limited powers - you need full admin for all commands
  • Restart server after moving username to admin file

Lost Admin After Steam Name Change

Cause: Admin files use old Steam username

Solutions:

  • Edit pzserver_admin.txt and update to new Steam name
  • Or temporarily change Steam name back to original, regain admin, then update file
  • Consider using Steam ID instead of username (more advanced setup)

Understanding Admin Permission Files

File Hierarchy

File Access Level Permissions
pzserver_admin.txt Full Admin All commands, server management, database access
pzserver_moderator.txt Moderator Kick, ban, teleport, limited admin panel
pzserver_access.txt Basic Access Whitelist bypass, special permissions

Example Admin File Structure

Content of pzserver_admin.txt:

ServerOwner
TrustedAdmin1
BackupAdmin2

Each line is one username. File must be plain text with no formatting.

Related Guides

Frequently Asked Questions

Q: Will deleting pzserver.db delete player progress?

A: No. Player characters, inventories, and skills are stored in players.db, which is not affected. Only admin permissions, bans, and whitelists are reset.

Q: How do I restore my ban list after database reset?

A: If you backed up pzserver.db before deletion, you can manually re-ban players by looking up their Steam IDs in the backup database using SQLite browser.

Q: Can I have multiple admins on my server?

A: Yes. Add multiple usernames to pzserver_admin.txt (one per line). All listed users will have full admin access.

Q: What's the difference between admin and moderator?

A: Admins have full server control including server settings, file access, and all commands. Moderators can kick/ban players and use some admin tools, but cannot change server configuration or access sensitive features.

Q: Why can't I use console commands even with admin icon?

A: Some commands require server.ini settings to enable. Check AllowDebugMode=true and DoLuaChecksum=false are set in your server config if console commands aren't working.

Q: Is there a way to reset admin without losing bans?

A: Yes. Use Method 2 (Manual Admin File Fix) instead of deleting the database. This preserves all database data while fixing admin file configuration.

Q: My server host doesn't give me file access. What can I do?

A: Contact your hosting provider's support. Most hosts offer database reset features through their control panel, or support staff can manually reset admin access for you.

Top