There are plenty of guides on the internet on how to upgrade your PS4 hard drive. There are even discussions over whether it is beneficial to use an SSD or stick with a HDD, and whether it’s cheaper to buy a bare drive or one in an enclosure that you remove the drive from.
When I purchased my PS4 back in January it was my intention to replace the hard drive right away before I even turned the machine on but I couldn’t find a guide that explicitly said this was possible.
I tried it however, replacing the existing 500GB hard drive with a compatible 2TB HDD. The process itself is very straight forward- there are guides such as the one on Techradar that show you how.
it worked; all I had to do was download the firmware, Playstation have guide here, and put it on a USB stick. The guide shows how little the USB stick can be- you only need 320MB of free space.
Once you’ve plugged the USB stick in to your PS4, it allows you to install the firmware on your PS4 via the initialise PS4 option. I found this much less aggravation than setting up my PS4 first and then swapping the HDD.