I watched its me or the dog the other day and the trainer on that was working with a dog who did this. Without anyone present she got the dog to wait a safe distance away from the door giving them a treat each time they stayed quietly in the place she set whilst she went to the door. If they didnt stay quietly she would turn her back on them until they became quiet again. then the next stage was to build up with the waiting until she was able to 1) get to the door, 2) open the door 3) go out and come back in 4) get someone else to knock on door/ring bell 5) someone else to come in without the dog moving or barking. Her main approach was to continue to use 'wait' , turn away if the dog barked and to priase and give treat if dog waited and didnt bark. No idea if this works as havent had to do this yet.
Oh yes just remembered - approx 16 years ago when our first dog was a pup a trainer had told us to put metal baking tins in the same room as where the dog barked and each time the dog barked to throw keys at the tin to make a noise which distracted the dog from barking.
However what I must say is - my last dog I had happily for 14 years and I only just got my new one from the rescue yesterday and I am having great fun re learning everything