You can play D&D by yourself, but it's not recommended. It's more fun with friends.