How to Fix Outlook Gmail Localhost Not Found Error
Question details
The user is unable to add a Gmail account to Outlook due to a 'localhost not found' error during the Google authentication process.

- Product
- Microsoft Outlook
- Device & OS
- Windows
- Scenario
- Adding a Gmail account to Microsoft Outlook using the standard setup wizard.
- Observed behavior
- Outlook displays a 'localhost not found' error message and fails to connect when attempting to authenticate the Gmail account using Google OAuth.
Ensure your internet connection is stable and have your current Google account login details, including any two-factor authentication devices, ready before attempting to sign in again.
Clear Outdated Credentials and Re-add Account
Removing stale Outlook and Microsoft credentials forces the application to request a fresh authentication token from Google.
Windows Credential Manager stores saved login tokens for various applications. If an old or corrupted token is conflicting with your new sign-in attempt, Outlook's OAuth redirect may fail and produce the localhost error.
Click the Windows Start button, type 'Credential Manager' into the search bar, and press Enter to open the utility.
Select 'Windows Credentials'. Scroll through the list to locate any entries related to 'MicrosoftOffice' or 'Outlook'. Click the downward arrow next to each relevant entry and select 'Remove'.
Restart Outlook. Navigate to File > Add Account, enter your Gmail address, and follow the prompts to complete the modern Google OAuth sign-in process in the resulting pop-up window.

Clear Browser Cache and Update Software
Stale browser authentication data or outdated Outlook versions can block the OAuth redirect, causing the localhost error.
Verify Gmail IMAP and Security Settings
Confirming that your Google account is properly configured to allow modern email clients to connect.
Try WPS Office as a Lightweight, Hassle-Free Alternative
If you frequently encounter persistent errors with Microsoft Office applications, consider switching to WPS Office. It provides a free, lightweight, and user-friendly alternative with excellent compatibility for all your document, spreadsheet, and presentation needs.
- 1. Visit the Official Website: Open your browser and navigate to the official WPS Office website at wps.com.
- 2. Download the Installer: Click the 'Free Download' button on the homepage to get the latest version for your operating system.
- 3. Install and Run: Open the downloaded file, follow the quick installation prompts, and start managing your office documents instantly.

Frequently Asked Questions
Why does Outlook show 'localhost not found' during Gmail setup?
This error occurs when the Google OAuth 2.0 authentication process fails to correctly redirect back to Outlook after you enter your credentials. This can happen due to corrupted browser cache, outdated Windows credentials, or strict local firewall rules blocking the connection.
Do I need an app password for Gmail in Outlook?
For current versions of Microsoft Outlook, you no longer need a dedicated app password. Outlook natively supports Google's modern OAuth sign-in process, which triggers a standard secure browser login window instead of requiring a direct password connection.
What should I do if my firewall is blocking the Outlook login?
Temporarily pause your third-party antivirus software or Windows Defender Firewall during the account setup process. After you have successfully authenticated your Gmail account in Outlook, you can safely re-enable your security software.
How do I ensure IMAP is enabled for my Google account?
Sign in to your Gmail account via a web browser, click the gear icon in the top right to access Settings, select 'See all settings', navigate to the 'Forwarding and POP/IMAP' tab, and ensure 'Enable IMAP' is selected under the IMAP access section.




