If you are using a waterproof membrane on the surface, it should be down 6" from the door. You might be better to make it free standing from the house as to not create leaking problems with tieing it in. If you're not sure the deck will take the weight with just a 4x4 going down, Build a wall out of treated material with 2 top plates, no beam required. If you do tie it to the wall use vinel flashing to go behind the house wrap and on top of the ledger against the house. Waterproof membrane should run some 6 " up the wall behind the siding and under the door threshold.