How to set up perforce for UE4?

I’d like to use perforce for source control. I downloaded and installed perforce, but when I had him try to connect to my server (MYCOMPUTERNAME:1666), it said connection failed. This led me to believe that it was just being hosted locally since I can connect to my own server. How do I host Perforce on an external server?

You need a static IP, ask your internet host provider. Most providers will set you up with one for 5$ a month. Of course for 5$ you could get a dedicated server from digitalOcean and setup perforce automatically Setting up version control (Perforce) for Unreal Engine 4 using DigitalOcean and Ubuntu (Part 1)