The bed should ideally be placed in the “command position “, meaning that you have a view of the door, but are not in direct line of it. Why?
First, let's look at the primary function of the bedroom: sleep. This is the room for rest, relaxing, and romance. This room is your haven, you want to feel comfortable and safe.
If the bed is placed correctly, you will feel safe, in that with a view of the door, you won't feel any vulnerability from unwanted guests. Second, when not in direct line of the door, you have the added benefit of being able see what comes in through the door. You want the beneficial chi to enter your space, but not to rush in.
There are other things to consider, such as bathrooms, windows, walls. For instance, you wouldn't want your head to be on the other side of the toilet wall. You also, would prefer a solid wall over windows for a bed backing.
Consider what you see from the bed, and what is surrounding the bed on both sides of the wall for optimal bed placement.