Your dog needs exercise and stimulation throughout the day if they are to become tired and sleep all night. Ig you do not want them waking you up in the early hours, there are a few things you can do.
Exercise Just Before Bed
Taking them a walk, or letting them run around your backyard if you have one, just before they go to bed will help. That last spurt of exercise gets rid of any energy they have left from the day, and they will have a better nights sleep.
Dogs cannot tell the time, but it does sometimes feel that they have an internal clock. If they wake up and you let them outside at 2 in the morning, the next night it will happen again at about the same time. After 3 or 4 nights of doing this it becomes normal to them and they think it is OK. Make the last run the final time you or they go out, and soon there will be no reason for them to wake.
If you are a bad sleeper that gets up in the night, your dog will assume that is the right thing to do. If you can improve your sleep pattern, you will improve theirs too.
Limit Their Fluids
Unless your dog has a health problem when their water should never be restricted, limit the amount they have before going to bed. They will come to no harm if you remove their water bowel a couple of hours before bedtime, and then they are less likely to wake you so they can do a wee.
No Playtime Just Before Bed
Dogs love to play, but just before bed can be the wrong time. They usually get excited when they play, and that will make it harder for them to settle. They will want a drink after play as well, which means they are more likely to need a bathroom break in the middle of the night.
Make Sure Their Bed Is Comfortable
You know how horrible it can be to try to get to sleep when you are uncomfortable. The same applies to dogs. If their bed is not right, they will toss and turn all night. They need a goods night sleep as much as you do, which is why so many people now but orthopedic dog beds, like the ones you can find at Pet Gear Lab. These typically have a thick foam padded base which puppies find great to sleep one. For dogs that are beginning to age and show signs of arthritis, they will suffer less joint pain through the night with an orthopedic dog bed.
Melatonin is a natural sleep aid often used by humans, and it is OK for your dog as well. However, before giving your dog this you should speak to your vet, as the dose size will vary according to their size and age. You also need to make sure that if they are taking any other medication it will not react in a bad way with it.
Now to get yourself some earplugs to deal with that contented doggie snoring!