Can you run server and play it on from same PC?

I was setting up a server and I just wanted to test it on the computer I play on for now. I am ware it is not optimal but it is just a Jensen map and it's just to test in the meantime.
I read online that you can by running the server first and others say you can't. In my test, both run but in Squad I have "Steam offline" no matter what.
Is the only way to use a VM? Thanks
0