It's not an option I would recommend too much in the long run, because to play, that person will have to be connected and with the server running at all times. In other words, every time you want to ...
Minecraft Java Edition is 17 years old. For most of that time, playing with a friend meant setting up a server or hoping you shared a LAN. Bedrock Edition solved this years ago. Java never did – until ...