How to Fix iTunes Error 3004 When Restoring iPhone
What error 3004 means
Error 3004 appears in iTunes on Windows or Finder on a Mac while you're restoring an iPhone. The dialog reads, "The iPhone could not be restored. An unknown error occurred (3004)," and the phone is left sitting on the recovery-mode screen — computer icon and cable — waiting for a restore that actually finishes. Your photos and messages aren't gone, and the phone almost certainly isn't broken; the process just hit a wall before the new software could be verified and installed.
That "unknown error" label hides a very specific meaning. Error 3004 belongs to the 3000 range of iTunes errors, and every code in that range means the same thing: the computer failed to contact Apple's servers, gs.apple.com, on ports 80 or 443. Partway through a restore, iTunes must check in with Apple to verify the firmware it's about to install. When that check-in gets blocked — by a dead connection, outdated iTunes, antivirus or firewall software, a stale hosts-file entry, or a VPN rerouting the traffic — iTunes has no friendlier way to say it than "unknown error" and hands you error 3004.
Because the failure happens between the computer and Apple's servers, the fix is almost always on the computer side rather than the phone. Work through the steps below in order and the restore usually completes on the next attempt.
Common causes
- Blocked ports 80 or 443: antivirus or firewall software silently stops iTunes from reaching gs.apple.com.
- No real internet connection: weak, congested, or heavily filtered Wi-Fi that blocks the verification traffic.
- Outdated iTunes or macOS: old software mishandles the secure handshake with Apple's verification servers.
- Stale hosts-file entry: a leftover gs.apple.com redirect from jailbreaking utilities or manual tweaks sends iTunes to the wrong address.
- VPN or proxy interference: rerouted traffic breaks the direct verification connection to Apple's servers.
- Wrong system clock: a date and time far off reality makes Apple's secure servers reject the connection.
How to fix error 3004 — step by step
Follow these in order. Error 3004 is a connection problem, so the first three steps — verifying the internet, updating iTunes, and unblocking the traffic — solve the overwhelming majority of cases. Leave recovery mode as the fallback.
- Check your internet connection. Error 3004 is a communication failure between iTunes and Apple's servers, so the computer has to be genuinely online — open a website in a browser to prove it. If you're on weak, congested, or heavily filtered Wi-Fi (office, hotel, school networks are notorious), switch to a different network entirely. A phone hotspot makes a good test because it bypasses the local network's restrictions.
- Update iTunes to the latest version. Older iTunes builds can mishandle the secure conversation with Apple's verification servers, which is exactly what error 3004 reports. In classic iTunes, click Help at the top of the window and choose Check for Updates, then follow the prompts. If you use the modern Apple apps on Windows, open the Microsoft Store, go to Library, and update Apple Music and Apple Devices. On a Mac, restores happen in Finder, so keep macOS current through System Settings, General, Software Update. Restart the computer afterward and try the restore again.
- Temporarily disable security software. Third-party antivirus and firewall programs are the single most common cause of error 3004: they silently block iTunes from reaching Apple's servers on ports 80 and 443. On Windows, open Windows Security, go to Virus and threat protection, and pause real-time protection; also open the firewall settings and make sure iTunes isn't blocked. Try the restore with the protection off, then turn it back on right away when you're done.
- Check the hosts file for gs.apple.com entries. The hosts file maps server names to IP addresses before DNS ever gets a say, and an entry pointing gs.apple.com somewhere other than Apple's real servers — a leftover from jailbreaking utilities or manual tweaks — will break the restore with error 3004. On Windows, open Notepad as an administrator and open C:\Windows\System32\drivers\etc\hosts; on a Mac, open Terminal and edit /etc/hosts. If any line mentions gs.apple.com, delete it (or put a # at the start of the line to comment it out), save the file, restart the computer, and retry the restore.
- Disconnect VPN or proxy and correct the clock. A VPN or proxy reroutes iTunes' traffic on its way to Apple, and that detour can break the verification handshake the restore depends on — disconnect the VPN and bypass the proxy for one restore attempt. Then confirm the computer's date, time, and time zone are correct: a badly wrong system clock makes Apple's secure servers reject the connection. On Windows, check Settings, Time and language; on a Mac, check System Settings, General, Date and Time.
- Restart both devices and retry, or use recovery mode. Shut the computer down fully instead of just sleeping it, then force-restart the iPhone: press and quickly release Volume Up, press and quickly release Volume Down, then press and hold the Side button until the recovery-mode screen (computer and cable) appears. Connect the iPhone, let iTunes or Finder offer the Restore or Update option, and choose Update first so you don't lose your data. If Update fails, repeat and choose Restore — it erases the iPhone, so restore from an iCloud or computer backup afterward.
Did this fix it? Quick checklist
- The computer is genuinely online, ideally tested on a second network
- iTunes or macOS updated to the latest version, then the computer restarted
- Antivirus, firewall, and VPN disabled only for the restore attempt
- Hosts file free of gs.apple.com entries and the system clock correct
- The restore completes without error 3004 (or the recovery-mode restore succeeds)
If error 3004 survives a working connection, updated software, disabled security tools, a clean hosts file, and a recovery-mode restore, the blockage may sit at the router or ISP level — try a completely different network, like a phone hotspot, before anything else. As a last resort, book an appointment at an Apple Store or authorized service provider and mention error 3004; it tells them exactly which part of the restore pipeline failed.
Frequently asked questions
What does iTunes error 3004 mean?
Error 3004 means iTunes couldn't contact Apple's servers (gs.apple.com) on ports 80 or 443 during your iPhone restore or update. It's part of the 3000 range of iTunes errors, which all indicate a failure in communication between the computer and Apple's servers — not a hardware fault in the iPhone.
Why does antivirus software cause error 3004?
Many antivirus and firewall products treat iTunes' outbound connection to Apple's verification servers as suspicious and block it silently. With the traffic stopped, iTunes can't finish the firmware verification step of the restore and reports error 3004. Pausing real-time protection for the duration of the restore is the quickest test — just remember to switch it back on afterward.
Can the hosts file cause error 3004?
Yes. An entry that points gs.apple.com anywhere other than Apple's real servers — most often a leftover from jailbreaking utilities — sends iTunes' verification requests to the wrong place and the restore fails with error 3004. Removing or commenting out those entries lets iTunes reach the genuine Apple servers again.
Is error 3004 the same as error 3014?
They're close relatives. Both are 3000-range errors meaning iTunes can't reach Apple's servers during a restore or update, and the fixes overlap heavily — network, security software, hosts file, VPN, and clock checks work for both. Error 3014 tends to appear more often during updates, while 3004 shows up most commonly during restores, but the troubleshooting steps are the same.
Will fixing error 3004 erase my iPhone?
Not necessarily. The fixes for error 3004 — updating iTunes, unblocking security software, fixing the hosts file — don't touch your data. If the restore only completes with the full Restore option in recovery mode, that does erase the phone, but you can bring everything back from an iCloud or computer backup afterward. Always choose Update first when iTunes offers it.